From 874d750a1cec3bf99ec4181933666d7c214abc32 Mon Sep 17 00:00:00 2001 From: James Harrow Date: Wed, 29 Nov 2023 11:37:49 +0000 Subject: [PATCH 001/114] Fix #30665 (EVSE) - Changed to use amperage_mA, energy_mWh - removed max on epoch_s - removed access for operate - removed side for events --- .../data-model/chip/energy-evse-cluster.xml | 57 ++++++++----------- 1 file changed, 25 insertions(+), 32 deletions(-) diff --git a/src/app/zap-templates/zcl/data-model/chip/energy-evse-cluster.xml b/src/app/zap-templates/zcl/data-model/chip/energy-evse-cluster.xml index 8eed118f9ef953..6cd2a47dab50c5 100644 --- a/src/app/zap-templates/zcl/data-model/chip/energy-evse-cluster.xml +++ b/src/app/zap-templates/zcl/data-model/chip/energy-evse-cluster.xml @@ -71,7 +71,7 @@ limitations under the License. - + Energy EVSE @@ -88,15 +88,15 @@ limitations under the License. State SupplyState FaultState - ChargingEnabledUntil + ChargingEnabledUntil - DischargingEnabledUntil - CircuitCapacity - MinimumChargeCurrent - MaximumChargeCurrent + DischargingEnabledUntil + CircuitCapacity + MinimumChargeCurrent + MaximumChargeCurrent - MaximumDischargeCurrent - + MaximumDischargeCurrent + UserMaximumChargeCurrent @@ -115,7 +115,7 @@ limitations under the License. NextChargeTargetTime - NextChargeRequiredEnergy + NextChargeRequiredEnergy NextChargeTargetSoC @@ -127,48 +127,41 @@ limitations under the License. StateOfCharge - BatteryCapacity + BatteryCapacity VehicleID SessionID SessionDuration - SessionEnergyCharged + SessionEnergyCharged - SessionEnergyDischarged + SessionEnergyDischarged - Allows a client to disable the EVSE from charging and discharging. - - - + + Allows a client to enable the EVSE to charge an EV. - - + Allows a client to enable the EVSE to discharge an EV. - Allows a client to put the EVSE into a self-diagnostics mode. - Allows a client to set the user specified charging targets. - Allows a client to retrieve the user specified charging targets. - Allows a client to clear all stored charging targets. @@ -176,39 +169,39 @@ limitations under the License. The GetTargetsResponse is sent in response to the GetTargets Command. - + EVConnected - + EVNotDetected - - + + - + EnergyTransferStarted - + - + EnergyTransferStopped - + - + Fault - + RFID From 35a06a7d2853f065b6b86e5990985a9f31b76be3 Mon Sep 17 00:00:00 2001 From: James Harrow Date: Wed, 29 Nov 2023 15:28:55 +0000 Subject: [PATCH 002/114] Fix #30665 updates to try to get further with ZAP and autogen, but still fails with some parts of regen_all --- .../matter_idl/generators/type_definitions.py | 4 +++ src/app/zap-templates/common/override.js | 5 +++ .../zcl/data-model/chip/chip-types.xml | 5 +++ .../data_model/controller-clusters.matter | 34 +++++++++---------- .../data_model/controller-clusters.zap | 3 +- .../app-common/zap-generated/attribute-type.h | 4 +++ .../zap-generated/attributes/Accessors.cpp | 22 ++++++------ .../zap-generated/attributes/Accessors.h | 18 +++++----- 8 files changed, 57 insertions(+), 38 deletions(-) diff --git a/scripts/py_matter_idl/matter_idl/generators/type_definitions.py b/scripts/py_matter_idl/matter_idl/generators/type_definitions.py index 29d496b48315bb..f244294b6bb192 100644 --- a/scripts/py_matter_idl/matter_idl/generators/type_definitions.py +++ b/scripts/py_matter_idl/matter_idl/generators/type_definitions.py @@ -190,6 +190,7 @@ def is_struct(self) -> bool: # Derived types # Specification describes them in section '7.18.2. Derived Data Types' "action_id": BasicInteger(idl_name="action_id", byte_count=1, is_signed=False), + "amperage_mA": BasicInteger(idl_name="amperage_mA", byte_count=8, is_signed=True), "attrib_id": BasicInteger(idl_name="attrib_id", byte_count=4, is_signed=False), "cluster_id": BasicInteger(idl_name="cluster_id", byte_count=4, is_signed=False), "command_id": BasicInteger(idl_name="command_id", byte_count=4, is_signed=False), @@ -198,6 +199,7 @@ def is_struct(self) -> bool: "devtype_id": BasicInteger(idl_name="devtype_id", byte_count=4, is_signed=False), "elapsed_s": BasicInteger(idl_name="elapsed_s", byte_count=4, is_signed=False), "endpoint_no": BasicInteger(idl_name="endpoint_no", byte_count=2, is_signed=False), + "energy_mWh": BasicInteger(idl_name="energy_mWh", byte_count=8, is_signed=True), "entry_idx": BasicInteger(idl_name="entry_idx", byte_count=2, is_signed=False), "epoch_s": BasicInteger(idl_name="epoch_s", byte_count=4, is_signed=False), "epoch_us": BasicInteger(idl_name="epoch_us", byte_count=8, is_signed=False), @@ -212,6 +214,7 @@ def is_struct(self) -> bool: "percent": BasicInteger(idl_name="percent", byte_count=1, is_signed=False), "percent100ths": BasicInteger(idl_name="percent100ths", byte_count=2, is_signed=False), "posix_ms": BasicInteger(idl_name="posix_ms", byte_count=8, is_signed=False), + "power_mW": BasicInteger(idl_name="power_mW", byte_count=8, is_signed=True), "priority": BasicInteger(idl_name="priority", byte_count=1, is_signed=False), "status": BasicInteger(idl_name="status", byte_count=2, is_signed=False), "systime_ms": BasicInteger(idl_name="systime_ms", byte_count=8, is_signed=False), @@ -221,6 +224,7 @@ def is_struct(self) -> bool: "tod": BasicInteger(idl_name="tod", byte_count=4, is_signed=False), "trans_id": BasicInteger(idl_name="trans_id", byte_count=4, is_signed=False), "vendor_id": BasicInteger(idl_name="vendor_id", byte_count=2, is_signed=False), + "voltage_mV": BasicInteger(idl_name="voltage_mV", byte_count=8, is_signed=True), } diff --git a/src/app/zap-templates/common/override.js b/src/app/zap-templates/common/override.js index 98420cdabb1fda..de7bd90165bfc3 100644 --- a/src/app/zap-templates/common/override.js +++ b/src/app/zap-templates/common/override.js @@ -74,6 +74,11 @@ function atomicType(arg) return 'chip::Percent'; case 'percent100ths': return 'chip::Percent100ths'; + case 'power_mW': + case 'amperage_mA': + case 'voltage_mV': + case 'energy_mWh': + return 'int64_t'; case 'epoch_us': case 'systime_us': case 'posix_ms': diff --git a/src/app/zap-templates/zcl/data-model/chip/chip-types.xml b/src/app/zap-templates/zcl/data-model/chip/chip-types.xml index 0756fd85569f6c..40b5fc808f5ba9 100644 --- a/src/app/zap-templates/zcl/data-model/chip/chip-types.xml +++ b/src/app/zap-templates/zcl/data-model/chip/chip-types.xml @@ -56,6 +56,11 @@ limitations under the License. + + + + + diff --git a/src/controller/data_model/controller-clusters.matter b/src/controller/data_model/controller-clusters.matter index 54eae3531eadd4..33acf1e0c9616f 100644 --- a/src/controller/data_model/controller-clusters.matter +++ b/src/controller/data_model/controller-clusters.matter @@ -4370,7 +4370,7 @@ provisional cluster EnergyEvse = 153 { struct ChargingTargetStruct { int16u targetTime = 0; optional percent targetSoC = 1; - optional int64s addedEnergy = 2; + optional energy_mWh addedEnergy = 2; } info event EVConnected = 0 { @@ -4381,21 +4381,21 @@ provisional cluster EnergyEvse = 153 { int32u sessionID = 0; StateEnum state = 1; elapsed_s sessionDuration = 2; - int64s sessionEnergyCharged = 3; - optional int64s sessionEnergyDischarged = 4; + energy_mWh sessionEnergyCharged = 3; + optional energy_mWh sessionEnergyDischarged = 4; } info event EnergyTransferStarted = 2 { int32u sessionID = 0; StateEnum state = 1; - int64s maximumCurrent = 2; + amperage_mA maximumCurrent = 2; } info event EnergyTransferStopped = 3 { int32u sessionID = 0; StateEnum state = 1; EnergyTransferStoppedReasonEnum reason = 2; - int64s energyTransferred = 4; + energy_mWh energyTransferred = 4; } critical event Fault = 4 { @@ -4414,26 +4414,26 @@ provisional cluster EnergyEvse = 153 { 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; + readonly attribute amperage_mA circuitCapacity = 5; + readonly attribute amperage_mA minimumChargeCurrent = 6; + readonly attribute amperage_mA maximumChargeCurrent = 7; + readonly attribute optional amperage_mA maximumDischargeCurrent = 8; + attribute access(write: manage) optional amperage_mA userMaximumChargeCurrent = 9; attribute access(write: manage) optional elapsed_s randomizationDelayWindow = 10; readonly attribute optional int8u numberOfWeeklyTargets = 33; readonly attribute optional int8u numberOfDailyTargets = 34; readonly attribute optional nullable epoch_s nextChargeStartTime = 35; readonly attribute optional nullable epoch_s nextChargeTargetTime = 36; - readonly attribute optional nullable int64s nextChargeRequiredEnergy = 37; + readonly attribute optional nullable energy_mWh 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 energy_mWh 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 energy_mWh sessionEnergyCharged = 66; + readonly attribute optional energy_mWh sessionEnergyDischarged = 67; readonly attribute command_id generatedCommandList[] = 65528; readonly attribute command_id acceptedCommandList[] = 65529; readonly attribute event_id eventList[] = 65530; @@ -4448,13 +4448,13 @@ provisional cluster EnergyEvse = 153 { request struct EnableChargingRequest { nullable epoch_s chargingEnabledUntil = 0; - int64s minimumChargeCurrent = 1; - int64s maximumChargeCurrent = 2; + amperage_mA minimumChargeCurrent = 1; + amperage_mA maximumChargeCurrent = 2; } request struct EnableDischargingRequest { nullable epoch_s dischargingEnabledUntil = 0; - int64s maximumDischargeCurrent = 1; + amperage_mA maximumDischargeCurrent = 1; } request struct SetTargetsRequest { diff --git a/src/controller/data_model/controller-clusters.zap b/src/controller/data_model/controller-clusters.zap index 67b8da72bb5505..9bb8be22fae1a2 100644 --- a/src/controller/data_model/controller-clusters.zap +++ b/src/controller/data_model/controller-clusters.zap @@ -5400,5 +5400,6 @@ "endpointId": 1, "networkId": 0 } - ] + ], + "log": [] } \ No newline at end of file diff --git a/zzz_generated/app-common/app-common/zap-generated/attribute-type.h b/zzz_generated/app-common/app-common/zap-generated/attribute-type.h index e79d1281b33a8c..6b3b35cc4aa684 100644 --- a/zzz_generated/app-common/app-common/zap-generated/attribute-type.h +++ b/zzz_generated/app-common/app-common/zap-generated/attribute-type.h @@ -74,6 +74,10 @@ enum ZCL_SYSTIME_MS_ATTRIBUTE_TYPE = 0xD1, // System Time Milliseconds ZCL_ELAPSED_S_ATTRIBUTE_TYPE = 0xD2, // Elapsed Time Seconds ZCL_TEMPERATURE_ATTRIBUTE_TYPE = 0xD8, // Temperature + ZCL_POWER_M_W_ATTRIBUTE_TYPE = 0xD9, // Power milliwatts + ZCL_AMPERAGE_M_A_ATTRIBUTE_TYPE = 0xDA, // Amperage milliamps + ZCL_VOLTAGE_M_V_ATTRIBUTE_TYPE = 0xDB, // Voltage millivolts + ZCL_ENERGY_M_WH_ATTRIBUTE_TYPE = 0xDC, // Energy milliwatt-hours ZCL_TOD_ATTRIBUTE_TYPE = 0xE0, // Time of day ZCL_DATE_ATTRIBUTE_TYPE = 0xE1, // Date ZCL_EPOCH_US_ATTRIBUTE_TYPE = 0xE3, // Epoch Microseconds 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 1da947a4603420..329d3fe2711ade 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 @@ -10604,7 +10604,7 @@ EmberAfStatus Set(chip::EndpointId endpoint, int64_t value) 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); + return emberAfWriteAttribute(endpoint, Clusters::EnergyEvse::Id, Id, writable, ZCL_AMPERAGE_M_A_ATTRIBUTE_TYPE); } } // namespace CircuitCapacity @@ -10635,7 +10635,7 @@ EmberAfStatus Set(chip::EndpointId endpoint, int64_t value) 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); + return emberAfWriteAttribute(endpoint, Clusters::EnergyEvse::Id, Id, writable, ZCL_AMPERAGE_M_A_ATTRIBUTE_TYPE); } } // namespace MinimumChargeCurrent @@ -10666,7 +10666,7 @@ EmberAfStatus Set(chip::EndpointId endpoint, int64_t value) 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); + return emberAfWriteAttribute(endpoint, Clusters::EnergyEvse::Id, Id, writable, ZCL_AMPERAGE_M_A_ATTRIBUTE_TYPE); } } // namespace MaximumChargeCurrent @@ -10697,7 +10697,7 @@ EmberAfStatus Set(chip::EndpointId endpoint, int64_t value) 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); + return emberAfWriteAttribute(endpoint, Clusters::EnergyEvse::Id, Id, writable, ZCL_AMPERAGE_M_A_ATTRIBUTE_TYPE); } } // namespace MaximumDischargeCurrent @@ -10728,7 +10728,7 @@ EmberAfStatus Set(chip::EndpointId endpoint, int64_t value) 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); + return emberAfWriteAttribute(endpoint, Clusters::EnergyEvse::Id, Id, writable, ZCL_AMPERAGE_M_A_ATTRIBUTE_TYPE); } } // namespace UserMaximumChargeCurrent @@ -10961,7 +10961,7 @@ EmberAfStatus Set(chip::EndpointId endpoint, int64_t value) 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); + return emberAfWriteAttribute(endpoint, Clusters::EnergyEvse::Id, Id, writable, ZCL_ENERGY_M_WH_ATTRIBUTE_TYPE); } EmberAfStatus SetNull(chip::EndpointId endpoint) @@ -10970,7 +10970,7 @@ EmberAfStatus SetNull(chip::EndpointId endpoint) Traits::StorageType value; Traits::SetNull(value); uint8_t * writable = Traits::ToAttributeStoreRepresentation(value); - return emberAfWriteAttribute(endpoint, Clusters::EnergyEvse::Id, Id, writable, ZCL_INT64S_ATTRIBUTE_TYPE); + return emberAfWriteAttribute(endpoint, Clusters::EnergyEvse::Id, Id, writable, ZCL_ENERGY_M_WH_ATTRIBUTE_TYPE); } EmberAfStatus Set(chip::EndpointId endpoint, const chip::app::DataModel::Nullable & value) @@ -11173,7 +11173,7 @@ EmberAfStatus Set(chip::EndpointId endpoint, int64_t value) 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); + return emberAfWriteAttribute(endpoint, Clusters::EnergyEvse::Id, Id, writable, ZCL_ENERGY_M_WH_ATTRIBUTE_TYPE); } EmberAfStatus SetNull(chip::EndpointId endpoint) @@ -11182,7 +11182,7 @@ EmberAfStatus SetNull(chip::EndpointId endpoint) Traits::StorageType value; Traits::SetNull(value); uint8_t * writable = Traits::ToAttributeStoreRepresentation(value); - return emberAfWriteAttribute(endpoint, Clusters::EnergyEvse::Id, Id, writable, ZCL_INT64S_ATTRIBUTE_TYPE); + return emberAfWriteAttribute(endpoint, Clusters::EnergyEvse::Id, Id, writable, ZCL_ENERGY_M_WH_ATTRIBUTE_TYPE); } EmberAfStatus Set(chip::EndpointId endpoint, const chip::app::DataModel::Nullable & value) @@ -11356,7 +11356,7 @@ EmberAfStatus Set(chip::EndpointId endpoint, int64_t value) 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); + return emberAfWriteAttribute(endpoint, Clusters::EnergyEvse::Id, Id, writable, ZCL_ENERGY_M_WH_ATTRIBUTE_TYPE); } } // namespace SessionEnergyCharged @@ -11387,7 +11387,7 @@ EmberAfStatus Set(chip::EndpointId endpoint, int64_t value) 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); + return emberAfWriteAttribute(endpoint, Clusters::EnergyEvse::Id, Id, writable, ZCL_ENERGY_M_WH_ATTRIBUTE_TYPE); } } // namespace SessionEnergyDischarged 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 05505afea06d13..20da316a721554 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 @@ -2038,27 +2038,27 @@ EmberAfStatus Set(chip::EndpointId endpoint, const chip::app::DataModel::Nullabl } // namespace DischargingEnabledUntil namespace CircuitCapacity { -EmberAfStatus Get(chip::EndpointId endpoint, int64_t * value); // int64s +EmberAfStatus Get(chip::EndpointId endpoint, int64_t * value); // amperage_mA EmberAfStatus Set(chip::EndpointId endpoint, int64_t value); } // namespace CircuitCapacity namespace MinimumChargeCurrent { -EmberAfStatus Get(chip::EndpointId endpoint, int64_t * value); // int64s +EmberAfStatus Get(chip::EndpointId endpoint, int64_t * value); // amperage_mA EmberAfStatus Set(chip::EndpointId endpoint, int64_t value); } // namespace MinimumChargeCurrent namespace MaximumChargeCurrent { -EmberAfStatus Get(chip::EndpointId endpoint, int64_t * value); // int64s +EmberAfStatus Get(chip::EndpointId endpoint, int64_t * value); // amperage_mA EmberAfStatus Set(chip::EndpointId endpoint, int64_t value); } // namespace MaximumChargeCurrent namespace MaximumDischargeCurrent { -EmberAfStatus Get(chip::EndpointId endpoint, int64_t * value); // int64s +EmberAfStatus Get(chip::EndpointId endpoint, int64_t * value); // amperage_mA EmberAfStatus Set(chip::EndpointId endpoint, int64_t value); } // namespace MaximumDischargeCurrent namespace UserMaximumChargeCurrent { -EmberAfStatus Get(chip::EndpointId endpoint, int64_t * value); // int64s +EmberAfStatus Get(chip::EndpointId endpoint, int64_t * value); // amperage_mA EmberAfStatus Set(chip::EndpointId endpoint, int64_t value); } // namespace UserMaximumChargeCurrent @@ -2092,7 +2092,7 @@ EmberAfStatus Set(chip::EndpointId endpoint, const chip::app::DataModel::Nullabl } // namespace NextChargeTargetTime namespace NextChargeRequiredEnergy { -EmberAfStatus Get(chip::EndpointId endpoint, DataModel::Nullable & value); // int64s +EmberAfStatus Get(chip::EndpointId endpoint, DataModel::Nullable & value); // energy_mWh EmberAfStatus Set(chip::EndpointId endpoint, int64_t value); EmberAfStatus SetNull(chip::EndpointId endpoint); EmberAfStatus Set(chip::EndpointId endpoint, const chip::app::DataModel::Nullable & value); @@ -2120,7 +2120,7 @@ EmberAfStatus Set(chip::EndpointId endpoint, const chip::app::DataModel::Nullabl } // namespace StateOfCharge namespace BatteryCapacity { -EmberAfStatus Get(chip::EndpointId endpoint, DataModel::Nullable & value); // int64s +EmberAfStatus Get(chip::EndpointId endpoint, DataModel::Nullable & value); // energy_mWh EmberAfStatus Set(chip::EndpointId endpoint, int64_t value); EmberAfStatus SetNull(chip::EndpointId endpoint); EmberAfStatus Set(chip::EndpointId endpoint, const chip::app::DataModel::Nullable & value); @@ -2146,12 +2146,12 @@ EmberAfStatus Set(chip::EndpointId endpoint, uint32_t value); } // namespace SessionDuration namespace SessionEnergyCharged { -EmberAfStatus Get(chip::EndpointId endpoint, int64_t * value); // int64s +EmberAfStatus Get(chip::EndpointId endpoint, int64_t * value); // energy_mWh EmberAfStatus Set(chip::EndpointId endpoint, int64_t value); } // namespace SessionEnergyCharged namespace SessionEnergyDischarged { -EmberAfStatus Get(chip::EndpointId endpoint, int64_t * value); // int64s +EmberAfStatus Get(chip::EndpointId endpoint, int64_t * value); // energy_mWh EmberAfStatus Set(chip::EndpointId endpoint, int64_t value); } // namespace SessionEnergyDischarged From c3aef3a35ee4d6256905b69ba03cd4105314f652 Mon Sep 17 00:00:00 2001 From: James Harrow Date: Wed, 29 Nov 2023 21:15:12 +0000 Subject: [PATCH 003/114] Added ember-compatibility-functions.cpp which was missing. --- src/app/util/ember-compatibility-functions.cpp | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/app/util/ember-compatibility-functions.cpp b/src/app/util/ember-compatibility-functions.cpp index de08342c4f18f6..3cf10a86d3f169 100644 --- a/src/app/util/ember-compatibility-functions.cpp +++ b/src/app/util/ember-compatibility-functions.cpp @@ -123,6 +123,12 @@ EmberAfAttributeType BaseType(EmberAfAttributeType type) "chip::DataVersion is expected to be uint32_t, change this when necessary"); return ZCL_INT32U_ATTRIBUTE_TYPE; + case ZCL_AMPERAGE_M_A_ATTRIBUTE_TYPE: // Amperage milliamps + case ZCL_ENERGY_M_WH_ATTRIBUTE_TYPE: // Energy milliwatt-hours + case ZCL_POWER_M_W_ATTRIBUTE_TYPE: // Power milliwatts + case ZCL_VOLTAGE_M_V_ATTRIBUTE_TYPE: // Voltage millivolts + return ZCL_INT64S_ATTRIBUTE_TYPE; + case ZCL_EVENT_NO_ATTRIBUTE_TYPE: // Event Number case ZCL_FABRIC_ID_ATTRIBUTE_TYPE: // Fabric Id case ZCL_NODE_ID_ATTRIBUTE_TYPE: // Node Id From a71bef88c3584142c663fd3c17bb3defc1e4347e Mon Sep 17 00:00:00 2001 From: James Harrow Date: Wed, 29 Nov 2023 22:50:26 +0000 Subject: [PATCH 004/114] Made all types all lowercase to resolve regen_all issues. --- .../network-manager-app.matter | 114 +++++++++--------- .../matter_idl/generators/type_definitions.py | 8 +- .../util/ember-compatibility-functions.cpp | 8 +- src/app/zap-templates/common/override.js | 8 +- .../zcl/data-model/chip/chip-types.xml | 8 +- .../data-model/chip/energy-evse-cluster.xml | 34 +++--- .../data_model/controller-clusters.matter | 34 +++--- .../app-common/zap-generated/attribute-type.h | 8 +- .../zap-generated/attributes/Accessors.cpp | 22 ++-- .../zap-generated/attributes/Accessors.h | 18 +-- .../zap-generated/cluster/Commands.h | 35 +++--- .../zap-generated/cluster/Commands.h | 8 +- 12 files changed, 151 insertions(+), 154 deletions(-) diff --git a/examples/network-manager-app/network-manager-common/network-manager-app.matter b/examples/network-manager-app/network-manager-common/network-manager-app.matter index b5760ecb46703b..a91e5664fcf32e 100644 --- a/examples/network-manager-app/network-manager-common/network-manager-app.matter +++ b/examples/network-manager-app/network-manager-common/network-manager-app.matter @@ -1178,11 +1178,11 @@ endpoint 0 { callback attribute serverList; callback attribute clientList; callback attribute partsList; - callback attribute generatedCommandList default = 0; - callback attribute acceptedCommandList default = 0; - callback attribute attributeList default = 0; + callback attribute generatedCommandList; + callback attribute acceptedCommandList; + callback attribute attributeList; ram attribute featureMap default = 0; - callback attribute clusterRevision default = 1; + callback attribute clusterRevision; } server cluster AccessControl { @@ -1190,32 +1190,32 @@ endpoint 0 { emits event AccessControlExtensionChanged; callback attribute acl; callback attribute extension; - callback attribute subjectsPerAccessControlEntry default = 4; - callback attribute targetsPerAccessControlEntry default = 3; - callback attribute accessControlEntriesPerFabric default = 3; - callback attribute generatedCommandList default = 0; - callback attribute acceptedCommandList default = 0; + callback attribute subjectsPerAccessControlEntry; + callback attribute targetsPerAccessControlEntry; + callback attribute accessControlEntriesPerFabric; + callback attribute generatedCommandList; + callback attribute acceptedCommandList; callback attribute attributeList; ram attribute featureMap default = 0; - callback attribute clusterRevision default = 1; + callback attribute clusterRevision; } server cluster BasicInformation { emits event StartUp; emits event ShutDown; emits event Leave; - callback attribute dataModelRevision default = 10; + callback attribute dataModelRevision; callback attribute vendorName; callback attribute vendorID; callback attribute productName; callback attribute productID; persist attribute nodeLabel; - callback attribute location default = "XX"; - callback attribute hardwareVersion default = 0; + callback attribute location; + callback attribute hardwareVersion; callback attribute hardwareVersionString; - callback attribute softwareVersion default = 0; + callback attribute softwareVersion; callback attribute softwareVersionString; - callback attribute manufacturingDate default = "20210614123456ZZ"; + callback attribute manufacturingDate; callback attribute partNumber; callback attribute productURL; callback attribute productLabel; @@ -1226,9 +1226,9 @@ endpoint 0 { callback attribute capabilityMinima; callback attribute specificationVersion; callback attribute maxPathsPerInvoke; - callback attribute generatedCommandList default = 0; - callback attribute acceptedCommandList default = 0; - callback attribute attributeList default = 0; + callback attribute generatedCommandList; + callback attribute acceptedCommandList; + callback attribute attributeList; ram attribute featureMap default = 0; ram attribute clusterRevision default = 3; } @@ -1236,12 +1236,12 @@ endpoint 0 { server cluster GeneralCommissioning { ram attribute breadcrumb default = 0x0000000000000000; callback attribute basicCommissioningInfo; - callback attribute regulatoryConfig default = 0; - callback attribute locationCapability default = 0; - callback attribute supportsConcurrentConnection default = 1; - callback attribute generatedCommandList default = 0; - callback attribute acceptedCommandList default = 0; - callback attribute attributeList default = 0; + callback attribute regulatoryConfig; + callback attribute locationCapability; + callback attribute supportsConcurrentConnection; + callback attribute generatedCommandList; + callback attribute acceptedCommandList; + callback attribute attributeList; ram attribute featureMap default = 0; ram attribute clusterRevision default = 1; @@ -1260,9 +1260,9 @@ endpoint 0 { callback attribute lastNetworkingStatus; callback attribute lastNetworkID; callback attribute lastConnectErrorValue; - callback attribute generatedCommandList default = 0; - callback attribute acceptedCommandList default = 0; - callback attribute attributeList default = 0; + callback attribute generatedCommandList; + callback attribute acceptedCommandList; + callback attribute attributeList; callback attribute featureMap default = 0; ram attribute clusterRevision default = 1; } @@ -1273,17 +1273,17 @@ endpoint 0 { emits event NetworkFaultChange; emits event BootReason; callback attribute networkInterfaces; - callback attribute rebootCount default = 0x0000; - callback attribute upTime default = 0x0000000000000000; - callback attribute totalOperationalHours default = 0x00000000; + callback attribute rebootCount; + callback attribute upTime; + callback attribute totalOperationalHours; callback attribute bootReason; callback attribute activeHardwareFaults; callback attribute activeRadioFaults; callback attribute activeNetworkFaults; callback attribute testEventTriggersEnabled default = false; - callback attribute generatedCommandList default = 0; - callback attribute acceptedCommandList default = 0; - callback attribute attributeList default = 0; + callback attribute generatedCommandList; + callback attribute acceptedCommandList; + callback attribute attributeList; ram attribute featureMap default = 0; ram attribute clusterRevision default = 0x0002; @@ -1296,8 +1296,8 @@ endpoint 0 { callback attribute channel; callback attribute routingRole; callback attribute networkName; - callback attribute panId default = 0x0000; - callback attribute extendedPanId default = 0x0000000000000000; + callback attribute panId; + callback attribute extendedPanId; callback attribute meshLocalPrefix; callback attribute neighborTable; callback attribute routeTable; @@ -1325,16 +1325,16 @@ endpoint 0 { callback attribute bssid; callback attribute securityType; callback attribute wiFiVersion; - callback attribute channelNumber default = 0x0000; - callback attribute rssi default = 0x00; - callback attribute beaconLostCount default = 0x00000000; - callback attribute beaconRxCount default = 0x00000000; - callback attribute packetMulticastRxCount default = 0x00000000; - callback attribute packetMulticastTxCount default = 0x00000000; - callback attribute packetUnicastRxCount default = 0x00000000; - callback attribute packetUnicastTxCount default = 0x00000000; - callback attribute currentMaxRate default = 0x0000000000000000; - callback attribute overrunCount default = 0x0000000000000000; + callback attribute channelNumber; + callback attribute rssi; + callback attribute beaconLostCount; + callback attribute beaconRxCount; + callback attribute packetMulticastRxCount; + callback attribute packetMulticastTxCount; + callback attribute packetUnicastRxCount; + callback attribute packetUnicastTxCount; + callback attribute currentMaxRate; + callback attribute overrunCount; ram attribute featureMap default = 3; ram attribute clusterRevision default = 1; @@ -1352,12 +1352,12 @@ endpoint 0 { } server cluster AdministratorCommissioning { - callback attribute windowStatus default = 0; - callback attribute adminFabricIndex default = 1; - callback attribute adminVendorId default = 0; - callback attribute generatedCommandList default = 0; - callback attribute acceptedCommandList default = 0; - callback attribute attributeList default = 0; + callback attribute windowStatus; + callback attribute adminFabricIndex; + callback attribute adminVendorId; + callback attribute generatedCommandList; + callback attribute acceptedCommandList; + callback attribute attributeList; ram attribute featureMap default = 0; ram attribute clusterRevision default = 1; @@ -1372,9 +1372,9 @@ endpoint 0 { callback attribute commissionedFabrics; callback attribute trustedRootCertificates; callback attribute currentFabricIndex; - callback attribute generatedCommandList default = 0; - callback attribute acceptedCommandList default = 0; - callback attribute attributeList default = 0; + callback attribute generatedCommandList; + callback attribute acceptedCommandList; + callback attribute attributeList; ram attribute featureMap default = 0; ram attribute clusterRevision default = 1; @@ -1397,8 +1397,8 @@ endpoint 0 { callback attribute groupTable; callback attribute maxGroupsPerFabric; callback attribute maxGroupKeysPerFabric; - callback attribute featureMap default = 0; - callback attribute clusterRevision default = 1; + callback attribute featureMap; + callback attribute clusterRevision; handle command KeySetWrite; handle command KeySetRead; @@ -1422,7 +1422,7 @@ endpoint 1 { callback attribute eventList; callback attribute attributeList; ram attribute featureMap default = 0; - callback attribute clusterRevision default = 2; + callback attribute clusterRevision; } } diff --git a/scripts/py_matter_idl/matter_idl/generators/type_definitions.py b/scripts/py_matter_idl/matter_idl/generators/type_definitions.py index f244294b6bb192..6caf3a4dbd125c 100644 --- a/scripts/py_matter_idl/matter_idl/generators/type_definitions.py +++ b/scripts/py_matter_idl/matter_idl/generators/type_definitions.py @@ -190,7 +190,7 @@ def is_struct(self) -> bool: # Derived types # Specification describes them in section '7.18.2. Derived Data Types' "action_id": BasicInteger(idl_name="action_id", byte_count=1, is_signed=False), - "amperage_mA": BasicInteger(idl_name="amperage_mA", byte_count=8, is_signed=True), + "amperage_ma": BasicInteger(idl_name="amperage_ma", byte_count=8, is_signed=True), "attrib_id": BasicInteger(idl_name="attrib_id", byte_count=4, is_signed=False), "cluster_id": BasicInteger(idl_name="cluster_id", byte_count=4, is_signed=False), "command_id": BasicInteger(idl_name="command_id", byte_count=4, is_signed=False), @@ -199,7 +199,7 @@ def is_struct(self) -> bool: "devtype_id": BasicInteger(idl_name="devtype_id", byte_count=4, is_signed=False), "elapsed_s": BasicInteger(idl_name="elapsed_s", byte_count=4, is_signed=False), "endpoint_no": BasicInteger(idl_name="endpoint_no", byte_count=2, is_signed=False), - "energy_mWh": BasicInteger(idl_name="energy_mWh", byte_count=8, is_signed=True), + "energy_mwh": BasicInteger(idl_name="energy_mwh", byte_count=8, is_signed=True), "entry_idx": BasicInteger(idl_name="entry_idx", byte_count=2, is_signed=False), "epoch_s": BasicInteger(idl_name="epoch_s", byte_count=4, is_signed=False), "epoch_us": BasicInteger(idl_name="epoch_us", byte_count=8, is_signed=False), @@ -214,7 +214,7 @@ def is_struct(self) -> bool: "percent": BasicInteger(idl_name="percent", byte_count=1, is_signed=False), "percent100ths": BasicInteger(idl_name="percent100ths", byte_count=2, is_signed=False), "posix_ms": BasicInteger(idl_name="posix_ms", byte_count=8, is_signed=False), - "power_mW": BasicInteger(idl_name="power_mW", byte_count=8, is_signed=True), + "power_mw": BasicInteger(idl_name="power_mw", byte_count=8, is_signed=True), "priority": BasicInteger(idl_name="priority", byte_count=1, is_signed=False), "status": BasicInteger(idl_name="status", byte_count=2, is_signed=False), "systime_ms": BasicInteger(idl_name="systime_ms", byte_count=8, is_signed=False), @@ -224,7 +224,7 @@ def is_struct(self) -> bool: "tod": BasicInteger(idl_name="tod", byte_count=4, is_signed=False), "trans_id": BasicInteger(idl_name="trans_id", byte_count=4, is_signed=False), "vendor_id": BasicInteger(idl_name="vendor_id", byte_count=2, is_signed=False), - "voltage_mV": BasicInteger(idl_name="voltage_mV", byte_count=8, is_signed=True), + "voltage_mv": BasicInteger(idl_name="voltage_mv", byte_count=8, is_signed=True), } diff --git a/src/app/util/ember-compatibility-functions.cpp b/src/app/util/ember-compatibility-functions.cpp index 3cf10a86d3f169..6a3c6fd5b0ada0 100644 --- a/src/app/util/ember-compatibility-functions.cpp +++ b/src/app/util/ember-compatibility-functions.cpp @@ -123,10 +123,10 @@ EmberAfAttributeType BaseType(EmberAfAttributeType type) "chip::DataVersion is expected to be uint32_t, change this when necessary"); return ZCL_INT32U_ATTRIBUTE_TYPE; - case ZCL_AMPERAGE_M_A_ATTRIBUTE_TYPE: // Amperage milliamps - case ZCL_ENERGY_M_WH_ATTRIBUTE_TYPE: // Energy milliwatt-hours - case ZCL_POWER_M_W_ATTRIBUTE_TYPE: // Power milliwatts - case ZCL_VOLTAGE_M_V_ATTRIBUTE_TYPE: // Voltage millivolts + case ZCL_AMPERAGE_MA_ATTRIBUTE_TYPE: // Amperage milliamps + case ZCL_ENERGY_MWH_ATTRIBUTE_TYPE: // Energy milliwatt-hours + case ZCL_POWER_MW_ATTRIBUTE_TYPE: // Power milliwatts + case ZCL_VOLTAGE_MV_ATTRIBUTE_TYPE: // Voltage millivolts return ZCL_INT64S_ATTRIBUTE_TYPE; case ZCL_EVENT_NO_ATTRIBUTE_TYPE: // Event Number diff --git a/src/app/zap-templates/common/override.js b/src/app/zap-templates/common/override.js index de7bd90165bfc3..098af41e5154e2 100644 --- a/src/app/zap-templates/common/override.js +++ b/src/app/zap-templates/common/override.js @@ -74,10 +74,10 @@ function atomicType(arg) return 'chip::Percent'; case 'percent100ths': return 'chip::Percent100ths'; - case 'power_mW': - case 'amperage_mA': - case 'voltage_mV': - case 'energy_mWh': + case 'power_mw': + case 'amperage_ma': + case 'voltage_mv': + case 'energy_mwh': return 'int64_t'; case 'epoch_us': case 'systime_us': diff --git a/src/app/zap-templates/zcl/data-model/chip/chip-types.xml b/src/app/zap-templates/zcl/data-model/chip/chip-types.xml index 40b5fc808f5ba9..176b82722f2ecc 100644 --- a/src/app/zap-templates/zcl/data-model/chip/chip-types.xml +++ b/src/app/zap-templates/zcl/data-model/chip/chip-types.xml @@ -56,10 +56,10 @@ limitations under the License. - - - - + + + + diff --git a/src/app/zap-templates/zcl/data-model/chip/energy-evse-cluster.xml b/src/app/zap-templates/zcl/data-model/chip/energy-evse-cluster.xml index 6cd2a47dab50c5..83f44e37f1eaf4 100644 --- a/src/app/zap-templates/zcl/data-model/chip/energy-evse-cluster.xml +++ b/src/app/zap-templates/zcl/data-model/chip/energy-evse-cluster.xml @@ -71,7 +71,7 @@ limitations under the License. - + Energy EVSE @@ -91,12 +91,12 @@ limitations under the License. ChargingEnabledUntil DischargingEnabledUntil - CircuitCapacity - MinimumChargeCurrent - MaximumChargeCurrent + CircuitCapacity + MinimumChargeCurrent + MaximumChargeCurrent - MaximumDischargeCurrent - + MaximumDischargeCurrent + UserMaximumChargeCurrent @@ -115,7 +115,7 @@ limitations under the License. NextChargeTargetTime - NextChargeRequiredEnergy + NextChargeRequiredEnergy NextChargeTargetSoC @@ -127,26 +127,26 @@ limitations under the License. StateOfCharge - BatteryCapacity + BatteryCapacity VehicleID SessionID SessionDuration - SessionEnergyCharged + SessionEnergyCharged - SessionEnergyDischarged + SessionEnergyDischarged Allows a client to disable the EVSE from charging and discharging. - - + + Allows a client to enable the EVSE to charge an EV. - + Allows a client to enable the EVSE to discharge an EV. @@ -178,21 +178,21 @@ limitations under the License. - - + + EnergyTransferStarted - + EnergyTransferStopped - + Fault diff --git a/src/controller/data_model/controller-clusters.matter b/src/controller/data_model/controller-clusters.matter index 33acf1e0c9616f..14a3fa22ab0809 100644 --- a/src/controller/data_model/controller-clusters.matter +++ b/src/controller/data_model/controller-clusters.matter @@ -4370,7 +4370,7 @@ provisional cluster EnergyEvse = 153 { struct ChargingTargetStruct { int16u targetTime = 0; optional percent targetSoC = 1; - optional energy_mWh addedEnergy = 2; + optional energy_mwh addedEnergy = 2; } info event EVConnected = 0 { @@ -4381,21 +4381,21 @@ provisional cluster EnergyEvse = 153 { int32u sessionID = 0; StateEnum state = 1; elapsed_s sessionDuration = 2; - energy_mWh sessionEnergyCharged = 3; - optional energy_mWh sessionEnergyDischarged = 4; + energy_mwh sessionEnergyCharged = 3; + optional energy_mwh sessionEnergyDischarged = 4; } info event EnergyTransferStarted = 2 { int32u sessionID = 0; StateEnum state = 1; - amperage_mA maximumCurrent = 2; + amperage_ma maximumCurrent = 2; } info event EnergyTransferStopped = 3 { int32u sessionID = 0; StateEnum state = 1; EnergyTransferStoppedReasonEnum reason = 2; - energy_mWh energyTransferred = 4; + energy_mwh energyTransferred = 4; } critical event Fault = 4 { @@ -4414,26 +4414,26 @@ provisional cluster EnergyEvse = 153 { readonly attribute FaultStateEnum faultState = 2; readonly attribute nullable epoch_s chargingEnabledUntil = 3; readonly attribute optional nullable epoch_s dischargingEnabledUntil = 4; - readonly attribute amperage_mA circuitCapacity = 5; - readonly attribute amperage_mA minimumChargeCurrent = 6; - readonly attribute amperage_mA maximumChargeCurrent = 7; - readonly attribute optional amperage_mA maximumDischargeCurrent = 8; - attribute access(write: manage) optional amperage_mA userMaximumChargeCurrent = 9; + readonly attribute amperage_ma circuitCapacity = 5; + readonly attribute amperage_ma minimumChargeCurrent = 6; + readonly attribute amperage_ma maximumChargeCurrent = 7; + readonly attribute optional amperage_ma maximumDischargeCurrent = 8; + attribute access(write: manage) optional amperage_ma userMaximumChargeCurrent = 9; attribute access(write: manage) optional elapsed_s randomizationDelayWindow = 10; readonly attribute optional int8u numberOfWeeklyTargets = 33; readonly attribute optional int8u numberOfDailyTargets = 34; readonly attribute optional nullable epoch_s nextChargeStartTime = 35; readonly attribute optional nullable epoch_s nextChargeTargetTime = 36; - readonly attribute optional nullable energy_mWh nextChargeRequiredEnergy = 37; + readonly attribute optional nullable energy_mwh 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 energy_mWh batteryCapacity = 49; + readonly attribute optional nullable energy_mwh 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 energy_mWh sessionEnergyCharged = 66; - readonly attribute optional energy_mWh sessionEnergyDischarged = 67; + readonly attribute energy_mwh sessionEnergyCharged = 66; + readonly attribute optional energy_mwh sessionEnergyDischarged = 67; readonly attribute command_id generatedCommandList[] = 65528; readonly attribute command_id acceptedCommandList[] = 65529; readonly attribute event_id eventList[] = 65530; @@ -4448,13 +4448,13 @@ provisional cluster EnergyEvse = 153 { request struct EnableChargingRequest { nullable epoch_s chargingEnabledUntil = 0; - amperage_mA minimumChargeCurrent = 1; - amperage_mA maximumChargeCurrent = 2; + amperage_ma minimumChargeCurrent = 1; + amperage_ma maximumChargeCurrent = 2; } request struct EnableDischargingRequest { nullable epoch_s dischargingEnabledUntil = 0; - amperage_mA maximumDischargeCurrent = 1; + amperage_ma maximumDischargeCurrent = 1; } request struct SetTargetsRequest { diff --git a/zzz_generated/app-common/app-common/zap-generated/attribute-type.h b/zzz_generated/app-common/app-common/zap-generated/attribute-type.h index 6b3b35cc4aa684..c89f71a91d4a21 100644 --- a/zzz_generated/app-common/app-common/zap-generated/attribute-type.h +++ b/zzz_generated/app-common/app-common/zap-generated/attribute-type.h @@ -74,10 +74,10 @@ enum ZCL_SYSTIME_MS_ATTRIBUTE_TYPE = 0xD1, // System Time Milliseconds ZCL_ELAPSED_S_ATTRIBUTE_TYPE = 0xD2, // Elapsed Time Seconds ZCL_TEMPERATURE_ATTRIBUTE_TYPE = 0xD8, // Temperature - ZCL_POWER_M_W_ATTRIBUTE_TYPE = 0xD9, // Power milliwatts - ZCL_AMPERAGE_M_A_ATTRIBUTE_TYPE = 0xDA, // Amperage milliamps - ZCL_VOLTAGE_M_V_ATTRIBUTE_TYPE = 0xDB, // Voltage millivolts - ZCL_ENERGY_M_WH_ATTRIBUTE_TYPE = 0xDC, // Energy milliwatt-hours + ZCL_POWER_MW_ATTRIBUTE_TYPE = 0xD9, // Power milliwatts + ZCL_AMPERAGE_MA_ATTRIBUTE_TYPE = 0xDA, // Amperage milliamps + ZCL_VOLTAGE_MV_ATTRIBUTE_TYPE = 0xDB, // Voltage millivolts + ZCL_ENERGY_MWH_ATTRIBUTE_TYPE = 0xDC, // Energy milliwatt-hours ZCL_TOD_ATTRIBUTE_TYPE = 0xE0, // Time of day ZCL_DATE_ATTRIBUTE_TYPE = 0xE1, // Date ZCL_EPOCH_US_ATTRIBUTE_TYPE = 0xE3, // Epoch Microseconds 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 329d3fe2711ade..728f9a5844b59c 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 @@ -10604,7 +10604,7 @@ EmberAfStatus Set(chip::EndpointId endpoint, int64_t value) Traits::StorageType storageValue; Traits::WorkingToStorage(value, storageValue); uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue); - return emberAfWriteAttribute(endpoint, Clusters::EnergyEvse::Id, Id, writable, ZCL_AMPERAGE_M_A_ATTRIBUTE_TYPE); + return emberAfWriteAttribute(endpoint, Clusters::EnergyEvse::Id, Id, writable, ZCL_AMPERAGE_MA_ATTRIBUTE_TYPE); } } // namespace CircuitCapacity @@ -10635,7 +10635,7 @@ EmberAfStatus Set(chip::EndpointId endpoint, int64_t value) Traits::StorageType storageValue; Traits::WorkingToStorage(value, storageValue); uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue); - return emberAfWriteAttribute(endpoint, Clusters::EnergyEvse::Id, Id, writable, ZCL_AMPERAGE_M_A_ATTRIBUTE_TYPE); + return emberAfWriteAttribute(endpoint, Clusters::EnergyEvse::Id, Id, writable, ZCL_AMPERAGE_MA_ATTRIBUTE_TYPE); } } // namespace MinimumChargeCurrent @@ -10666,7 +10666,7 @@ EmberAfStatus Set(chip::EndpointId endpoint, int64_t value) Traits::StorageType storageValue; Traits::WorkingToStorage(value, storageValue); uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue); - return emberAfWriteAttribute(endpoint, Clusters::EnergyEvse::Id, Id, writable, ZCL_AMPERAGE_M_A_ATTRIBUTE_TYPE); + return emberAfWriteAttribute(endpoint, Clusters::EnergyEvse::Id, Id, writable, ZCL_AMPERAGE_MA_ATTRIBUTE_TYPE); } } // namespace MaximumChargeCurrent @@ -10697,7 +10697,7 @@ EmberAfStatus Set(chip::EndpointId endpoint, int64_t value) Traits::StorageType storageValue; Traits::WorkingToStorage(value, storageValue); uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue); - return emberAfWriteAttribute(endpoint, Clusters::EnergyEvse::Id, Id, writable, ZCL_AMPERAGE_M_A_ATTRIBUTE_TYPE); + return emberAfWriteAttribute(endpoint, Clusters::EnergyEvse::Id, Id, writable, ZCL_AMPERAGE_MA_ATTRIBUTE_TYPE); } } // namespace MaximumDischargeCurrent @@ -10728,7 +10728,7 @@ EmberAfStatus Set(chip::EndpointId endpoint, int64_t value) Traits::StorageType storageValue; Traits::WorkingToStorage(value, storageValue); uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue); - return emberAfWriteAttribute(endpoint, Clusters::EnergyEvse::Id, Id, writable, ZCL_AMPERAGE_M_A_ATTRIBUTE_TYPE); + return emberAfWriteAttribute(endpoint, Clusters::EnergyEvse::Id, Id, writable, ZCL_AMPERAGE_MA_ATTRIBUTE_TYPE); } } // namespace UserMaximumChargeCurrent @@ -10961,7 +10961,7 @@ EmberAfStatus Set(chip::EndpointId endpoint, int64_t value) Traits::StorageType storageValue; Traits::WorkingToStorage(value, storageValue); uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue); - return emberAfWriteAttribute(endpoint, Clusters::EnergyEvse::Id, Id, writable, ZCL_ENERGY_M_WH_ATTRIBUTE_TYPE); + return emberAfWriteAttribute(endpoint, Clusters::EnergyEvse::Id, Id, writable, ZCL_ENERGY_MWH_ATTRIBUTE_TYPE); } EmberAfStatus SetNull(chip::EndpointId endpoint) @@ -10970,7 +10970,7 @@ EmberAfStatus SetNull(chip::EndpointId endpoint) Traits::StorageType value; Traits::SetNull(value); uint8_t * writable = Traits::ToAttributeStoreRepresentation(value); - return emberAfWriteAttribute(endpoint, Clusters::EnergyEvse::Id, Id, writable, ZCL_ENERGY_M_WH_ATTRIBUTE_TYPE); + return emberAfWriteAttribute(endpoint, Clusters::EnergyEvse::Id, Id, writable, ZCL_ENERGY_MWH_ATTRIBUTE_TYPE); } EmberAfStatus Set(chip::EndpointId endpoint, const chip::app::DataModel::Nullable & value) @@ -11173,7 +11173,7 @@ EmberAfStatus Set(chip::EndpointId endpoint, int64_t value) Traits::StorageType storageValue; Traits::WorkingToStorage(value, storageValue); uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue); - return emberAfWriteAttribute(endpoint, Clusters::EnergyEvse::Id, Id, writable, ZCL_ENERGY_M_WH_ATTRIBUTE_TYPE); + return emberAfWriteAttribute(endpoint, Clusters::EnergyEvse::Id, Id, writable, ZCL_ENERGY_MWH_ATTRIBUTE_TYPE); } EmberAfStatus SetNull(chip::EndpointId endpoint) @@ -11182,7 +11182,7 @@ EmberAfStatus SetNull(chip::EndpointId endpoint) Traits::StorageType value; Traits::SetNull(value); uint8_t * writable = Traits::ToAttributeStoreRepresentation(value); - return emberAfWriteAttribute(endpoint, Clusters::EnergyEvse::Id, Id, writable, ZCL_ENERGY_M_WH_ATTRIBUTE_TYPE); + return emberAfWriteAttribute(endpoint, Clusters::EnergyEvse::Id, Id, writable, ZCL_ENERGY_MWH_ATTRIBUTE_TYPE); } EmberAfStatus Set(chip::EndpointId endpoint, const chip::app::DataModel::Nullable & value) @@ -11356,7 +11356,7 @@ EmberAfStatus Set(chip::EndpointId endpoint, int64_t value) Traits::StorageType storageValue; Traits::WorkingToStorage(value, storageValue); uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue); - return emberAfWriteAttribute(endpoint, Clusters::EnergyEvse::Id, Id, writable, ZCL_ENERGY_M_WH_ATTRIBUTE_TYPE); + return emberAfWriteAttribute(endpoint, Clusters::EnergyEvse::Id, Id, writable, ZCL_ENERGY_MWH_ATTRIBUTE_TYPE); } } // namespace SessionEnergyCharged @@ -11387,7 +11387,7 @@ EmberAfStatus Set(chip::EndpointId endpoint, int64_t value) Traits::StorageType storageValue; Traits::WorkingToStorage(value, storageValue); uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue); - return emberAfWriteAttribute(endpoint, Clusters::EnergyEvse::Id, Id, writable, ZCL_ENERGY_M_WH_ATTRIBUTE_TYPE); + return emberAfWriteAttribute(endpoint, Clusters::EnergyEvse::Id, Id, writable, ZCL_ENERGY_MWH_ATTRIBUTE_TYPE); } } // namespace SessionEnergyDischarged 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 20da316a721554..68a10b448e4635 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 @@ -2038,27 +2038,27 @@ EmberAfStatus Set(chip::EndpointId endpoint, const chip::app::DataModel::Nullabl } // namespace DischargingEnabledUntil namespace CircuitCapacity { -EmberAfStatus Get(chip::EndpointId endpoint, int64_t * value); // amperage_mA +EmberAfStatus Get(chip::EndpointId endpoint, int64_t * value); // amperage_ma EmberAfStatus Set(chip::EndpointId endpoint, int64_t value); } // namespace CircuitCapacity namespace MinimumChargeCurrent { -EmberAfStatus Get(chip::EndpointId endpoint, int64_t * value); // amperage_mA +EmberAfStatus Get(chip::EndpointId endpoint, int64_t * value); // amperage_ma EmberAfStatus Set(chip::EndpointId endpoint, int64_t value); } // namespace MinimumChargeCurrent namespace MaximumChargeCurrent { -EmberAfStatus Get(chip::EndpointId endpoint, int64_t * value); // amperage_mA +EmberAfStatus Get(chip::EndpointId endpoint, int64_t * value); // amperage_ma EmberAfStatus Set(chip::EndpointId endpoint, int64_t value); } // namespace MaximumChargeCurrent namespace MaximumDischargeCurrent { -EmberAfStatus Get(chip::EndpointId endpoint, int64_t * value); // amperage_mA +EmberAfStatus Get(chip::EndpointId endpoint, int64_t * value); // amperage_ma EmberAfStatus Set(chip::EndpointId endpoint, int64_t value); } // namespace MaximumDischargeCurrent namespace UserMaximumChargeCurrent { -EmberAfStatus Get(chip::EndpointId endpoint, int64_t * value); // amperage_mA +EmberAfStatus Get(chip::EndpointId endpoint, int64_t * value); // amperage_ma EmberAfStatus Set(chip::EndpointId endpoint, int64_t value); } // namespace UserMaximumChargeCurrent @@ -2092,7 +2092,7 @@ EmberAfStatus Set(chip::EndpointId endpoint, const chip::app::DataModel::Nullabl } // namespace NextChargeTargetTime namespace NextChargeRequiredEnergy { -EmberAfStatus Get(chip::EndpointId endpoint, DataModel::Nullable & value); // energy_mWh +EmberAfStatus Get(chip::EndpointId endpoint, DataModel::Nullable & value); // energy_mwh EmberAfStatus Set(chip::EndpointId endpoint, int64_t value); EmberAfStatus SetNull(chip::EndpointId endpoint); EmberAfStatus Set(chip::EndpointId endpoint, const chip::app::DataModel::Nullable & value); @@ -2120,7 +2120,7 @@ EmberAfStatus Set(chip::EndpointId endpoint, const chip::app::DataModel::Nullabl } // namespace StateOfCharge namespace BatteryCapacity { -EmberAfStatus Get(chip::EndpointId endpoint, DataModel::Nullable & value); // energy_mWh +EmberAfStatus Get(chip::EndpointId endpoint, DataModel::Nullable & value); // energy_mwh EmberAfStatus Set(chip::EndpointId endpoint, int64_t value); EmberAfStatus SetNull(chip::EndpointId endpoint); EmberAfStatus Set(chip::EndpointId endpoint, const chip::app::DataModel::Nullable & value); @@ -2146,12 +2146,12 @@ EmberAfStatus Set(chip::EndpointId endpoint, uint32_t value); } // namespace SessionDuration namespace SessionEnergyCharged { -EmberAfStatus Get(chip::EndpointId endpoint, int64_t * value); // energy_mWh +EmberAfStatus Get(chip::EndpointId endpoint, int64_t * value); // energy_mwh EmberAfStatus Set(chip::EndpointId endpoint, int64_t value); } // namespace SessionEnergyCharged namespace SessionEnergyDischarged { -EmberAfStatus Get(chip::EndpointId endpoint, int64_t * value); // energy_mWh +EmberAfStatus Get(chip::EndpointId endpoint, int64_t * value); // energy_mwh EmberAfStatus Set(chip::EndpointId endpoint, int64_t value); } // namespace SessionEnergyDischarged diff --git a/zzz_generated/chip-tool/zap-generated/cluster/Commands.h b/zzz_generated/chip-tool/zap-generated/cluster/Commands.h index 610e325a4e7dfa..7a93b0275e3029 100644 --- a/zzz_generated/chip-tool/zap-generated/cluster/Commands.h +++ b/zzz_generated/chip-tool/zap-generated/cluster/Commands.h @@ -6903,8 +6903,8 @@ class EnergyEvseEnableCharging : public ClusterCommand 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); + AddArgument("MinimumChargeCurrent", 0, UINT64_MAX, &mRequest.minimumChargeCurrent); + AddArgument("MaximumChargeCurrent", 0, UINT64_MAX, &mRequest.maximumChargeCurrent); ClusterCommand::AddArguments(); } @@ -6943,7 +6943,7 @@ class EnergyEvseEnableDischarging : public ClusterCommand ClusterCommand("enable-discharging", credsIssuerConfig) { AddArgument("DischargingEnabledUntil", 0, UINT32_MAX, &mRequest.dischargingEnabledUntil); - AddArgument("MaximumDischargeCurrent", INT64_MIN, INT64_MAX, &mRequest.maximumDischargeCurrent); + AddArgument("MaximumDischargeCurrent", 0, UINT64_MAX, &mRequest.maximumDischargeCurrent); ClusterCommand::AddArguments(); } @@ -18446,18 +18446,16 @@ void registerClusterEnergyEvse(Commands & commands, CredentialIssuerCommands * c make_unique>>(Id, "discharging-enabled-until", 0, UINT32_MAX, Attributes::DischargingEnabledUntil::Id, WriteCommandType::kForceWrite, credsIssuerConfig), // - make_unique>(Id, "circuit-capacity", INT64_MIN, INT64_MAX, Attributes::CircuitCapacity::Id, + make_unique>(Id, "circuit-capacity", 0, UINT64_MAX, Attributes::CircuitCapacity::Id, WriteCommandType::kForceWrite, credsIssuerConfig), // - make_unique>(Id, "minimum-charge-current", INT64_MIN, INT64_MAX, - Attributes::MinimumChargeCurrent::Id, WriteCommandType::kForceWrite, - credsIssuerConfig), // - make_unique>(Id, "maximum-charge-current", INT64_MIN, INT64_MAX, - Attributes::MaximumChargeCurrent::Id, WriteCommandType::kForceWrite, - credsIssuerConfig), // - make_unique>(Id, "maximum-discharge-current", INT64_MIN, INT64_MAX, + make_unique>(Id, "minimum-charge-current", 0, UINT64_MAX, Attributes::MinimumChargeCurrent::Id, + WriteCommandType::kForceWrite, credsIssuerConfig), // + make_unique>(Id, "maximum-charge-current", 0, UINT64_MAX, Attributes::MaximumChargeCurrent::Id, + WriteCommandType::kForceWrite, credsIssuerConfig), // + make_unique>(Id, "maximum-discharge-current", 0, UINT64_MAX, Attributes::MaximumDischargeCurrent::Id, WriteCommandType::kForceWrite, credsIssuerConfig), // - make_unique>(Id, "user-maximum-charge-current", INT64_MIN, INT64_MAX, + make_unique>(Id, "user-maximum-charge-current", 0, UINT64_MAX, Attributes::UserMaximumChargeCurrent::Id, WriteCommandType::kWrite, credsIssuerConfig), // make_unique>(Id, "randomization-delay-window", 0, UINT32_MAX, @@ -18473,8 +18471,8 @@ void registerClusterEnergyEvse(Commands & commands, CredentialIssuerCommands * c make_unique>>(Id, "next-charge-target-time", 0, UINT32_MAX, Attributes::NextChargeTargetTime::Id, WriteCommandType::kForceWrite, credsIssuerConfig), // - make_unique>>(Id, "next-charge-required-energy", INT64_MIN, - INT64_MAX, Attributes::NextChargeRequiredEnergy::Id, + make_unique>>(Id, "next-charge-required-energy", 0, UINT64_MAX, + Attributes::NextChargeRequiredEnergy::Id, WriteCommandType::kForceWrite, credsIssuerConfig), // make_unique>>( Id, "next-charge-target-so-c", 0, UINT8_MAX, Attributes::NextChargeTargetSoC::Id, WriteCommandType::kForceWrite, @@ -18485,7 +18483,7 @@ void registerClusterEnergyEvse(Commands & commands, CredentialIssuerCommands * c make_unique>>( Id, "state-of-charge", 0, UINT8_MAX, Attributes::StateOfCharge::Id, WriteCommandType::kForceWrite, credsIssuerConfig), // - make_unique>>(Id, "battery-capacity", INT64_MIN, INT64_MAX, + make_unique>>(Id, "battery-capacity", 0, UINT64_MAX, Attributes::BatteryCapacity::Id, WriteCommandType::kForceWrite, credsIssuerConfig), // make_unique>>( @@ -18494,10 +18492,9 @@ void registerClusterEnergyEvse(Commands & commands, CredentialIssuerCommands * c Id, "session-id", 0, UINT32_MAX, Attributes::SessionID::Id, WriteCommandType::kForceWrite, credsIssuerConfig), // make_unique>(Id, "session-duration", 0, UINT32_MAX, Attributes::SessionDuration::Id, WriteCommandType::kForceWrite, credsIssuerConfig), // - make_unique>(Id, "session-energy-charged", INT64_MIN, INT64_MAX, - Attributes::SessionEnergyCharged::Id, WriteCommandType::kForceWrite, - credsIssuerConfig), // - make_unique>(Id, "session-energy-discharged", INT64_MIN, INT64_MAX, + make_unique>(Id, "session-energy-charged", 0, UINT64_MAX, Attributes::SessionEnergyCharged::Id, + WriteCommandType::kForceWrite, credsIssuerConfig), // + make_unique>(Id, "session-energy-discharged", 0, UINT64_MAX, Attributes::SessionEnergyDischarged::Id, WriteCommandType::kForceWrite, credsIssuerConfig), // make_unique>>( 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 4358b5753c47c4..393fdbb30bba9c 100644 --- a/zzz_generated/darwin-framework-tool/zap-generated/cluster/Commands.h +++ b/zzz_generated/darwin-framework-tool/zap-generated/cluster/Commands.h @@ -77912,10 +77912,10 @@ class EnergyEvseEnableCharging : public ClusterCommand { AddArgument("ChargingEnabledUntil", 0, UINT32_MAX, &mRequest.chargingEnabledUntil); #endif // MTR_ENABLE_PROVISIONAL #if MTR_ENABLE_PROVISIONAL - AddArgument("MinimumChargeCurrent", INT64_MIN, INT64_MAX, &mRequest.minimumChargeCurrent); + AddArgument("MinimumChargeCurrent", 0, UINT64_MAX, &mRequest.minimumChargeCurrent); #endif // MTR_ENABLE_PROVISIONAL #if MTR_ENABLE_PROVISIONAL - AddArgument("MaximumChargeCurrent", INT64_MIN, INT64_MAX, &mRequest.maximumChargeCurrent); + AddArgument("MaximumChargeCurrent", 0, UINT64_MAX, &mRequest.maximumChargeCurrent); #endif // MTR_ENABLE_PROVISIONAL ClusterCommand::AddArguments(); } @@ -77981,7 +77981,7 @@ class EnergyEvseEnableDischarging : public ClusterCommand { AddArgument("DischargingEnabledUntil", 0, UINT32_MAX, &mRequest.dischargingEnabledUntil); #endif // MTR_ENABLE_PROVISIONAL #if MTR_ENABLE_PROVISIONAL - AddArgument("MaximumDischargeCurrent", INT64_MIN, INT64_MAX, &mRequest.maximumDischargeCurrent); + AddArgument("MaximumDischargeCurrent", 0, UINT64_MAX, &mRequest.maximumDischargeCurrent); #endif // MTR_ENABLE_PROVISIONAL ClusterCommand::AddArguments(); } @@ -79073,7 +79073,7 @@ class WriteEnergyEvseUserMaximumChargeCurrent : public WriteAttribute { : WriteAttribute("user-maximum-charge-current") { AddArgument("attr-name", "user-maximum-charge-current"); - AddArgument("attr-value", INT64_MIN, INT64_MAX, &mValue); + AddArgument("attr-value", 0, UINT64_MAX, &mValue); WriteAttribute::AddArguments(); } From 41acd01710b55e8c9091376010a058813c6db848 Mon Sep 17 00:00:00 2001 From: James Harrow Date: Wed, 29 Nov 2023 23:03:59 +0000 Subject: [PATCH 005/114] Fixed lint issue (trailing whitespace). --- scripts/py_matter_idl/matter_idl/generators/type_definitions.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scripts/py_matter_idl/matter_idl/generators/type_definitions.py b/scripts/py_matter_idl/matter_idl/generators/type_definitions.py index 6caf3a4dbd125c..9bfe20f455c110 100644 --- a/scripts/py_matter_idl/matter_idl/generators/type_definitions.py +++ b/scripts/py_matter_idl/matter_idl/generators/type_definitions.py @@ -199,7 +199,7 @@ def is_struct(self) -> bool: "devtype_id": BasicInteger(idl_name="devtype_id", byte_count=4, is_signed=False), "elapsed_s": BasicInteger(idl_name="elapsed_s", byte_count=4, is_signed=False), "endpoint_no": BasicInteger(idl_name="endpoint_no", byte_count=2, is_signed=False), - "energy_mwh": BasicInteger(idl_name="energy_mwh", byte_count=8, is_signed=True), + "energy_mwh": BasicInteger(idl_name="energy_mwh", byte_count=8, is_signed=True), "entry_idx": BasicInteger(idl_name="entry_idx", byte_count=2, is_signed=False), "epoch_s": BasicInteger(idl_name="epoch_s", byte_count=4, is_signed=False), "epoch_us": BasicInteger(idl_name="epoch_us", byte_count=8, is_signed=False), From c96493f35da6a72ea785d2d495b4abed13717e1b Mon Sep 17 00:00:00 2001 From: James Harrow Date: Tue, 12 Dec 2023 15:27:03 +0000 Subject: [PATCH 006/114] Added Device Energy Management server.cpp, added to all-clusters-app.zap and regen_all --- .../all-clusters-app.matter | 195 ++++++++ .../all-clusters-common/all-clusters-app.zap | 277 +++++++++-- .../device-energy-management-server.cpp | 442 ++++++++++++++++++ .../device-energy-management-server.h | 197 ++++++++ 4 files changed, 1076 insertions(+), 35 deletions(-) create mode 100644 src/app/clusters/device-energy-management-server/device-energy-management-server.cpp create mode 100644 src/app/clusters/device-energy-management-server/device-energy-management-server.h diff --git a/examples/all-clusters-app/all-clusters-common/all-clusters-app.matter b/examples/all-clusters-app/all-clusters-common/all-clusters-app.matter index d6345f8867dddd..6b59b539103490 100644 --- a/examples/all-clusters-app/all-clusters-common/all-clusters-app.matter +++ b/examples/all-clusters-app/all-clusters-common/all-clusters-app.matter @@ -3717,6 +3717,185 @@ provisional cluster ElectricalEnergyMeasurement = 145 { readonly attribute int16u clusterRevision = 65533; } +/** This cluster allows a client to manage the power draw of a device. An example of such a client could be an Energy Management System (EMS) which controls an Energy Smart Appliance (ESA). */ +provisional cluster DeviceEnergyManagement = 152 { + revision 1; // NOTE: Default/not specifically set + + enum CauseEnum : enum8 { + kNormalCompletion = 0; + kOffline = 1; + kFault = 2; + kUserOptOut = 3; + } + + enum CostTypeEnum : enum8 { + kFinancial = 0; + kGHGEmissions = 1; + kComfort = 2; + kTemperature = 3; + } + + enum ESAStateEnum : enum8 { + kOffline = 0; + kOnline = 1; + kFault = 2; + kUserOptOut = 3; + kPowerAdjustActive = 4; + kPaused = 5; + } + + enum ESATypeEnum : enum8 { + kEVSE = 0; + kSpaceHeating = 1; + kWaterHeating = 2; + kSpaceCooling = 3; + kSpaceHeatingCooling = 4; + kBatteryStorage = 5; + kSolarPV = 6; + kFridgeFreezer = 7; + kWashingMachine = 8; + kDishwasher = 9; + kCooking = 10; + kHomeWaterPump = 11; + kIrrigationWaterPump = 12; + kPoolPump = 13; + kOther = 255; + } + + bitmap Feature : bitmap32 { + kPowerAdjustment = 0x1; + kPowerForecastReporting = 0x2; + kStateForecastReporting = 0x4; + kForecastAdjustment = 0x8; + } + + struct CostStruct { + CostTypeEnum costType = 0; + int32s value = 1; + int8u decimalPoints = 2; + optional int16u currency = 3; + } + + struct SlotStruct { + elapsed_s minDuration = 0; + elapsed_s maxDuration = 1; + elapsed_s defaultDuration = 2; + elapsed_s elapsedSlotTime = 3; + elapsed_s remainingSlotTime = 4; + boolean slotIsPauseable = 5; + elapsed_s minPauseDuration = 6; + elapsed_s maxPauseDuration = 7; + optional int16u manufacturerESAState = 8; + optional int64s nominalPower = 9; + optional int64s minPower = 10; + optional int64s maxPower = 11; + optional int64s nominalEnergy = 12; + optional CostStruct costs[] = 13; + optional int64s minPowerAdjustment = 14; + optional int64s maxPowerAdjustment = 15; + optional elapsed_s minDurationAdjustment = 16; + optional elapsed_s maxDurationAdjustment = 17; + } + + struct ForecastStruct { + int16u forecastId = 0; + nullable int16u activeSlotNumber = 1; + epoch_s startTime = 2; + epoch_s endTime = 3; + optional nullable epoch_s earliestStartTime = 4; + optional epoch_s latestEndTime = 5; + boolean isPauseable = 6; + SlotStruct slots[] = 7; + } + + struct ConstraintsStruct { + epoch_s startTime = 0; + elapsed_s duration = 1; + optional int64s nominalPower = 2; + optional int64s maximumEnergy = 3; + optional int8s loadControl = 4; + } + + struct PowerAdjustStruct { + int64s minPower = 0; + int64s maxPower = 1; + elapsed_s minDuration = 2; + elapsed_s maxDuration = 3; + } + + struct SlotAdjustmentStruct { + int8u slotIndex = 0; + int64s nominalPower = 1; + elapsed_s duration = 2; + } + + info event PowerAdjustStart = 0 { + } + + info event PowerAdjustEnd = 1 { + CauseEnum cause = 0; + elapsed_s duration = 1; + int64s energyUse = 2; + } + + info event Paused = 2 { + } + + info event Resumed = 3 { + } + + readonly attribute ESATypeEnum ESAType = 0; + readonly attribute boolean ESACanGenerate = 1; + readonly attribute ESAStateEnum ESAState = 2; + readonly attribute int64s absMinPower = 3; + readonly attribute int64s absMaxPower = 4; + readonly attribute optional nullable PowerAdjustStruct powerAdjustmentCapability[] = 5; + readonly attribute optional nullable ForecastStruct forecast = 6; + readonly attribute command_id generatedCommandList[] = 65528; + readonly attribute command_id acceptedCommandList[] = 65529; + readonly attribute event_id eventList[] = 65530; + readonly attribute attrib_id attributeList[] = 65531; + readonly attribute bitmap32 featureMap = 65532; + readonly attribute int16u clusterRevision = 65533; + + request struct PowerAdjustRequestRequest { + int64s power = 0; + elapsed_s duration = 1; + } + + request struct StartTimeAdjustRequestRequest { + epoch_s requestedStartTime = 0; + } + + request struct PauseRequestRequest { + elapsed_s duration = 0; + } + + request struct ModifyForecastRequestRequest { + int32u forecastId = 0; + SlotAdjustmentStruct slotAdjustments[] = 1; + } + + request struct RequestConstraintBasedForecastRequest { + ConstraintsStruct constraints[] = 0; + } + + /** Allows a client to request an adjustment in the power consumption of an ESA for a specified duration. */ + command PowerAdjustRequest(PowerAdjustRequestRequest): DefaultSuccess = 0; + /** Allows a client to cancel an ongoing PowerAdjustmentRequest operation. */ + command CancelPowerAdjustRequest(): DefaultSuccess = 1; + /** Allows a client to adjust the start time of a Forecast sequence that has not yet started operation (i.e. where the current Forecast StartTime is in the future). */ + command StartTimeAdjustRequest(StartTimeAdjustRequestRequest): DefaultSuccess = 2; + /** Allows a client to temporarily pause an operation and reduce the ESAs energy demand. */ + command PauseRequest(PauseRequestRequest): DefaultSuccess = 3; + /** Allows a client to cancel the PauseRequest command and enable earlier resumption of operation. */ + command ResumeRequest(): DefaultSuccess = 4; + /** Allows a client to modify a Forecast within the limits allowed by the ESA. */ + command ModifyForecastRequest(ModifyForecastRequestRequest): DefaultSuccess = 5; + /** Allows a client to ask the ESA to recompute its Forecast based on power and time constraints. */ + command RequestConstraintBasedForecast(RequestConstraintBasedForecastRequest): DefaultSuccess = 6; +} + /** Provides an interface for controlling and adjusting automatic window coverings. */ cluster WindowCovering = 258 { revision 5; @@ -7141,6 +7320,22 @@ endpoint 1 { ram attribute clusterRevision default = 1; } + server cluster DeviceEnergyManagement { + callback attribute ESAType default = 0; + callback attribute ESACanGenerate default = 0; + callback attribute ESAState default = 0; + callback attribute absMinPower default = 0; + callback attribute absMaxPower default = 0; + callback attribute powerAdjustmentCapability; + callback attribute forecast; + callback attribute generatedCommandList; + callback attribute acceptedCommandList; + callback attribute eventList; + callback attribute attributeList; + ram attribute featureMap default = 0; + ram attribute clusterRevision default = 2; + } + server cluster WindowCovering { ram attribute type default = 0x08; ram attribute physicalClosedLimitLift default = 0xFFFF; diff --git a/examples/all-clusters-app/all-clusters-common/all-clusters-app.zap b/examples/all-clusters-app/all-clusters-common/all-clusters-app.zap index 2a331d5674f0e4..aa1ae2ffb08f06 100644 --- a/examples/all-clusters-app/all-clusters-common/all-clusters-app.zap +++ b/examples/all-clusters-app/all-clusters-common/all-clusters-app.zap @@ -17,12 +17,6 @@ } ], "package": [ - { - "pathRelativity": "relativeToZap", - "path": "../../../src/app/zap-templates/app-templates.json", - "type": "gen-templates-json", - "version": "chip-v1" - }, { "pathRelativity": "relativeToZap", "path": "../../../src/app/zap-templates/zcl/zcl-with-test-extensions.json", @@ -30,6 +24,12 @@ "category": "matter", "version": 1, "description": "Matter SDK ZCL data with some extensions" + }, + { + "pathRelativity": "relativeToZap", + "path": "../../../src/app/zap-templates/app-templates.json", + "type": "gen-templates-json", + "version": "chip-v1" } ], "endpointTypes": [ @@ -7099,6 +7099,7 @@ "define": "ON_OFF_SWITCH_CONFIGURATION_CLUSTER", "side": "server", "enabled": 1, + "apiMaturity": "deprecated", "attributes": [ { "name": "switch type", @@ -7505,6 +7506,7 @@ "define": "BINARY_INPUT_BASIC_CLUSTER", "side": "server", "enabled": 1, + "apiMaturity": "deprecated", "attributes": [ { "name": "out of service", @@ -11533,25 +11535,9 @@ "enabled": 1, "apiMaturity": "provisional", "attributes": [ - { - "name": "Measured", - "code": 0, - "mfgCode": null, - "side": "server", - "type": "boolean", - "included": 1, - "storageOption": "RAM", - "singleton": 0, - "bounded": 0, - "defaultValue": "false", - "reportable": 1, - "minInterval": 1, - "maxInterval": 65534, - "reportableChange": 0 - }, { "name": "Accuracy", - "code": 1, + "code": 0, "mfgCode": null, "side": "server", "type": "MeasurementAccuracyStruct", @@ -11567,7 +11553,7 @@ }, { "name": "CumulativeEnergyImported", - "code": 2, + "code": 1, "mfgCode": null, "side": "server", "type": "EnergyMeasurementStruct", @@ -11583,7 +11569,7 @@ }, { "name": "CumulativeEnergyExported", - "code": 3, + "code": 2, "mfgCode": null, "side": "server", "type": "EnergyMeasurementStruct", @@ -11599,7 +11585,7 @@ }, { "name": "PeriodicEnergyImported", - "code": 4, + "code": 3, "mfgCode": null, "side": "server", "type": "EnergyMeasurementStruct", @@ -11615,7 +11601,7 @@ }, { "name": "PeriodicEnergyExported", - "code": 5, + "code": 4, "mfgCode": null, "side": "server", "type": "EnergyMeasurementStruct", @@ -11743,6 +11729,225 @@ } ] }, + { + "name": "Device Energy Management", + "code": 152, + "mfgCode": null, + "define": "DEVICE_ENERGY_MANAGEMENT_CLUSTER", + "side": "server", + "enabled": 1, + "apiMaturity": "provisional", + "attributes": [ + { + "name": "ESAType", + "code": 0, + "mfgCode": null, + "side": "server", + "type": "ESATypeEnum", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": "0", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "ESACanGenerate", + "code": 1, + "mfgCode": null, + "side": "server", + "type": "boolean", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": "0", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "ESAState", + "code": 2, + "mfgCode": null, + "side": "server", + "type": "ESAStateEnum", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": "0", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "AbsMinPower", + "code": 3, + "mfgCode": null, + "side": "server", + "type": "int64s", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": "0", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "AbsMaxPower", + "code": 4, + "mfgCode": null, + "side": "server", + "type": "int64s", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": "0", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "PowerAdjustmentCapability", + "code": 5, + "mfgCode": null, + "side": "server", + "type": "array", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": "", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "Forecast", + "code": 6, + "mfgCode": null, + "side": "server", + "type": "ForecastStruct", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": "", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "GeneratedCommandList", + "code": 65528, + "mfgCode": null, + "side": "server", + "type": "array", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": "", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "AcceptedCommandList", + "code": 65529, + "mfgCode": null, + "side": "server", + "type": "array", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": "", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "EventList", + "code": 65530, + "mfgCode": null, + "side": "server", + "type": "array", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": "", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "AttributeList", + "code": 65531, + "mfgCode": null, + "side": "server", + "type": "array", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": "", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "FeatureMap", + "code": 65532, + "mfgCode": null, + "side": "server", + "type": "bitmap32", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "0", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "ClusterRevision", + "code": 65533, + "mfgCode": null, + "side": "server", + "type": "int16u", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "2", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + } + ] + }, { "name": "Window Covering", "code": 258, @@ -12250,6 +12455,7 @@ "define": "BARRIER_CONTROL_CLUSTER", "side": "server", "enabled": 1, + "apiMaturity": "deprecated", "commands": [ { "name": "BarrierControlGoToPercent", @@ -12880,7 +13086,7 @@ "code": 17, "mfgCode": null, "side": "server", - "type": "temperature", + "type": "int16s", "included": 1, "storageOption": "RAM", "singleton": 0, @@ -12896,7 +13102,7 @@ "code": 18, "mfgCode": null, "side": "server", - "type": "temperature", + "type": "int16s", "included": 1, "storageOption": "RAM", "singleton": 0, @@ -12912,7 +13118,7 @@ "code": 21, "mfgCode": null, "side": "server", - "type": "temperature", + "type": "int16s", "included": 1, "storageOption": "RAM", "singleton": 0, @@ -12928,7 +13134,7 @@ "code": 22, "mfgCode": null, "side": "server", - "type": "temperature", + "type": "int16s", "included": 1, "storageOption": "RAM", "singleton": 0, @@ -12944,7 +13150,7 @@ "code": 23, "mfgCode": null, "side": "server", - "type": "temperature", + "type": "int16s", "included": 1, "storageOption": "RAM", "singleton": 0, @@ -12960,7 +13166,7 @@ "code": 24, "mfgCode": null, "side": "server", - "type": "temperature", + "type": "int16s", "included": 1, "storageOption": "RAM", "singleton": 0, @@ -13061,7 +13267,7 @@ "storageOption": "External", "singleton": 0, "bounded": 0, - "defaultValue": "", + "defaultValue": null, "reportable": 1, "minInterval": 1, "maxInterval": 65534, @@ -18192,6 +18398,7 @@ "define": "ELECTRICAL_MEASUREMENT_CLUSTER", "side": "server", "enabled": 1, + "apiMaturity": "deprecated", "attributes": [ { "name": "measurement type", @@ -21961,4 +22168,4 @@ } ], "log": [] -} +} \ No newline at end of file diff --git a/src/app/clusters/device-energy-management-server/device-energy-management-server.cpp b/src/app/clusters/device-energy-management-server/device-energy-management-server.cpp new file mode 100644 index 00000000000000..200337e744ac9a --- /dev/null +++ b/src/app/clusters/device-energy-management-server/device-energy-management-server.cpp @@ -0,0 +1,442 @@ +/* + * 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. + */ + +#include "device-energy-management-server.h" + +#include +#include +#include +#include + + +using namespace chip; +using namespace chip::app; +using namespace chip::app::Clusters; +using namespace chip::app::Clusters::DeviceEnergyManagement; +using namespace chip::app::Clusters::DeviceEnergyManagement::Attributes; + +using chip::Protocols::InteractionModel::Status; + + +namespace chip { +namespace app { +namespace Clusters { +namespace DeviceEnergyManagement { + +Instance::Instance(EndpointId aEndpointId, Delegate & aDelegate) : + AttributeAccessInterface(MakeOptional(aEndpointId), Id), CommandHandlerInterface(MakeOptional(aEndpointId), Id), + mDelegate(aDelegate), mEndpointId(aEndpointId) +{ + /* set the base class delegates endpointId */ + mDelegate.SetEndpointId(aEndpointId); +} + +Instance::~Instance() +{ + Shutdown(); +} + +CHIP_ERROR Instance::Init() +{ + registerAttributeAccessOverride(this); + InteractionModelEngine::GetInstance()->RegisterCommandHandler(this); + return CHIP_NO_ERROR; +} + +void Instance::Shutdown() +{ + unregisterAttributeAccessOverride(this); + InteractionModelEngine::GetInstance()->UnregisterCommandHandler(this); +} + +bool Instance::HasFeature(Feature aFeature) const +{ + return mFeature.Has(aFeature); +} + + +// AttributeAccessInterface +CHIP_ERROR Instance::Read(const ConcreteReadAttributePath & aPath, AttributeValueEncoder & aEncoder) +{ + switch (aPath.mAttributeId) + { + case ESAType::Id: + return aEncoder.Encode(mDelegate.GetESAType()); + case ESACanGenerate::Id: + return aEncoder.Encode(mDelegate.GetESACanGenerate()); + case ESAState::Id: + return aEncoder.Encode(mDelegate.GetESAState()); + case AbsMinPower::Id: + return aEncoder.Encode(mDelegate.GetAbsMinPower()); + case AbsMaxPower::Id: + return aEncoder.Encode(mDelegate.GetAbsMaxPower()); + case PowerAdjustmentCapability::Id: + return aEncoder.Encode(mDelegate.GetPowerAdjustmentCapability()); + case Forecast::Id: + return aEncoder.Encode(mDelegate.GetForecast()); + } + + /* Allow all other unhandled attributes to fall through to Ember */ + return CHIP_NO_ERROR; +} + +CHIP_ERROR Instance::Write(const ConcreteDataAttributePath & aPath, AttributeValueDecoder & aDecoder) +{ + return CHIP_ERROR_NOT_IMPLEMENTED; // Nothing writable in this cluster ! +} + +// CommandHandlerInterface +CHIP_ERROR Instance::EnumerateAcceptedCommands(const ConcreteClusterPath & cluster, CommandIdCallback callback, void * context) +{ + using namespace Commands; + + for (auto && id : { + PowerAdjustRequest::Id, + CancelPowerAdjustRequest::Id, + StartTimeAdjustRequest::Id, + PauseRequest::Id, + ResumeRequest::Id, + ModifyForecastRequest::Id, + RequestConstraintBasedForecast::Id, + }) + { + if (callback(id, context) == Loop::Break) + { + return CHIP_NO_ERROR; + } + } + + return CHIP_NO_ERROR; +} + +void Instance::InvokeCommand(HandlerContext & handlerContext) +{ + using namespace Commands; + + switch (handlerContext.mRequestPath.mCommandId) + { + case PowerAdjustRequest::Id: + HandleCommand( + handlerContext, [this](HandlerContext & ctx, const auto & commandData) { HandlePowerAdjustRequest(ctx, commandData); }); + return; + case CancelPowerAdjustRequest::Id: + HandleCommand( + handlerContext, [this](HandlerContext & ctx, const auto & commandData) { HandleCancelPowerAdjustRequest(ctx, commandData); }); + return; + case StartTimeAdjustRequest::Id: + HandleCommand( + handlerContext, [this](HandlerContext & ctx, const auto & commandData) { HandleStartTimeAdjustRequest(ctx, commandData); }); + return; + case PauseRequest::Id: + HandleCommand( + handlerContext, [this](HandlerContext & ctx, const auto & commandData) { HandlePauseRequest(ctx, commandData); }); + return; + case ResumeRequest::Id: + HandleCommand( + handlerContext, [this](HandlerContext & ctx, const auto & commandData) { HandleResumeRequest(ctx, commandData); }); + return; + case ModifyForecastRequest::Id: + HandleCommand( + handlerContext, [this](HandlerContext & ctx, const auto & commandData) { HandleModifyForecastRequest(ctx, commandData); }); + return; + case RequestConstraintBasedForecast::Id: + HandleCommand( + handlerContext, [this](HandlerContext & ctx, const auto & commandData) { HandleRequestConstraintBasedForecast(ctx, commandData); }); + return; + } +} + +void Instance::HandlePowerAdjustRequest(HandlerContext & ctx, const Commands::PowerAdjustRequest::DecodableType & commandData) +{ + int64_t power = commandData.power; + uint32_t durationSec = commandData.duration; + bool validArgs = false; + Status status = Status::Success; + + auto powerAdjustmentCapability = mDelegate.GetPowerAdjustmentCapability(); + + if (powerAdjustmentCapability.IsNull()) + { + ChipLogProgress(Zcl, "zzzzzzzzzzDEM: %s powerAdjustmentCapability IsNull", __FUNCTION__); + ctx.mCommandHandler.AddStatus(ctx.mRequestPath, Status::ConstraintError); + return; + } + + for (auto pas : powerAdjustmentCapability.Value()) + { + if ( (power >= pas.minPower) && (durationSec >= pas.minDuration) + && (power <= pas.maxPower) && (durationSec <= pas.maxDuration)) + { + ChipLogProgress(Zcl, "zzzzzzzzzzDEM: %s Good PowerAdjustment args", __FUNCTION__); + validArgs = true; + break; + } + } + + if (!validArgs) + { + ChipLogProgress(Zcl, "zzzzzzzzzzDEM: %s invalid request range", __FUNCTION__); + // TODO: raise event ? + ctx.mCommandHandler.AddStatus(ctx.mRequestPath, Status::ConstraintError); + return; + } + + ChipLogProgress(Zcl, "zzzzzzzzzzDEM: %s Good PowerAdjustRequest() args.", __FUNCTION__); + + // TODO: Generate a PowerAdjustStart Event, then begins to adjust its power. How is this done, Async? + // When done, raise PowerAdjustEnd & ESAState set to kOnline. + status = mDelegate.PowerAdjustRequest(power, durationSec); + ctx.mCommandHandler.AddStatus(ctx.mRequestPath, status); + if (status != Status::Success) + { + ChipLogProgress(Zcl, "zzzzzzzzzzDEM: %s Failed to PowerAdjustRequest() args.", __FUNCTION__); + } + + ChipLogProgress(Zcl, "zzzzzzzzzzDEM: %s Partly implemented", __FUNCTION__); + return; +} + + +void Instance::HandleCancelPowerAdjustRequest(HandlerContext & ctx, const Commands::CancelPowerAdjustRequest::DecodableType & commandData) +{ + Status status = Status::Success; + ESAStateEnum esaStatus; + + esaStatus = mDelegate.GetESAState(); + + if (ESAStateEnum::kPowerAdjustActive != esaStatus) + { + ChipLogProgress(Zcl, "zzzzzzzzzzDEM: %s - kPowerAdjustActive != esaStatus", __FUNCTION__); + ctx.mCommandHandler.AddStatus(ctx.mRequestPath, Status::Failure); + return; + } + + /* TODO: If the command is accepted, the ESA SHALL generate an PowerAdjustEnd Event. */ + + ChipLogProgress(Zcl, "zzzzzzzzzzDEM: %s Good CancelPowerAdjustRequest() args.", __FUNCTION__); + status = mDelegate.CancelPowerAdjustRequest(); + ctx.mCommandHandler.AddStatus(ctx.mRequestPath, status); + if (status != Status::Success) + { + ChipLogProgress(Zcl, "zzzzzzzzzzDEM: %s Failed to PowerAdjustRequest() args.", __FUNCTION__); + return; + } + + ctx.mCommandHandler.AddStatus(ctx.mRequestPath, status); + ChipLogProgress(Zcl, "zzzzzzzzzzDEM: %s partly implemented", __FUNCTION__); + return; +} + +void Instance::HandleStartTimeAdjustRequest(HandlerContext & ctx, const Commands::StartTimeAdjustRequest::DecodableType & commandData) +{ + Status status = Status::Success; + uint32_t earliestStartTime = 0; + uint32_t latestEndTime = 0; + Structs::ForecastStruct::Type forecast = mDelegate.GetForecast(); + uint32_t duration = forecast.endTime - forecast.startTime; // the current entire forecast duration + uint32_t requestedStartTime = commandData.requestedStartTime; + + if (! HasFeature(Feature::kForecastAdjustment)) + { + ChipLogProgress(Zcl, "zzzzzzzzzzDEM: %s Feature kForecastAdjustment not enabled", __FUNCTION__); + ctx.mCommandHandler.AddStatus(ctx.mRequestPath, Status::UnsupportedCommand); + return; + } + + if (ESAStateEnum::kUserOptOut == mDelegate.GetESAState()) + { + ChipLogProgress(Zcl, "zzzzzzzzzzDEM: %s - ESAState = kUserOptOut", __FUNCTION__); + ctx.mCommandHandler.AddStatus(ctx.mRequestPath, Status::Failure); + return; + } + + /* If the RequestedStartTime value resulted in a time shift which is outside the time constraints of EarliestStartTime and + LatestEndTime, then the command SHALL be rejected with CONSTRAINT_ERROR; otherwise the command SHALL be rejected with FAILURE + */ + if (forecast.earliestStartTime.HasValue() && !forecast.earliestStartTime.Value().IsNull()) + { + earliestStartTime = forecast.earliestStartTime.Value().Value(); + } + else + { + ChipLogProgress(Zcl, "zzzzzzzzzzDEM: %s - NullOptional earliestStartTime.", __FUNCTION__); + ctx.mCommandHandler.AddStatus(ctx.mRequestPath, Status::Failure); + return; + } + + if (forecast.latestEndTime.HasValue()) + { + latestEndTime = forecast.latestEndTime.Value(); + } + else + { + ChipLogProgress(Zcl, "zzzzzzzzzzDEM: %s - NullOptional latestEndTime.", __FUNCTION__); + ctx.mCommandHandler.AddStatus(ctx.mRequestPath, Status::Failure); + return; + } + + if ( (requestedStartTime < earliestStartTime) + || ((requestedStartTime + duration) > latestEndTime)) + { + ChipLogProgress(Zcl, "zzzzzzzzzzDEM: %s - Bad requestedStartTime %d.", __FUNCTION__, requestedStartTime); + ctx.mCommandHandler.AddStatus(ctx.mRequestPath, Status::ConstraintError); + return; + } + else + { + ChipLogProgress(Zcl, "zzzzzzzzzzDEM: %s - Good requestedStartTime %d.", __FUNCTION__, requestedStartTime); + + status = mDelegate.StartTimeAdjustRequest(requestedStartTime); + ctx.mCommandHandler.AddStatus(ctx.mRequestPath, status); + if (status != Status::Success) + { + ChipLogProgress(Zcl, "zzzzzzzzzzDEM: %s - StartTimeAdjustRequest(%d) FAILURE", __FUNCTION__, requestedStartTime); + return; + } + + forecast.startTime = requestedStartTime; + forecast.endTime = requestedStartTime + duration; + mDelegate.SetForecast(forecast); + } + + ChipLogProgress(Zcl, "zzzzzzzzzzDEM: %s Partially implemented", __FUNCTION__); + return; +} + +void Instance::HandlePauseRequest(HandlerContext & ctx, const Commands::PauseRequest::DecodableType & commandData) +{ + Status status = Status::Success; + CHIP_ERROR err = CHIP_NO_ERROR; + Structs::ForecastStruct::Type forecast = mDelegate.GetForecast(); + uint32_t duration = commandData.duration; + + if (! HasFeature(Feature::kForecastAdjustment)) + { + ChipLogProgress(Zcl, "zzzzzzzzzzDEM: %s Feature kForecastAdjustment not enabled", __FUNCTION__); + ctx.mCommandHandler.AddStatus(ctx.mRequestPath, Status::UnsupportedCommand); + return; + } + + if (ESAStateEnum::kUserOptOut == mDelegate.GetESAState()) + { + ChipLogProgress(Zcl, "zzzzzzzzzzDEM: %s - ESAState = kUserOptOut", __FUNCTION__); + ctx.mCommandHandler.AddStatus(ctx.mRequestPath, Status::Failure); + return; + } + + /* value SHALL be between the MinPauseDuration and MaxPauseDuration indicated in the + ActiveSlotNumber index in the Slots list in the Forecast. + */ + uint16_t activeSlotNumber; + if (forecast.activeSlotNumber.IsNull()) + { + ChipLogProgress(Zcl, "zzzzzzzzzzDEM: %s - activeSlotNumber Is Null", __FUNCTION__); + ctx.mCommandHandler.AddStatus(ctx.mRequestPath, Status::Failure); + return; + } + + activeSlotNumber = forecast.activeSlotNumber.Value(); + if (activeSlotNumber >= forecast.slots.size()) + { + ChipLogProgress(Zcl, "zzzzzzzzzzDEM: %s - Bad activeSlotNumber %d , size()=%d.", __FUNCTION__, + activeSlotNumber, static_cast(forecast.slots.size())); + ctx.mCommandHandler.AddStatus(ctx.mRequestPath, Status::Failure); + return; + } + + if (! forecast.slots[activeSlotNumber].slotIsPauseable ) + { + ChipLogProgress(Zcl, "zzzzzzzzzzDEM: %s - activeSlotNumber %d Is not pausible.", __FUNCTION__, activeSlotNumber); + ctx.mCommandHandler.AddStatus(ctx.mRequestPath, Status::ConstraintError); + return; + } + + if ( (duration < forecast.slots[activeSlotNumber].minPauseDuration) + && (duration > forecast.slots[activeSlotNumber].maxPauseDuration)) + { + ChipLogProgress(Zcl, "zzzzzzzzzzDEM: %s - out of range pause duration %d", __FUNCTION__, duration); + ctx.mCommandHandler.AddStatus(ctx.mRequestPath, Status::ConstraintError); + return; + } + + err = mDelegate.SetESAState(ESAStateEnum::kPaused); + if (CHIP_NO_ERROR != err) + { + ChipLogProgress(Zcl, "zzzzzzzzzzDEM: %s - SetESAState(paused) FAILURE", __FUNCTION__); + ctx.mCommandHandler.AddStatus(ctx.mRequestPath, Status::Failure); + return; + } + + status = mDelegate.PauseRequest(duration); + ctx.mCommandHandler.AddStatus(ctx.mRequestPath, Status::Failure); + if (status != Status::Success) + { + ChipLogProgress(Zcl, "zzzzzzzzzzDEM: %s - mDelegate.PauseRequest(%d) FAILURE", __FUNCTION__, duration); + return; + } + + return; +} + +void Instance::HandleResumeRequest(HandlerContext & ctx, const Commands::ResumeRequest::DecodableType & commandData) +{ + Status status = Status::Success; + Structs::ForecastStruct::Type forecast = mDelegate.GetForecast(); + + if (! HasFeature(Feature::kForecastAdjustment)) + { + ChipLogProgress(Zcl, "zzzzzzzzzzDEM: %s Feature kForecastAdjustment not enabled", __FUNCTION__); + ctx.mCommandHandler.AddStatus(ctx.mRequestPath, Status::UnsupportedCommand); + return; + } + + if (ESAStateEnum::kPaused != mDelegate.GetESAState()) + { + ChipLogProgress(Zcl, "zzzzzzzzzzDEM: %s - ESAState not Paused.", __FUNCTION__); + ctx.mCommandHandler.AddStatus(ctx.mRequestPath, Status::Failure); + return; + } + + status = mDelegate.ResumeRequest(); + ctx.mCommandHandler.AddStatus(ctx.mRequestPath, Status::Failure); + if (status != Status::Success) + { + ChipLogProgress(Zcl, "zzzzzzzzzzDEM: %s - mDelegate.ResumeRequest() FAILURE", __FUNCTION__); + return; + } + + // TODO: The ESA SHALL also generate a Resumed Event and the ESAState SHALL be updated accordingly to reflect its current state. + ChipLogProgress(Zcl, "DEM: %s not fully implemented", __FUNCTION__); + return; +} + +void Instance::HandleModifyForecastRequest(HandlerContext & ctx, const Commands::ModifyForecastRequest::DecodableType & commandData) +{ + +} + +void Instance::HandleRequestConstraintBasedForecast(HandlerContext & ctx, const Commands::RequestConstraintBasedForecast::DecodableType & commandData) +{ +} + +} // chip +} // app +} // Clusters +} // DeviceEnergyManagement + +void emberAfDeviceEnergyManagementClusterServerInitCallback(chip::EndpointId endpoint) {} + +void MatterDeviceEnergyManagementPluginServerInitCallback() {} diff --git a/src/app/clusters/device-energy-management-server/device-energy-management-server.h b/src/app/clusters/device-energy-management-server/device-energy-management-server.h new file mode 100644 index 00000000000000..fc6f20c4da0936 --- /dev/null +++ b/src/app/clusters/device-energy-management-server/device-energy-management-server.h @@ -0,0 +1,197 @@ +/* + * + * Copyright (c) 2023 Project CHIP Authors + * All rights reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#pragma once +#include +#include +#include +#include +#include +#include +#include +#include +#include + + +namespace chip { +namespace app { +namespace Clusters { +namespace DeviceEnergyManagement { + +// TODO: Spec-defined constraints ? +constexpr int64_t kMinimumChargeCurrent = 0; + +using chip::Protocols::InteractionModel::Status; + +/** @brief Defines methods for implementing application-specific logic for this Cluster. + */ +class Delegate +{ +public: + virtual ~Delegate() = default; + + void SetEndpointId(EndpointId aEndpoint) { mEndpointId = aEndpoint; } + + /** + * @brief Delegate should implement a handler to begin to adjust client power + * consumption/generation to the level requested. + * + * @param power Milli-Watts the ESA SHALL use during the adjustment period. Positive values indicate the direction of current flow -towards- a load. + * @param duration The duration that the ESA SHALL maintain the requested power for. + * @return Success if the adjustment is accepted; otherwise the command SHALL be rejected with appropriate error. + */ + virtual Status PowerAdjustRequest(const int64_t power, const uint32_t duration) = 0; + + /** + * @brief Delegate SHALL make the ESA end the active power adjustment session & return to normal (or idle) power levels. + * The ESA SHALL also generate an PowerAdjustEnd Event and the ESAState SHALL be restored to Online. + * + * @return It should report SUCCESS if successful and FAILURE otherwise. + */ + virtual Status CancelPowerAdjustRequest() = 0; + + + /** + * @brief Delegate for the ESA SHALL update its Forecast attribute with the RequestedStartTime including a new ForecastId. + * + * If the ESA supports ForecastAdjustment, and the ESAState is not UserOptOut and the RequestedStartTime is after + * the EarliestStartTime and the resulting EndTime is before the LatestEndTime, then ESA SHALL accept the request + * to modify the Start Time. + * A client can estimate the entire Forecast sequence duration by computing the EndTime - StartTime fields from the + * Forecast attribute, and therefore avoid scheduling the start time too late. + * + * @param requestedStartTime The requested start time in UTC that the client would like the appliance to shift its power forecast to. + * @return Success if the StartTime in the Forecast is updated, otherwise the command SHALL be rejected with appropriate IM_Status. + */ + virtual Status StartTimeAdjustRequest(const uint32_t requestedStartTime) = 0; + + /** + * @brief Delegate implementation: + * If the ESA supports FA and either the SlotIsPauseable field is true in the ActiveSlotNumber index in the + * Slots list, or the IsPausable field is true in the Forecast attribute structure, and the ESAState is not + * UserOptOut then the ESA SHALL pause its current operation. + * During this state the ESA SHALL not consume or produce significant power (other than required to keep its + * basic control system operational). + * The ESA SHALL also generate a Paused Event and the ESAState SHALL be restored to Paused. + * + * @param duration Duration that the ESA SHALL be paused for. SHALL be between MinPauseDuration & MaxPauseDuration for current slot. + * @return Success if the ESA is paused, otherwise returns other IM_Statuses. + */ + virtual Status PauseRequest(const uint32_t duration) = 0; + + /** + * @brief Delegate implementation: + * If the ESA supports FA and it is currently Paused then the ESA SHALL resume its operation. + * The ESA SHALL also generate a Resumed Event and the ESAState SHALL be updated accordingly to + * reflect its current state. + * + * @return Success if the ESA is resumed, otherwise returns other IM_Statuss. + */ + virtual Status ResumeRequest() = 0; + + /** + * @brief Delegate should implement: + * If the ESA supports FA, and the ESAState is not UserOptOut it SHALL attempt to adjust its power forecast. + * This allows a one or more modifications in a single command by sending a list of modifications (one for each 'slot'). + * Attempts to modify slots which have already past, SHALL result in the entire command being rejected. + * If the ESA accepts the requested Forecast then it SHALL update its Forecast attribute (incrementing its ForecastId) + * and run the revised Forecast as its new intended operation. + * + * @param forecastId Indicates the ESA ForecastId that is to be modified. + * @param slotAdjustments List of adjustments to be applied to the ESA, corresponding to the expected ESA forecastId. + * @return Success if the entire list of SlotAdjustmentStruct are accepted, otherwise the command + * SHALL be rejected returning other IM_Statuss. + */ + virtual Status ModifyForecastRequest( const uint32_t forecastId, const DataModel::DecodableList & slotAdjustments) = 0; + + /** + * @brief Delegate should implement: + * The ESA SHALL inspect the requested power limits to ensure that there are no overlapping elements. The ESA + * manufacturer may also reject the request if it could cause the user’s preferences to be breached (e.g. may + * cause the home to be too hot or too cold, or a battery to be insufficiently charged). + * If the ESA can meet the requested power limits, it SHALL regenerate a new Power Forecast with a new ForecastId. + * + * @param constraints Sequence of turn up/down power requests that the ESA is being asked to constrain its operation within. + * @return Success if successfull, otherwise the command SHALL be rejected returning other IM_Statuss. + */ + virtual Status RequestConstraintBasedForecast(const DataModel::DecodableList & constraints) = 0; + + // ------------------------------------------------------------------ + // Get attribute methods + virtual ESATypeEnum GetESAType() = 0; + virtual bool GetESACanGenerate() = 0; + virtual ESAStateEnum GetESAState() = 0; + virtual int64_t GetAbsMinPower() = 0; + virtual int64_t GetAbsMaxPower() = 0; + virtual Attributes::PowerAdjustmentCapability::TypeInfo::Type GetPowerAdjustmentCapability() = 0; + virtual Structs::ForecastStruct::Type GetForecast() = 0; + + + // ------------------------------------------------------------------ + // Set attribute methods + virtual CHIP_ERROR SetESAType(ESATypeEnum) = 0; + virtual CHIP_ERROR SetESACanGenerate(bool) = 0; + virtual CHIP_ERROR SetESAState(ESAStateEnum) = 0; + virtual CHIP_ERROR SetAbsMinPower(int64_t) = 0; + virtual CHIP_ERROR SetAbsMaxPower(int64_t) = 0; + virtual CHIP_ERROR SetPowerAdjustmentCapability(Attributes::PowerAdjustmentCapability::TypeInfo::Type &) = 0; + virtual CHIP_ERROR SetForecast(Structs::ForecastStruct::Type &) = 0; + +protected: + EndpointId mEndpointId = 0; +}; + + +class Instance : public AttributeAccessInterface, public CommandHandlerInterface +{ +public: + Instance(EndpointId aEndpointId, Delegate & aDelegate); + ~Instance(); + + CHIP_ERROR Init(); + void Shutdown(); + + bool HasFeature(Feature aFeature) const; + +private: + Delegate & mDelegate; + EndpointId mEndpointId; + BitMask mFeature; + + // AttributeAccessInterface + CHIP_ERROR Read( const ConcreteReadAttributePath & aPath, AttributeValueEncoder & aEncoder) override; + CHIP_ERROR Write(const ConcreteDataAttributePath & aPath, AttributeValueDecoder & aDecoder) override; + + // CommandHandlerInterface + void InvokeCommand(HandlerContext & handlerContext) override; + CHIP_ERROR EnumerateAcceptedCommands(const ConcreteClusterPath & cluster, CommandIdCallback callback, void * context) override; + + void HandlePowerAdjustRequest (HandlerContext & ctx, const Commands::PowerAdjustRequest::DecodableType & commandData); + void HandleCancelPowerAdjustRequest (HandlerContext & ctx, const Commands::CancelPowerAdjustRequest::DecodableType & commandData); + void HandleStartTimeAdjustRequest (HandlerContext & ctx, const Commands::StartTimeAdjustRequest::DecodableType & commandData); + void HandlePauseRequest (HandlerContext & ctx, const Commands::PauseRequest::DecodableType & commandData); + void HandleResumeRequest (HandlerContext & ctx, const Commands::ResumeRequest::DecodableType & commandData); + void HandleModifyForecastRequest (HandlerContext & ctx, const Commands::ModifyForecastRequest::DecodableType & commandData); + void HandleRequestConstraintBasedForecast(HandlerContext & ctx, const Commands::RequestConstraintBasedForecast::DecodableType & commandData); + +}; + +} // namespace DeviceEnergyManagement +} // namespace Clusters +} // namespace app +} // namespace chip From f6e9d419d06f25b8b2b142d8064cc4e2e7736824 Mon Sep 17 00:00:00 2001 From: "Restyled.io" Date: Tue, 12 Dec 2023 15:34:59 +0000 Subject: [PATCH 007/114] Restyled by whitespace --- .../device-energy-management-server.cpp | 2 +- .../device-energy-management-server.h | 22 +++++++++---------- 2 files changed, 12 insertions(+), 12 deletions(-) diff --git a/src/app/clusters/device-energy-management-server/device-energy-management-server.cpp b/src/app/clusters/device-energy-management-server/device-energy-management-server.cpp index 200337e744ac9a..a2a46209b41481 100644 --- a/src/app/clusters/device-energy-management-server/device-energy-management-server.cpp +++ b/src/app/clusters/device-energy-management-server/device-energy-management-server.cpp @@ -306,7 +306,7 @@ void Instance::HandleStartTimeAdjustRequest(HandlerContext & ctx, const Commands ChipLogProgress(Zcl, "zzzzzzzzzzDEM: %s - StartTimeAdjustRequest(%d) FAILURE", __FUNCTION__, requestedStartTime); return; } - + forecast.startTime = requestedStartTime; forecast.endTime = requestedStartTime + duration; mDelegate.SetForecast(forecast); diff --git a/src/app/clusters/device-energy-management-server/device-energy-management-server.h b/src/app/clusters/device-energy-management-server/device-energy-management-server.h index fc6f20c4da0936..cbacd0329fd181 100644 --- a/src/app/clusters/device-energy-management-server/device-energy-management-server.h +++ b/src/app/clusters/device-energy-management-server/device-energy-management-server.h @@ -50,7 +50,7 @@ class Delegate /** * @brief Delegate should implement a handler to begin to adjust client power * consumption/generation to the level requested. - * + * * @param power Milli-Watts the ESA SHALL use during the adjustment period. Positive values indicate the direction of current flow -towards- a load. * @param duration The duration that the ESA SHALL maintain the requested power for. * @return Success if the adjustment is accepted; otherwise the command SHALL be rejected with appropriate error. @@ -60,7 +60,7 @@ class Delegate /** * @brief Delegate SHALL make the ESA end the active power adjustment session & return to normal (or idle) power levels. * The ESA SHALL also generate an PowerAdjustEnd Event and the ESAState SHALL be restored to Online. - * + * * @return It should report SUCCESS if successful and FAILURE otherwise. */ virtual Status CancelPowerAdjustRequest() = 0; @@ -68,13 +68,13 @@ class Delegate /** * @brief Delegate for the ESA SHALL update its Forecast attribute with the RequestedStartTime including a new ForecastId. - * + * * If the ESA supports ForecastAdjustment, and the ESAState is not UserOptOut and the RequestedStartTime is after * the EarliestStartTime and the resulting EndTime is before the LatestEndTime, then ESA SHALL accept the request * to modify the Start Time. * A client can estimate the entire Forecast sequence duration by computing the EndTime - StartTime fields from the * Forecast attribute, and therefore avoid scheduling the start time too late. - * + * * @param requestedStartTime The requested start time in UTC that the client would like the appliance to shift its power forecast to. * @return Success if the StartTime in the Forecast is updated, otherwise the command SHALL be rejected with appropriate IM_Status. */ @@ -83,12 +83,12 @@ class Delegate /** * @brief Delegate implementation: * If the ESA supports FA and either the SlotIsPauseable field is true in the ActiveSlotNumber index in the - * Slots list, or the IsPausable field is true in the Forecast attribute structure, and the ESAState is not + * Slots list, or the IsPausable field is true in the Forecast attribute structure, and the ESAState is not * UserOptOut then the ESA SHALL pause its current operation. * During this state the ESA SHALL not consume or produce significant power (other than required to keep its * basic control system operational). * The ESA SHALL also generate a Paused Event and the ESAState SHALL be restored to Paused. - * + * * @param duration Duration that the ESA SHALL be paused for. SHALL be between MinPauseDuration & MaxPauseDuration for current slot. * @return Success if the ESA is paused, otherwise returns other IM_Statuses. */ @@ -97,9 +97,9 @@ class Delegate /** * @brief Delegate implementation: * If the ESA supports FA and it is currently Paused then the ESA SHALL resume its operation. - * The ESA SHALL also generate a Resumed Event and the ESAState SHALL be updated accordingly to + * The ESA SHALL also generate a Resumed Event and the ESAState SHALL be updated accordingly to * reflect its current state. - * + * * @return Success if the ESA is resumed, otherwise returns other IM_Statuss. */ virtual Status ResumeRequest() = 0; @@ -111,7 +111,7 @@ class Delegate * Attempts to modify slots which have already past, SHALL result in the entire command being rejected. * If the ESA accepts the requested Forecast then it SHALL update its Forecast attribute (incrementing its ForecastId) * and run the revised Forecast as its new intended operation. - * + * * @param forecastId Indicates the ESA ForecastId that is to be modified. * @param slotAdjustments List of adjustments to be applied to the ESA, corresponding to the expected ESA forecastId. * @return Success if the entire list of SlotAdjustmentStruct are accepted, otherwise the command @@ -122,10 +122,10 @@ class Delegate /** * @brief Delegate should implement: * The ESA SHALL inspect the requested power limits to ensure that there are no overlapping elements. The ESA - * manufacturer may also reject the request if it could cause the user’s preferences to be breached (e.g. may + * manufacturer may also reject the request if it could cause the user’s preferences to be breached (e.g. may * cause the home to be too hot or too cold, or a battery to be insufficiently charged). * If the ESA can meet the requested power limits, it SHALL regenerate a new Power Forecast with a new ForecastId. - * + * * @param constraints Sequence of turn up/down power requests that the ESA is being asked to constrain its operation within. * @return Success if successfull, otherwise the command SHALL be rejected returning other IM_Statuss. */ From 82d6fa5b741401e6f0e8b5d5a669d4be65c9af77 Mon Sep 17 00:00:00 2001 From: "Restyled.io" Date: Tue, 12 Dec 2023 15:35:02 +0000 Subject: [PATCH 008/114] Restyled by clang-format --- .../device-energy-management-server.cpp | 155 +++++++++--------- .../device-energy-management-server.h | 69 ++++---- 2 files changed, 113 insertions(+), 111 deletions(-) diff --git a/src/app/clusters/device-energy-management-server/device-energy-management-server.cpp b/src/app/clusters/device-energy-management-server/device-energy-management-server.cpp index a2a46209b41481..836dbe3605f00e 100644 --- a/src/app/clusters/device-energy-management-server/device-energy-management-server.cpp +++ b/src/app/clusters/device-energy-management-server/device-energy-management-server.cpp @@ -21,7 +21,6 @@ #include #include - using namespace chip; using namespace chip::app; using namespace chip::app::Clusters; @@ -30,7 +29,6 @@ using namespace chip::app::Clusters::DeviceEnergyManagement::Attributes; using chip::Protocols::InteractionModel::Status; - namespace chip { namespace app { namespace Clusters { @@ -67,7 +65,6 @@ bool Instance::HasFeature(Feature aFeature) const return mFeature.Has(aFeature); } - // AttributeAccessInterface CHIP_ERROR Instance::Read(const ConcreteReadAttributePath & aPath, AttributeValueEncoder & aEncoder) { @@ -95,7 +92,7 @@ CHIP_ERROR Instance::Read(const ConcreteReadAttributePath & aPath, AttributeValu CHIP_ERROR Instance::Write(const ConcreteDataAttributePath & aPath, AttributeValueDecoder & aDecoder) { - return CHIP_ERROR_NOT_IMPLEMENTED; // Nothing writable in this cluster ! + return CHIP_ERROR_NOT_IMPLEMENTED; // Nothing writable in this cluster ! } // CommandHandlerInterface @@ -134,11 +131,13 @@ void Instance::InvokeCommand(HandlerContext & handlerContext) return; case CancelPowerAdjustRequest::Id: HandleCommand( - handlerContext, [this](HandlerContext & ctx, const auto & commandData) { HandleCancelPowerAdjustRequest(ctx, commandData); }); + handlerContext, + [this](HandlerContext & ctx, const auto & commandData) { HandleCancelPowerAdjustRequest(ctx, commandData); }); return; case StartTimeAdjustRequest::Id: HandleCommand( - handlerContext, [this](HandlerContext & ctx, const auto & commandData) { HandleStartTimeAdjustRequest(ctx, commandData); }); + handlerContext, + [this](HandlerContext & ctx, const auto & commandData) { HandleStartTimeAdjustRequest(ctx, commandData); }); return; case PauseRequest::Id: HandleCommand( @@ -149,38 +148,40 @@ void Instance::InvokeCommand(HandlerContext & handlerContext) handlerContext, [this](HandlerContext & ctx, const auto & commandData) { HandleResumeRequest(ctx, commandData); }); return; case ModifyForecastRequest::Id: - HandleCommand( - handlerContext, [this](HandlerContext & ctx, const auto & commandData) { HandleModifyForecastRequest(ctx, commandData); }); + HandleCommand(handlerContext, [this](HandlerContext & ctx, const auto & commandData) { + HandleModifyForecastRequest(ctx, commandData); + }); return; case RequestConstraintBasedForecast::Id: HandleCommand( - handlerContext, [this](HandlerContext & ctx, const auto & commandData) { HandleRequestConstraintBasedForecast(ctx, commandData); }); + handlerContext, + [this](HandlerContext & ctx, const auto & commandData) { HandleRequestConstraintBasedForecast(ctx, commandData); }); return; } } void Instance::HandlePowerAdjustRequest(HandlerContext & ctx, const Commands::PowerAdjustRequest::DecodableType & commandData) { - int64_t power = commandData.power; + int64_t power = commandData.power; uint32_t durationSec = commandData.duration; - bool validArgs = false; - Status status = Status::Success; + bool validArgs = false; + Status status = Status::Success; auto powerAdjustmentCapability = mDelegate.GetPowerAdjustmentCapability(); if (powerAdjustmentCapability.IsNull()) { - ChipLogProgress(Zcl, "zzzzzzzzzzDEM: %s powerAdjustmentCapability IsNull", __FUNCTION__); + ChipLogProgress(Zcl, "zzzzzzzzzzDEM: %s powerAdjustmentCapability IsNull", __FUNCTION__); ctx.mCommandHandler.AddStatus(ctx.mRequestPath, Status::ConstraintError); return; } for (auto pas : powerAdjustmentCapability.Value()) { - if ( (power >= pas.minPower) && (durationSec >= pas.minDuration) - && (power <= pas.maxPower) && (durationSec <= pas.maxDuration)) + if ((power >= pas.minPower) && (durationSec >= pas.minDuration) && (power <= pas.maxPower) && + (durationSec <= pas.maxDuration)) { - ChipLogProgress(Zcl, "zzzzzzzzzzDEM: %s Good PowerAdjustment args", __FUNCTION__); + ChipLogProgress(Zcl, "zzzzzzzzzzDEM: %s Good PowerAdjustment args", __FUNCTION__); validArgs = true; break; } @@ -188,13 +189,13 @@ void Instance::HandlePowerAdjustRequest(HandlerContext & ctx, const Commands::Po if (!validArgs) { - ChipLogProgress(Zcl, "zzzzzzzzzzDEM: %s invalid request range", __FUNCTION__); + ChipLogProgress(Zcl, "zzzzzzzzzzDEM: %s invalid request range", __FUNCTION__); // TODO: raise event ? ctx.mCommandHandler.AddStatus(ctx.mRequestPath, Status::ConstraintError); return; } - ChipLogProgress(Zcl, "zzzzzzzzzzDEM: %s Good PowerAdjustRequest() args.", __FUNCTION__); + ChipLogProgress(Zcl, "zzzzzzzzzzDEM: %s Good PowerAdjustRequest() args.", __FUNCTION__); // TODO: Generate a PowerAdjustStart Event, then begins to adjust its power. How is this done, Async? // When done, raise PowerAdjustEnd & ESAState set to kOnline. @@ -202,63 +203,64 @@ void Instance::HandlePowerAdjustRequest(HandlerContext & ctx, const Commands::Po ctx.mCommandHandler.AddStatus(ctx.mRequestPath, status); if (status != Status::Success) { - ChipLogProgress(Zcl, "zzzzzzzzzzDEM: %s Failed to PowerAdjustRequest() args.", __FUNCTION__); + ChipLogProgress(Zcl, "zzzzzzzzzzDEM: %s Failed to PowerAdjustRequest() args.", __FUNCTION__); } - ChipLogProgress(Zcl, "zzzzzzzzzzDEM: %s Partly implemented", __FUNCTION__); + ChipLogProgress(Zcl, "zzzzzzzzzzDEM: %s Partly implemented", __FUNCTION__); return; } - -void Instance::HandleCancelPowerAdjustRequest(HandlerContext & ctx, const Commands::CancelPowerAdjustRequest::DecodableType & commandData) +void Instance::HandleCancelPowerAdjustRequest(HandlerContext & ctx, + const Commands::CancelPowerAdjustRequest::DecodableType & commandData) { - Status status = Status::Success; - ESAStateEnum esaStatus; + Status status = Status::Success; + ESAStateEnum esaStatus; esaStatus = mDelegate.GetESAState(); if (ESAStateEnum::kPowerAdjustActive != esaStatus) { - ChipLogProgress(Zcl, "zzzzzzzzzzDEM: %s - kPowerAdjustActive != esaStatus", __FUNCTION__); + ChipLogProgress(Zcl, "zzzzzzzzzzDEM: %s - kPowerAdjustActive != esaStatus", __FUNCTION__); ctx.mCommandHandler.AddStatus(ctx.mRequestPath, Status::Failure); return; } /* TODO: If the command is accepted, the ESA SHALL generate an PowerAdjustEnd Event. */ - ChipLogProgress(Zcl, "zzzzzzzzzzDEM: %s Good CancelPowerAdjustRequest() args.", __FUNCTION__); + ChipLogProgress(Zcl, "zzzzzzzzzzDEM: %s Good CancelPowerAdjustRequest() args.", __FUNCTION__); status = mDelegate.CancelPowerAdjustRequest(); ctx.mCommandHandler.AddStatus(ctx.mRequestPath, status); if (status != Status::Success) { - ChipLogProgress(Zcl, "zzzzzzzzzzDEM: %s Failed to PowerAdjustRequest() args.", __FUNCTION__); + ChipLogProgress(Zcl, "zzzzzzzzzzDEM: %s Failed to PowerAdjustRequest() args.", __FUNCTION__); return; } ctx.mCommandHandler.AddStatus(ctx.mRequestPath, status); - ChipLogProgress(Zcl, "zzzzzzzzzzDEM: %s partly implemented", __FUNCTION__); + ChipLogProgress(Zcl, "zzzzzzzzzzDEM: %s partly implemented", __FUNCTION__); return; } -void Instance::HandleStartTimeAdjustRequest(HandlerContext & ctx, const Commands::StartTimeAdjustRequest::DecodableType & commandData) +void Instance::HandleStartTimeAdjustRequest(HandlerContext & ctx, + const Commands::StartTimeAdjustRequest::DecodableType & commandData) { - Status status = Status::Success; - uint32_t earliestStartTime = 0; - uint32_t latestEndTime = 0; + Status status = Status::Success; + uint32_t earliestStartTime = 0; + uint32_t latestEndTime = 0; Structs::ForecastStruct::Type forecast = mDelegate.GetForecast(); - uint32_t duration = forecast.endTime - forecast.startTime; // the current entire forecast duration - uint32_t requestedStartTime = commandData.requestedStartTime; + uint32_t duration = forecast.endTime - forecast.startTime; // the current entire forecast duration + uint32_t requestedStartTime = commandData.requestedStartTime; - if (! HasFeature(Feature::kForecastAdjustment)) + if (!HasFeature(Feature::kForecastAdjustment)) { - ChipLogProgress(Zcl, "zzzzzzzzzzDEM: %s Feature kForecastAdjustment not enabled", __FUNCTION__); + ChipLogProgress(Zcl, "zzzzzzzzzzDEM: %s Feature kForecastAdjustment not enabled", __FUNCTION__); ctx.mCommandHandler.AddStatus(ctx.mRequestPath, Status::UnsupportedCommand); return; } if (ESAStateEnum::kUserOptOut == mDelegate.GetESAState()) { - ChipLogProgress(Zcl, "zzzzzzzzzzDEM: %s - ESAState = kUserOptOut", __FUNCTION__); + ChipLogProgress(Zcl, "zzzzzzzzzzDEM: %s - ESAState = kUserOptOut", __FUNCTION__); ctx.mCommandHandler.AddStatus(ctx.mRequestPath, Status::Failure); return; } @@ -272,7 +274,7 @@ void Instance::HandleStartTimeAdjustRequest(HandlerContext & ctx, const Commands } else { - ChipLogProgress(Zcl, "zzzzzzzzzzDEM: %s - NullOptional earliestStartTime.", __FUNCTION__); + ChipLogProgress(Zcl, "zzzzzzzzzzDEM: %s - NullOptional earliestStartTime.", __FUNCTION__); ctx.mCommandHandler.AddStatus(ctx.mRequestPath, Status::Failure); return; } @@ -283,27 +285,26 @@ void Instance::HandleStartTimeAdjustRequest(HandlerContext & ctx, const Commands } else { - ChipLogProgress(Zcl, "zzzzzzzzzzDEM: %s - NullOptional latestEndTime.", __FUNCTION__); + ChipLogProgress(Zcl, "zzzzzzzzzzDEM: %s - NullOptional latestEndTime.", __FUNCTION__); ctx.mCommandHandler.AddStatus(ctx.mRequestPath, Status::Failure); return; } - if ( (requestedStartTime < earliestStartTime) - || ((requestedStartTime + duration) > latestEndTime)) + if ((requestedStartTime < earliestStartTime) || ((requestedStartTime + duration) > latestEndTime)) { - ChipLogProgress(Zcl, "zzzzzzzzzzDEM: %s - Bad requestedStartTime %d.", __FUNCTION__, requestedStartTime); + ChipLogProgress(Zcl, "zzzzzzzzzzDEM: %s - Bad requestedStartTime %d.", __FUNCTION__, requestedStartTime); ctx.mCommandHandler.AddStatus(ctx.mRequestPath, Status::ConstraintError); return; } else { - ChipLogProgress(Zcl, "zzzzzzzzzzDEM: %s - Good requestedStartTime %d.", __FUNCTION__, requestedStartTime); + ChipLogProgress(Zcl, "zzzzzzzzzzDEM: %s - Good requestedStartTime %d.", __FUNCTION__, requestedStartTime); status = mDelegate.StartTimeAdjustRequest(requestedStartTime); ctx.mCommandHandler.AddStatus(ctx.mRequestPath, status); if (status != Status::Success) { - ChipLogProgress(Zcl, "zzzzzzzzzzDEM: %s - StartTimeAdjustRequest(%d) FAILURE", __FUNCTION__, requestedStartTime); + ChipLogProgress(Zcl, "zzzzzzzzzzDEM: %s - StartTimeAdjustRequest(%d) FAILURE", __FUNCTION__, requestedStartTime); return; } @@ -312,27 +313,27 @@ void Instance::HandleStartTimeAdjustRequest(HandlerContext & ctx, const Commands mDelegate.SetForecast(forecast); } - ChipLogProgress(Zcl, "zzzzzzzzzzDEM: %s Partially implemented", __FUNCTION__); + ChipLogProgress(Zcl, "zzzzzzzzzzDEM: %s Partially implemented", __FUNCTION__); return; } void Instance::HandlePauseRequest(HandlerContext & ctx, const Commands::PauseRequest::DecodableType & commandData) { - Status status = Status::Success; - CHIP_ERROR err = CHIP_NO_ERROR; + Status status = Status::Success; + CHIP_ERROR err = CHIP_NO_ERROR; Structs::ForecastStruct::Type forecast = mDelegate.GetForecast(); - uint32_t duration = commandData.duration; + uint32_t duration = commandData.duration; - if (! HasFeature(Feature::kForecastAdjustment)) + if (!HasFeature(Feature::kForecastAdjustment)) { - ChipLogProgress(Zcl, "zzzzzzzzzzDEM: %s Feature kForecastAdjustment not enabled", __FUNCTION__); + ChipLogProgress(Zcl, "zzzzzzzzzzDEM: %s Feature kForecastAdjustment not enabled", __FUNCTION__); ctx.mCommandHandler.AddStatus(ctx.mRequestPath, Status::UnsupportedCommand); return; } if (ESAStateEnum::kUserOptOut == mDelegate.GetESAState()) { - ChipLogProgress(Zcl, "zzzzzzzzzzDEM: %s - ESAState = kUserOptOut", __FUNCTION__); + ChipLogProgress(Zcl, "zzzzzzzzzzDEM: %s - ESAState = kUserOptOut", __FUNCTION__); ctx.mCommandHandler.AddStatus(ctx.mRequestPath, Status::Failure); return; } @@ -343,7 +344,7 @@ void Instance::HandlePauseRequest(HandlerContext & ctx, const Commands::PauseReq uint16_t activeSlotNumber; if (forecast.activeSlotNumber.IsNull()) { - ChipLogProgress(Zcl, "zzzzzzzzzzDEM: %s - activeSlotNumber Is Null", __FUNCTION__); + ChipLogProgress(Zcl, "zzzzzzzzzzDEM: %s - activeSlotNumber Is Null", __FUNCTION__); ctx.mCommandHandler.AddStatus(ctx.mRequestPath, Status::Failure); return; } @@ -351,23 +352,23 @@ void Instance::HandlePauseRequest(HandlerContext & ctx, const Commands::PauseReq activeSlotNumber = forecast.activeSlotNumber.Value(); if (activeSlotNumber >= forecast.slots.size()) { - ChipLogProgress(Zcl, "zzzzzzzzzzDEM: %s - Bad activeSlotNumber %d , size()=%d.", __FUNCTION__, - activeSlotNumber, static_cast(forecast.slots.size())); + ChipLogProgress(Zcl, "zzzzzzzzzzDEM: %s - Bad activeSlotNumber %d , size()=%d.", __FUNCTION__, activeSlotNumber, + static_cast(forecast.slots.size())); ctx.mCommandHandler.AddStatus(ctx.mRequestPath, Status::Failure); return; } - if (! forecast.slots[activeSlotNumber].slotIsPauseable ) + if (!forecast.slots[activeSlotNumber].slotIsPauseable) { - ChipLogProgress(Zcl, "zzzzzzzzzzDEM: %s - activeSlotNumber %d Is not pausible.", __FUNCTION__, activeSlotNumber); + ChipLogProgress(Zcl, "zzzzzzzzzzDEM: %s - activeSlotNumber %d Is not pausible.", __FUNCTION__, activeSlotNumber); ctx.mCommandHandler.AddStatus(ctx.mRequestPath, Status::ConstraintError); return; } - if ( (duration < forecast.slots[activeSlotNumber].minPauseDuration) - && (duration > forecast.slots[activeSlotNumber].maxPauseDuration)) + if ((duration < forecast.slots[activeSlotNumber].minPauseDuration) && + (duration > forecast.slots[activeSlotNumber].maxPauseDuration)) { - ChipLogProgress(Zcl, "zzzzzzzzzzDEM: %s - out of range pause duration %d", __FUNCTION__, duration); + ChipLogProgress(Zcl, "zzzzzzzzzzDEM: %s - out of range pause duration %d", __FUNCTION__, duration); ctx.mCommandHandler.AddStatus(ctx.mRequestPath, Status::ConstraintError); return; } @@ -375,7 +376,7 @@ void Instance::HandlePauseRequest(HandlerContext & ctx, const Commands::PauseReq err = mDelegate.SetESAState(ESAStateEnum::kPaused); if (CHIP_NO_ERROR != err) { - ChipLogProgress(Zcl, "zzzzzzzzzzDEM: %s - SetESAState(paused) FAILURE", __FUNCTION__); + ChipLogProgress(Zcl, "zzzzzzzzzzDEM: %s - SetESAState(paused) FAILURE", __FUNCTION__); ctx.mCommandHandler.AddStatus(ctx.mRequestPath, Status::Failure); return; } @@ -384,7 +385,7 @@ void Instance::HandlePauseRequest(HandlerContext & ctx, const Commands::PauseReq ctx.mCommandHandler.AddStatus(ctx.mRequestPath, Status::Failure); if (status != Status::Success) { - ChipLogProgress(Zcl, "zzzzzzzzzzDEM: %s - mDelegate.PauseRequest(%d) FAILURE", __FUNCTION__, duration); + ChipLogProgress(Zcl, "zzzzzzzzzzDEM: %s - mDelegate.PauseRequest(%d) FAILURE", __FUNCTION__, duration); return; } @@ -393,19 +394,19 @@ void Instance::HandlePauseRequest(HandlerContext & ctx, const Commands::PauseReq void Instance::HandleResumeRequest(HandlerContext & ctx, const Commands::ResumeRequest::DecodableType & commandData) { - Status status = Status::Success; + Status status = Status::Success; Structs::ForecastStruct::Type forecast = mDelegate.GetForecast(); - if (! HasFeature(Feature::kForecastAdjustment)) + if (!HasFeature(Feature::kForecastAdjustment)) { - ChipLogProgress(Zcl, "zzzzzzzzzzDEM: %s Feature kForecastAdjustment not enabled", __FUNCTION__); + ChipLogProgress(Zcl, "zzzzzzzzzzDEM: %s Feature kForecastAdjustment not enabled", __FUNCTION__); ctx.mCommandHandler.AddStatus(ctx.mRequestPath, Status::UnsupportedCommand); return; } if (ESAStateEnum::kPaused != mDelegate.GetESAState()) { - ChipLogProgress(Zcl, "zzzzzzzzzzDEM: %s - ESAState not Paused.", __FUNCTION__); + ChipLogProgress(Zcl, "zzzzzzzzzzDEM: %s - ESAState not Paused.", __FUNCTION__); ctx.mCommandHandler.AddStatus(ctx.mRequestPath, Status::Failure); return; } @@ -414,29 +415,27 @@ void Instance::HandleResumeRequest(HandlerContext & ctx, const Commands::ResumeR ctx.mCommandHandler.AddStatus(ctx.mRequestPath, Status::Failure); if (status != Status::Success) { - ChipLogProgress(Zcl, "zzzzzzzzzzDEM: %s - mDelegate.ResumeRequest() FAILURE", __FUNCTION__); + ChipLogProgress(Zcl, "zzzzzzzzzzDEM: %s - mDelegate.ResumeRequest() FAILURE", __FUNCTION__); return; } // TODO: The ESA SHALL also generate a Resumed Event and the ESAState SHALL be updated accordingly to reflect its current state. - ChipLogProgress(Zcl, "DEM: %s not fully implemented", __FUNCTION__); + ChipLogProgress(Zcl, "DEM: %s not fully implemented", __FUNCTION__); return; } void Instance::HandleModifyForecastRequest(HandlerContext & ctx, const Commands::ModifyForecastRequest::DecodableType & commandData) -{ +{} -} - -void Instance::HandleRequestConstraintBasedForecast(HandlerContext & ctx, const Commands::RequestConstraintBasedForecast::DecodableType & commandData) -{ -} +void Instance::HandleRequestConstraintBasedForecast(HandlerContext & ctx, + const Commands::RequestConstraintBasedForecast::DecodableType & commandData) +{} -} // chip -} // app -} // Clusters -} // DeviceEnergyManagement +} // namespace DeviceEnergyManagement +} // namespace Clusters +} // namespace app +} // namespace chip -void emberAfDeviceEnergyManagementClusterServerInitCallback(chip::EndpointId endpoint) {} +void emberAfDeviceEnergyManagementClusterServerInitCallback(chip::EndpointId endpoint) {} void MatterDeviceEnergyManagementPluginServerInitCallback() {} diff --git a/src/app/clusters/device-energy-management-server/device-energy-management-server.h b/src/app/clusters/device-energy-management-server/device-energy-management-server.h index cbacd0329fd181..e182fd6d79765d 100644 --- a/src/app/clusters/device-energy-management-server/device-energy-management-server.h +++ b/src/app/clusters/device-energy-management-server/device-energy-management-server.h @@ -27,14 +27,13 @@ #include #include - namespace chip { namespace app { namespace Clusters { namespace DeviceEnergyManagement { // TODO: Spec-defined constraints ? -constexpr int64_t kMinimumChargeCurrent = 0; +constexpr int64_t kMinimumChargeCurrent = 0; using chip::Protocols::InteractionModel::Status; @@ -51,7 +50,8 @@ class Delegate * @brief Delegate should implement a handler to begin to adjust client power * consumption/generation to the level requested. * - * @param power Milli-Watts the ESA SHALL use during the adjustment period. Positive values indicate the direction of current flow -towards- a load. + * @param power Milli-Watts the ESA SHALL use during the adjustment period. Positive values indicate the direction of current + * flow -towards- a load. * @param duration The duration that the ESA SHALL maintain the requested power for. * @return Success if the adjustment is accepted; otherwise the command SHALL be rejected with appropriate error. */ @@ -65,7 +65,6 @@ class Delegate */ virtual Status CancelPowerAdjustRequest() = 0; - /** * @brief Delegate for the ESA SHALL update its Forecast attribute with the RequestedStartTime including a new ForecastId. * @@ -75,8 +74,10 @@ class Delegate * A client can estimate the entire Forecast sequence duration by computing the EndTime - StartTime fields from the * Forecast attribute, and therefore avoid scheduling the start time too late. * - * @param requestedStartTime The requested start time in UTC that the client would like the appliance to shift its power forecast to. - * @return Success if the StartTime in the Forecast is updated, otherwise the command SHALL be rejected with appropriate IM_Status. + * @param requestedStartTime The requested start time in UTC that the client would like the appliance to shift its power + * forecast to. + * @return Success if the StartTime in the Forecast is updated, otherwise the command SHALL be rejected with appropriate + * IM_Status. */ virtual Status StartTimeAdjustRequest(const uint32_t requestedStartTime) = 0; @@ -89,7 +90,8 @@ class Delegate * basic control system operational). * The ESA SHALL also generate a Paused Event and the ESAState SHALL be restored to Paused. * - * @param duration Duration that the ESA SHALL be paused for. SHALL be between MinPauseDuration & MaxPauseDuration for current slot. + * @param duration Duration that the ESA SHALL be paused for. SHALL be between MinPauseDuration & MaxPauseDuration for current + * slot. * @return Success if the ESA is paused, otherwise returns other IM_Statuses. */ virtual Status PauseRequest(const uint32_t duration) = 0; @@ -117,7 +119,8 @@ class Delegate * @return Success if the entire list of SlotAdjustmentStruct are accepted, otherwise the command * SHALL be rejected returning other IM_Statuss. */ - virtual Status ModifyForecastRequest( const uint32_t forecastId, const DataModel::DecodableList & slotAdjustments) = 0; + virtual Status ModifyForecastRequest(const uint32_t forecastId, + const DataModel::DecodableList & slotAdjustments) = 0; /** * @brief Delegate should implement: @@ -129,34 +132,33 @@ class Delegate * @param constraints Sequence of turn up/down power requests that the ESA is being asked to constrain its operation within. * @return Success if successfull, otherwise the command SHALL be rejected returning other IM_Statuss. */ - virtual Status RequestConstraintBasedForecast(const DataModel::DecodableList & constraints) = 0; + virtual Status + RequestConstraintBasedForecast(const DataModel::DecodableList & constraints) = 0; // ------------------------------------------------------------------ // Get attribute methods - virtual ESATypeEnum GetESAType() = 0; - virtual bool GetESACanGenerate() = 0; - virtual ESAStateEnum GetESAState() = 0; - virtual int64_t GetAbsMinPower() = 0; - virtual int64_t GetAbsMaxPower() = 0; - virtual Attributes::PowerAdjustmentCapability::TypeInfo::Type GetPowerAdjustmentCapability() = 0; - virtual Structs::ForecastStruct::Type GetForecast() = 0; - + virtual ESATypeEnum GetESAType() = 0; + virtual bool GetESACanGenerate() = 0; + virtual ESAStateEnum GetESAState() = 0; + virtual int64_t GetAbsMinPower() = 0; + virtual int64_t GetAbsMaxPower() = 0; + virtual Attributes::PowerAdjustmentCapability::TypeInfo::Type GetPowerAdjustmentCapability() = 0; + virtual Structs::ForecastStruct::Type GetForecast() = 0; // ------------------------------------------------------------------ // Set attribute methods - virtual CHIP_ERROR SetESAType(ESATypeEnum) = 0; - virtual CHIP_ERROR SetESACanGenerate(bool) = 0; - virtual CHIP_ERROR SetESAState(ESAStateEnum) = 0; - virtual CHIP_ERROR SetAbsMinPower(int64_t) = 0; - virtual CHIP_ERROR SetAbsMaxPower(int64_t) = 0; + virtual CHIP_ERROR SetESAType(ESATypeEnum) = 0; + virtual CHIP_ERROR SetESACanGenerate(bool) = 0; + virtual CHIP_ERROR SetESAState(ESAStateEnum) = 0; + virtual CHIP_ERROR SetAbsMinPower(int64_t) = 0; + virtual CHIP_ERROR SetAbsMaxPower(int64_t) = 0; virtual CHIP_ERROR SetPowerAdjustmentCapability(Attributes::PowerAdjustmentCapability::TypeInfo::Type &) = 0; - virtual CHIP_ERROR SetForecast(Structs::ForecastStruct::Type &) = 0; + virtual CHIP_ERROR SetForecast(Structs::ForecastStruct::Type &) = 0; protected: EndpointId mEndpointId = 0; }; - class Instance : public AttributeAccessInterface, public CommandHandlerInterface { public: @@ -174,21 +176,22 @@ class Instance : public AttributeAccessInterface, public CommandHandlerInterface BitMask mFeature; // AttributeAccessInterface - CHIP_ERROR Read( const ConcreteReadAttributePath & aPath, AttributeValueEncoder & aEncoder) override; + CHIP_ERROR Read(const ConcreteReadAttributePath & aPath, AttributeValueEncoder & aEncoder) override; CHIP_ERROR Write(const ConcreteDataAttributePath & aPath, AttributeValueDecoder & aDecoder) override; // CommandHandlerInterface void InvokeCommand(HandlerContext & handlerContext) override; CHIP_ERROR EnumerateAcceptedCommands(const ConcreteClusterPath & cluster, CommandIdCallback callback, void * context) override; - void HandlePowerAdjustRequest (HandlerContext & ctx, const Commands::PowerAdjustRequest::DecodableType & commandData); - void HandleCancelPowerAdjustRequest (HandlerContext & ctx, const Commands::CancelPowerAdjustRequest::DecodableType & commandData); - void HandleStartTimeAdjustRequest (HandlerContext & ctx, const Commands::StartTimeAdjustRequest::DecodableType & commandData); - void HandlePauseRequest (HandlerContext & ctx, const Commands::PauseRequest::DecodableType & commandData); - void HandleResumeRequest (HandlerContext & ctx, const Commands::ResumeRequest::DecodableType & commandData); - void HandleModifyForecastRequest (HandlerContext & ctx, const Commands::ModifyForecastRequest::DecodableType & commandData); - void HandleRequestConstraintBasedForecast(HandlerContext & ctx, const Commands::RequestConstraintBasedForecast::DecodableType & commandData); - + void HandlePowerAdjustRequest(HandlerContext & ctx, const Commands::PowerAdjustRequest::DecodableType & commandData); + void HandleCancelPowerAdjustRequest(HandlerContext & ctx, + const Commands::CancelPowerAdjustRequest::DecodableType & commandData); + void HandleStartTimeAdjustRequest(HandlerContext & ctx, const Commands::StartTimeAdjustRequest::DecodableType & commandData); + void HandlePauseRequest(HandlerContext & ctx, const Commands::PauseRequest::DecodableType & commandData); + void HandleResumeRequest(HandlerContext & ctx, const Commands::ResumeRequest::DecodableType & commandData); + void HandleModifyForecastRequest(HandlerContext & ctx, const Commands::ModifyForecastRequest::DecodableType & commandData); + void HandleRequestConstraintBasedForecast(HandlerContext & ctx, + const Commands::RequestConstraintBasedForecast::DecodableType & commandData); }; } // namespace DeviceEnergyManagement From 2dd4b79af435497cc07e16d378a9b26386b1716f Mon Sep 17 00:00:00 2001 From: James Harrow Date: Tue, 12 Dec 2023 22:12:41 +0000 Subject: [PATCH 009/114] Fixes based on similar conversations on EVSE review. Made Forecast and PowerAdjustmentCapability Nullable attributes. Added feature support. --- .../device-energy-management-server.cpp | 343 +++++++++++------- .../device-energy-management-server.h | 20 +- 2 files changed, 224 insertions(+), 139 deletions(-) diff --git a/src/app/clusters/device-energy-management-server/device-energy-management-server.cpp b/src/app/clusters/device-energy-management-server/device-energy-management-server.cpp index 836dbe3605f00e..4918a2f1013964 100644 --- a/src/app/clusters/device-energy-management-server/device-energy-management-server.cpp +++ b/src/app/clusters/device-energy-management-server/device-energy-management-server.cpp @@ -34,30 +34,18 @@ namespace app { namespace Clusters { namespace DeviceEnergyManagement { -Instance::Instance(EndpointId aEndpointId, Delegate & aDelegate) : - AttributeAccessInterface(MakeOptional(aEndpointId), Id), CommandHandlerInterface(MakeOptional(aEndpointId), Id), - mDelegate(aDelegate), mEndpointId(aEndpointId) -{ - /* set the base class delegates endpointId */ - mDelegate.SetEndpointId(aEndpointId); -} - -Instance::~Instance() -{ - Shutdown(); -} - CHIP_ERROR Instance::Init() { - registerAttributeAccessOverride(this); - InteractionModelEngine::GetInstance()->RegisterCommandHandler(this); + ReturnErrorOnFailure(InteractionModelEngine::GetInstance()->RegisterCommandHandler(this)); + VerifyOrReturnError(registerAttributeAccessOverride(this), CHIP_ERROR_INCORRECT_STATE); + return CHIP_NO_ERROR; } void Instance::Shutdown() { - unregisterAttributeAccessOverride(this); InteractionModelEngine::GetInstance()->UnregisterCommandHandler(this); + unregisterAttributeAccessOverride(this); } bool Instance::HasFeature(Feature aFeature) const @@ -81,8 +69,18 @@ CHIP_ERROR Instance::Read(const ConcreteReadAttributePath & aPath, AttributeValu case AbsMaxPower::Id: return aEncoder.Encode(mDelegate.GetAbsMaxPower()); case PowerAdjustmentCapability::Id: + /* PA - PowerAdjustment */ + if (!HasFeature(Feature::kPowerAdjustment)) + { + return CHIP_IM_GLOBAL_STATUS(UnsupportedAttribute); + } return aEncoder.Encode(mDelegate.GetPowerAdjustmentCapability()); case Forecast::Id: + /* PFR | SFR - Power Forecast Reporting or State Forecast Reporting */ + if (!HasFeature(Feature::kPowerForecastReporting) && !HasFeature(Feature::kStateForecastReporting)) + { + return CHIP_IM_GLOBAL_STATUS(UnsupportedAttribute); + } return aEncoder.Encode(mDelegate.GetForecast()); } @@ -100,19 +98,34 @@ CHIP_ERROR Instance::EnumerateAcceptedCommands(const ConcreteClusterPath & clust { using namespace Commands; - for (auto && id : { - PowerAdjustRequest::Id, - CancelPowerAdjustRequest::Id, - StartTimeAdjustRequest::Id, - PauseRequest::Id, - ResumeRequest::Id, - ModifyForecastRequest::Id, - RequestConstraintBasedForecast::Id, - }) + if (HasFeature(Feature::kPowerAdjustment)) { - if (callback(id, context) == Loop::Break) + for (auto && id : { + PowerAdjustRequest::Id, + CancelPowerAdjustRequest::Id, + }) { - return CHIP_NO_ERROR; + if (callback(id, context) == Loop::Break) + { + return CHIP_NO_ERROR; + } + } + } + + if (HasFeature(Feature::kForecastAdjustment)) + { + for (auto && id : { + StartTimeAdjustRequest::Id, + PauseRequest::Id, + ResumeRequest::Id, + ModifyForecastRequest::Id, + RequestConstraintBasedForecast::Id, + }) + { + if (callback(id, context) == Loop::Break) + { + return CHIP_NO_ERROR; + } } } @@ -126,36 +139,86 @@ void Instance::InvokeCommand(HandlerContext & handlerContext) switch (handlerContext.mRequestPath.mCommandId) { case PowerAdjustRequest::Id: - HandleCommand( - handlerContext, [this](HandlerContext & ctx, const auto & commandData) { HandlePowerAdjustRequest(ctx, commandData); }); + if (!HasFeature(Feature::kPowerAdjustment)) + { + handlerContext.mCommandHandler.AddStatus(handlerContext.mRequestPath, Status::UnsupportedCommand); + } + else + { + HandleCommand( + handlerContext, + [this](HandlerContext & ctx, const auto & commandData) { HandlePowerAdjustRequest(ctx, commandData); }); + } return; case CancelPowerAdjustRequest::Id: - HandleCommand( - handlerContext, - [this](HandlerContext & ctx, const auto & commandData) { HandleCancelPowerAdjustRequest(ctx, commandData); }); + if (!HasFeature(Feature::kPowerAdjustment)) + { + handlerContext.mCommandHandler.AddStatus(handlerContext.mRequestPath, Status::UnsupportedCommand); + } + else + { + HandleCommand( + handlerContext, + [this](HandlerContext & ctx, const auto & commandData) { HandleCancelPowerAdjustRequest(ctx, commandData); }); + } return; case StartTimeAdjustRequest::Id: - HandleCommand( - handlerContext, - [this](HandlerContext & ctx, const auto & commandData) { HandleStartTimeAdjustRequest(ctx, commandData); }); + if (HasFeature(Feature::kForecastAdjustment)) + { + handlerContext.mCommandHandler.AddStatus(handlerContext.mRequestPath, Status::UnsupportedCommand); + } + else + { + HandleCommand( + handlerContext, + [this](HandlerContext & ctx, const auto & commandData) { HandleStartTimeAdjustRequest(ctx, commandData); }); + } return; case PauseRequest::Id: - HandleCommand( - handlerContext, [this](HandlerContext & ctx, const auto & commandData) { HandlePauseRequest(ctx, commandData); }); + if (HasFeature(Feature::kForecastAdjustment)) + { + handlerContext.mCommandHandler.AddStatus(handlerContext.mRequestPath, Status::UnsupportedCommand); + } + else + { + HandleCommand( + handlerContext, [this](HandlerContext & ctx, const auto & commandData) { HandlePauseRequest(ctx, commandData); }); + } return; case ResumeRequest::Id: - HandleCommand( - handlerContext, [this](HandlerContext & ctx, const auto & commandData) { HandleResumeRequest(ctx, commandData); }); + if (HasFeature(Feature::kForecastAdjustment)) + { + handlerContext.mCommandHandler.AddStatus(handlerContext.mRequestPath, Status::UnsupportedCommand); + } + else + { + HandleCommand( + handlerContext, [this](HandlerContext & ctx, const auto & commandData) { HandleResumeRequest(ctx, commandData); }); + } return; case ModifyForecastRequest::Id: - HandleCommand(handlerContext, [this](HandlerContext & ctx, const auto & commandData) { - HandleModifyForecastRequest(ctx, commandData); - }); + if (HasFeature(Feature::kForecastAdjustment)) + { + handlerContext.mCommandHandler.AddStatus(handlerContext.mRequestPath, Status::UnsupportedCommand); + } + else + { + HandleCommand( + handlerContext, + [this](HandlerContext & ctx, const auto & commandData) { HandleModifyForecastRequest(ctx, commandData); }); + } return; case RequestConstraintBasedForecast::Id: - HandleCommand( - handlerContext, - [this](HandlerContext & ctx, const auto & commandData) { HandleRequestConstraintBasedForecast(ctx, commandData); }); + if (HasFeature(Feature::kForecastAdjustment)) + { + handlerContext.mCommandHandler.AddStatus(handlerContext.mRequestPath, Status::UnsupportedCommand); + } + else + { + HandleCommand( + handlerContext, + [this](HandlerContext & ctx, const auto & commandData) { HandleRequestConstraintBasedForecast(ctx, commandData); }); + } return; } } @@ -171,17 +234,18 @@ void Instance::HandlePowerAdjustRequest(HandlerContext & ctx, const Commands::Po if (powerAdjustmentCapability.IsNull()) { - ChipLogProgress(Zcl, "zzzzzzzzzzDEM: %s powerAdjustmentCapability IsNull", __FUNCTION__); + ChipLogProgress(Zcl, "DEM: %s powerAdjustmentCapability IsNull", __FUNCTION__); ctx.mCommandHandler.AddStatus(ctx.mRequestPath, Status::ConstraintError); return; } + /* PowerAdjustmentCapability is a list - so iterate through checking if the command is within one of the offers */ for (auto pas : powerAdjustmentCapability.Value()) { if ((power >= pas.minPower) && (durationSec >= pas.minDuration) && (power <= pas.maxPower) && (durationSec <= pas.maxDuration)) { - ChipLogProgress(Zcl, "zzzzzzzzzzDEM: %s Good PowerAdjustment args", __FUNCTION__); + ChipLogProgress(Zcl, "DEM: %s Good PowerAdjustment args", __FUNCTION__); validArgs = true; break; } @@ -189,24 +253,20 @@ void Instance::HandlePowerAdjustRequest(HandlerContext & ctx, const Commands::Po if (!validArgs) { - ChipLogProgress(Zcl, "zzzzzzzzzzDEM: %s invalid request range", __FUNCTION__); - // TODO: raise event ? + ChipLogProgress(Zcl, "DEM: %s invalid request range", __FUNCTION__); ctx.mCommandHandler.AddStatus(ctx.mRequestPath, Status::ConstraintError); return; } - ChipLogProgress(Zcl, "zzzzzzzzzzDEM: %s Good PowerAdjustRequest() args.", __FUNCTION__); + ChipLogProgress(Zcl, "DEM: %s Good PowerAdjustRequest() args.", __FUNCTION__); - // TODO: Generate a PowerAdjustStart Event, then begins to adjust its power. How is this done, Async? - // When done, raise PowerAdjustEnd & ESAState set to kOnline. + /* Call the delegate to do the power adjustment */ status = mDelegate.PowerAdjustRequest(power, durationSec); ctx.mCommandHandler.AddStatus(ctx.mRequestPath, status); if (status != Status::Success) { - ChipLogProgress(Zcl, "zzzzzzzzzzDEM: %s Failed to PowerAdjustRequest() args.", __FUNCTION__); + ChipLogProgress(Zcl, "DEM: %s Failed to PowerAdjustRequest() args.", __FUNCTION__); } - - ChipLogProgress(Zcl, "zzzzzzzzzzDEM: %s Partly implemented", __FUNCTION__); return; } @@ -216,124 +276,130 @@ void Instance::HandleCancelPowerAdjustRequest(HandlerContext & ctx, Status status = Status::Success; ESAStateEnum esaStatus; + /* Check that the ESA state is PowerAdjustActive */ esaStatus = mDelegate.GetESAState(); - if (ESAStateEnum::kPowerAdjustActive != esaStatus) { - ChipLogProgress(Zcl, "zzzzzzzzzzDEM: %s - kPowerAdjustActive != esaStatus", __FUNCTION__); + ChipLogProgress(Zcl, "DEM: %s - kPowerAdjustActive != esaStatus", __FUNCTION__); ctx.mCommandHandler.AddStatus(ctx.mRequestPath, Status::Failure); return; } - /* TODO: If the command is accepted, the ESA SHALL generate an PowerAdjustEnd Event. */ - - ChipLogProgress(Zcl, "zzzzzzzzzzDEM: %s Good CancelPowerAdjustRequest() args.", __FUNCTION__); + /* Call the delegate to cancel the power adjustment */ status = mDelegate.CancelPowerAdjustRequest(); ctx.mCommandHandler.AddStatus(ctx.mRequestPath, status); if (status != Status::Success) { - ChipLogProgress(Zcl, "zzzzzzzzzzDEM: %s Failed to PowerAdjustRequest() args.", __FUNCTION__); + ChipLogProgress(Zcl, "DEM: %s Failed to CancelPowerAdjustRequest()", __FUNCTION__); return; } - ctx.mCommandHandler.AddStatus(ctx.mRequestPath, status); - ChipLogProgress(Zcl, "zzzzzzzzzzDEM: %s partly implemented", __FUNCTION__); return; } void Instance::HandleStartTimeAdjustRequest(HandlerContext & ctx, const Commands::StartTimeAdjustRequest::DecodableType & commandData) { - Status status = Status::Success; - uint32_t earliestStartTime = 0; - uint32_t latestEndTime = 0; - Structs::ForecastStruct::Type forecast = mDelegate.GetForecast(); - uint32_t duration = forecast.endTime - forecast.startTime; // the current entire forecast duration - uint32_t requestedStartTime = commandData.requestedStartTime; - - if (!HasFeature(Feature::kForecastAdjustment)) + Status status = Status::Success; + uint32_t earliestStartTime = 0; + uint32_t latestEndTime = 0; + DataModel::Nullable forecast = mDelegate.GetForecast(); + + uint32_t duration; + uint32_t requestedStartTime = commandData.requestedStartTime; + + if (forecast.IsNull()) { - ChipLogProgress(Zcl, "zzzzzzzzzzDEM: %s Feature kForecastAdjustment not enabled", __FUNCTION__); - ctx.mCommandHandler.AddStatus(ctx.mRequestPath, Status::UnsupportedCommand); + ChipLogProgress(Zcl, "DEM: %s - Forecast is Null", __FUNCTION__); + ctx.mCommandHandler.AddStatus(ctx.mRequestPath, Status::Failure); return; } if (ESAStateEnum::kUserOptOut == mDelegate.GetESAState()) { - ChipLogProgress(Zcl, "zzzzzzzzzzDEM: %s - ESAState = kUserOptOut", __FUNCTION__); + ChipLogProgress(Zcl, "DEM: %s - ESAState = kUserOptOut", __FUNCTION__); ctx.mCommandHandler.AddStatus(ctx.mRequestPath, Status::Failure); return; } - /* If the RequestedStartTime value resulted in a time shift which is outside the time constraints of EarliestStartTime and - LatestEndTime, then the command SHALL be rejected with CONSTRAINT_ERROR; otherwise the command SHALL be rejected with FAILURE - */ - if (forecast.earliestStartTime.HasValue() && !forecast.earliestStartTime.Value().IsNull()) + /* If the RequestedStartTime value resulted in a time shift which is + * outside the time constraints of EarliestStartTime and + * LatestEndTime, then the command SHALL be rejected with CONSTRAINT_ERROR; + * otherwise the command SHALL be rejected with FAILURE + */ + /* earliestStartTime is optional based on the FA (ForecastAdjust) feature AND can be nullable */ + if (forecast.Value().earliestStartTime.HasValue() || forecast.Value().latestEndTime.HasValue()) { - earliestStartTime = forecast.earliestStartTime.Value().Value(); + /* These Should not be NULL since this command requires FA feature and these are mandatory for that */ + ChipLogProgress(Zcl, "DEM: %s - EarliestStartTime / LatestEndTime not valid", __FUNCTION__); + ctx.mCommandHandler.AddStatus(ctx.mRequestPath, Status::Failure); + return; } - else + + chip::System::Clock::Milliseconds64 cTMs; + auto chipError = chip::System::SystemClock().GetClock_RealTimeMS(cTMs); + if (chipError != CHIP_NO_ERROR) { - ChipLogProgress(Zcl, "zzzzzzzzzzDEM: %s - NullOptional earliestStartTime.", __FUNCTION__); + ChipLogError(Zcl, "DEM: Unable to get current time - error=%d (%s)]", chipError.AsInteger(), chipError.AsString()); ctx.mCommandHandler.AddStatus(ctx.mRequestPath, Status::Failure); return; } + uint32_t epochNow = std::chrono::duration_cast(cTMs).count(); - if (forecast.latestEndTime.HasValue()) + if (forecast.Value().earliestStartTime.Value().IsNull()) { - latestEndTime = forecast.latestEndTime.Value(); + /* Null means - We can start immediately */ + earliestStartTime = epochNow; /* NOW */ } else { - ChipLogProgress(Zcl, "zzzzzzzzzzDEM: %s - NullOptional latestEndTime.", __FUNCTION__); - ctx.mCommandHandler.AddStatus(ctx.mRequestPath, Status::Failure); - return; + earliestStartTime = forecast.Value().earliestStartTime.Value().Value(); } + /* Latest End Time is optional & cannot be null - unlike earliestStartTime! */ + latestEndTime = forecast.Value().latestEndTime.Value(); + + duration = forecast.Value().endTime - forecast.Value().startTime; // the current entire forecast duration if ((requestedStartTime < earliestStartTime) || ((requestedStartTime + duration) > latestEndTime)) { - ChipLogProgress(Zcl, "zzzzzzzzzzDEM: %s - Bad requestedStartTime %d.", __FUNCTION__, requestedStartTime); + ChipLogProgress(Zcl, "DEM: %s - Bad requestedStartTime %d.", __FUNCTION__, requestedStartTime); ctx.mCommandHandler.AddStatus(ctx.mRequestPath, Status::ConstraintError); return; } else { - ChipLogProgress(Zcl, "zzzzzzzzzzDEM: %s - Good requestedStartTime %d.", __FUNCTION__, requestedStartTime); + ChipLogProgress(Zcl, "DEM: %s - Good requestedStartTime %d.", __FUNCTION__, requestedStartTime); status = mDelegate.StartTimeAdjustRequest(requestedStartTime); ctx.mCommandHandler.AddStatus(ctx.mRequestPath, status); if (status != Status::Success) { - ChipLogProgress(Zcl, "zzzzzzzzzzDEM: %s - StartTimeAdjustRequest(%d) FAILURE", __FUNCTION__, requestedStartTime); + ChipLogProgress(Zcl, "DEM: %s - StartTimeAdjustRequest(%d) FAILURE", __FUNCTION__, requestedStartTime); return; } - - forecast.startTime = requestedStartTime; - forecast.endTime = requestedStartTime + duration; - mDelegate.SetForecast(forecast); } - ChipLogProgress(Zcl, "zzzzzzzzzzDEM: %s Partially implemented", __FUNCTION__); return; } void Instance::HandlePauseRequest(HandlerContext & ctx, const Commands::PauseRequest::DecodableType & commandData) { - Status status = Status::Success; - CHIP_ERROR err = CHIP_NO_ERROR; - Structs::ForecastStruct::Type forecast = mDelegate.GetForecast(); - uint32_t duration = commandData.duration; + Status status = Status::Success; + CHIP_ERROR err = CHIP_NO_ERROR; + DataModel::Nullable forecast = mDelegate.GetForecast(); - if (!HasFeature(Feature::kForecastAdjustment)) + uint32_t duration = commandData.duration; + + if (forecast.IsNull()) { - ChipLogProgress(Zcl, "zzzzzzzzzzDEM: %s Feature kForecastAdjustment not enabled", __FUNCTION__); - ctx.mCommandHandler.AddStatus(ctx.mRequestPath, Status::UnsupportedCommand); + ChipLogProgress(Zcl, "DEM: %s - Forecast is Null", __FUNCTION__); + ctx.mCommandHandler.AddStatus(ctx.mRequestPath, Status::Failure); return; } if (ESAStateEnum::kUserOptOut == mDelegate.GetESAState()) { - ChipLogProgress(Zcl, "zzzzzzzzzzDEM: %s - ESAState = kUserOptOut", __FUNCTION__); + ChipLogProgress(Zcl, "DEM: %s - ESAState = kUserOptOut", __FUNCTION__); ctx.mCommandHandler.AddStatus(ctx.mRequestPath, Status::Failure); return; } @@ -342,33 +408,33 @@ void Instance::HandlePauseRequest(HandlerContext & ctx, const Commands::PauseReq ActiveSlotNumber index in the Slots list in the Forecast. */ uint16_t activeSlotNumber; - if (forecast.activeSlotNumber.IsNull()) + if (forecast.Value().activeSlotNumber.IsNull()) { - ChipLogProgress(Zcl, "zzzzzzzzzzDEM: %s - activeSlotNumber Is Null", __FUNCTION__); + ChipLogProgress(Zcl, "DEM: %s - activeSlotNumber Is Null", __FUNCTION__); ctx.mCommandHandler.AddStatus(ctx.mRequestPath, Status::Failure); return; } - activeSlotNumber = forecast.activeSlotNumber.Value(); - if (activeSlotNumber >= forecast.slots.size()) + activeSlotNumber = forecast.Value().activeSlotNumber.Value(); + if (activeSlotNumber >= forecast.Value().slots.size()) { - ChipLogProgress(Zcl, "zzzzzzzzzzDEM: %s - Bad activeSlotNumber %d , size()=%d.", __FUNCTION__, activeSlotNumber, - static_cast(forecast.slots.size())); + ChipLogProgress(Zcl, "DEM: %s - Bad activeSlotNumber %d , size()=%d.", __FUNCTION__, activeSlotNumber, + static_cast(forecast.Value().slots.size())); ctx.mCommandHandler.AddStatus(ctx.mRequestPath, Status::Failure); return; } - if (!forecast.slots[activeSlotNumber].slotIsPauseable) + if (!forecast.Value().slots[activeSlotNumber].slotIsPauseable) { - ChipLogProgress(Zcl, "zzzzzzzzzzDEM: %s - activeSlotNumber %d Is not pausible.", __FUNCTION__, activeSlotNumber); + ChipLogProgress(Zcl, "DEM: %s - activeSlotNumber %d is NOT pausible.", __FUNCTION__, activeSlotNumber); ctx.mCommandHandler.AddStatus(ctx.mRequestPath, Status::ConstraintError); return; } - if ((duration < forecast.slots[activeSlotNumber].minPauseDuration) && - (duration > forecast.slots[activeSlotNumber].maxPauseDuration)) + if ((duration < forecast.Value().slots[activeSlotNumber].minPauseDuration) && + (duration > forecast.Value().slots[activeSlotNumber].maxPauseDuration)) { - ChipLogProgress(Zcl, "zzzzzzzzzzDEM: %s - out of range pause duration %d", __FUNCTION__, duration); + ChipLogProgress(Zcl, "DEM: %s - out of range pause duration %d", __FUNCTION__, duration); ctx.mCommandHandler.AddStatus(ctx.mRequestPath, Status::ConstraintError); return; } @@ -376,16 +442,17 @@ void Instance::HandlePauseRequest(HandlerContext & ctx, const Commands::PauseReq err = mDelegate.SetESAState(ESAStateEnum::kPaused); if (CHIP_NO_ERROR != err) { - ChipLogProgress(Zcl, "zzzzzzzzzzDEM: %s - SetESAState(paused) FAILURE", __FUNCTION__); + ChipLogProgress(Zcl, "DEM: %s - SetESAState(paused) FAILURE", __FUNCTION__); ctx.mCommandHandler.AddStatus(ctx.mRequestPath, Status::Failure); return; } + /* Finally - we can call the delegate to ask for a pause */ status = mDelegate.PauseRequest(duration); ctx.mCommandHandler.AddStatus(ctx.mRequestPath, Status::Failure); if (status != Status::Success) { - ChipLogProgress(Zcl, "zzzzzzzzzzDEM: %s - mDelegate.PauseRequest(%d) FAILURE", __FUNCTION__, duration); + ChipLogProgress(Zcl, "DEM: %s - mDelegate.PauseRequest(%d) FAILURE", __FUNCTION__, duration); return; } @@ -394,48 +461,62 @@ void Instance::HandlePauseRequest(HandlerContext & ctx, const Commands::PauseReq void Instance::HandleResumeRequest(HandlerContext & ctx, const Commands::ResumeRequest::DecodableType & commandData) { - Status status = Status::Success; - Structs::ForecastStruct::Type forecast = mDelegate.GetForecast(); + Status status = Status::Success; - if (!HasFeature(Feature::kForecastAdjustment)) - { - ChipLogProgress(Zcl, "zzzzzzzzzzDEM: %s Feature kForecastAdjustment not enabled", __FUNCTION__); - ctx.mCommandHandler.AddStatus(ctx.mRequestPath, Status::UnsupportedCommand); - return; - } + DataModel::Nullable forecast = mDelegate.GetForecast(); if (ESAStateEnum::kPaused != mDelegate.GetESAState()) { - ChipLogProgress(Zcl, "zzzzzzzzzzDEM: %s - ESAState not Paused.", __FUNCTION__); + ChipLogProgress(Zcl, "DEM: %s - ESAState not Paused.", __FUNCTION__); ctx.mCommandHandler.AddStatus(ctx.mRequestPath, Status::Failure); return; } + /* Call the delegate to resume */ status = mDelegate.ResumeRequest(); ctx.mCommandHandler.AddStatus(ctx.mRequestPath, Status::Failure); if (status != Status::Success) { - ChipLogProgress(Zcl, "zzzzzzzzzzDEM: %s - mDelegate.ResumeRequest() FAILURE", __FUNCTION__); + ChipLogProgress(Zcl, "DEM: %s - mDelegate.ResumeRequest() FAILURE", __FUNCTION__); return; } - // TODO: The ESA SHALL also generate a Resumed Event and the ESAState SHALL be updated accordingly to reflect its current state. - ChipLogProgress(Zcl, "DEM: %s not fully implemented", __FUNCTION__); return; } void Instance::HandleModifyForecastRequest(HandlerContext & ctx, const Commands::ModifyForecastRequest::DecodableType & commandData) -{} +{ + Status status = Status::UnsupportedCommand; // TODO Status::Success; + // CHIP_ERROR err = CHIP_NO_ERROR; + + DataModel::Nullable forecast = mDelegate.GetForecast(); + + if (forecast.IsNull()) + { + ChipLogProgress(Zcl, "DEM: %s - Forecast is Null", __FUNCTION__); + ctx.mCommandHandler.AddStatus(ctx.mRequestPath, Status::Failure); + return; + } + + // TODO update the forecast details + ctx.mCommandHandler.AddStatus(ctx.mRequestPath, status); + return; +} void Instance::HandleRequestConstraintBasedForecast(HandlerContext & ctx, const Commands::RequestConstraintBasedForecast::DecodableType & commandData) -{} +{ + Status status = Status::UnsupportedCommand; // TODO Status::Success; + + // TODO pass this up to the delegate if it supports it + ChipLogProgress(Zcl, "DEM: %s - Handle Constraint based forecast ", __FUNCTION__); + ctx.mCommandHandler.AddStatus(ctx.mRequestPath, status); + return; +} } // namespace DeviceEnergyManagement } // namespace Clusters } // namespace app } // namespace chip -void emberAfDeviceEnergyManagementClusterServerInitCallback(chip::EndpointId endpoint) {} - void MatterDeviceEnergyManagementPluginServerInitCallback() {} diff --git a/src/app/clusters/device-energy-management-server/device-energy-management-server.h b/src/app/clusters/device-energy-management-server/device-energy-management-server.h index e182fd6d79765d..37e23a720172ca 100644 --- a/src/app/clusters/device-energy-management-server/device-energy-management-server.h +++ b/src/app/clusters/device-energy-management-server/device-energy-management-server.h @@ -17,6 +17,7 @@ */ #pragma once + #include #include #include @@ -32,9 +33,6 @@ namespace app { namespace Clusters { namespace DeviceEnergyManagement { -// TODO: Spec-defined constraints ? -constexpr int64_t kMinimumChargeCurrent = 0; - using chip::Protocols::InteractionModel::Status; /** @brief Defines methods for implementing application-specific logic for this Cluster. @@ -143,7 +141,7 @@ class Delegate virtual int64_t GetAbsMinPower() = 0; virtual int64_t GetAbsMaxPower() = 0; virtual Attributes::PowerAdjustmentCapability::TypeInfo::Type GetPowerAdjustmentCapability() = 0; - virtual Structs::ForecastStruct::Type GetForecast() = 0; + virtual DataModel::Nullable GetForecast() = 0; // ------------------------------------------------------------------ // Set attribute methods @@ -153,7 +151,7 @@ class Delegate virtual CHIP_ERROR SetAbsMinPower(int64_t) = 0; virtual CHIP_ERROR SetAbsMaxPower(int64_t) = 0; virtual CHIP_ERROR SetPowerAdjustmentCapability(Attributes::PowerAdjustmentCapability::TypeInfo::Type &) = 0; - virtual CHIP_ERROR SetForecast(Structs::ForecastStruct::Type &) = 0; + virtual CHIP_ERROR SetForecast(DataModel::Nullable &) = 0; protected: EndpointId mEndpointId = 0; @@ -162,8 +160,15 @@ class Delegate class Instance : public AttributeAccessInterface, public CommandHandlerInterface { public: - Instance(EndpointId aEndpointId, Delegate & aDelegate); - ~Instance(); + Instance(EndpointId aEndpointId, Delegate & aDelegate, Feature aFeature) : + AttributeAccessInterface(MakeOptional(aEndpointId), Id), CommandHandlerInterface(MakeOptional(aEndpointId), Id), + mDelegate(aDelegate), mFeature(aFeature) + { + /* set the base class delegates endpointId */ + mDelegate.SetEndpointId(aEndpointId); + } + + ~Instance() { Shutdown(); } CHIP_ERROR Init(); void Shutdown(); @@ -172,7 +177,6 @@ class Instance : public AttributeAccessInterface, public CommandHandlerInterface private: Delegate & mDelegate; - EndpointId mEndpointId; BitMask mFeature; // AttributeAccessInterface From 8582412bf8cbf772e87821228bef0ecece13ae7d Mon Sep 17 00:00:00 2001 From: James Harrow Date: Tue, 12 Dec 2023 22:14:07 +0000 Subject: [PATCH 010/114] Added delegate class to all-clusters-app --- .../DeviceEnergyManagementDelegateImpl.h | 92 +++++++ .../DeviceEnergyManagementDelegateImpl.cpp | 250 ++++++++++++++++++ 2 files changed, 342 insertions(+) create mode 100644 examples/all-clusters-app/all-clusters-common/include/DeviceEnergyManagementDelegateImpl.h create mode 100644 examples/all-clusters-app/all-clusters-common/src/DeviceEnergyManagementDelegateImpl.cpp diff --git a/examples/all-clusters-app/all-clusters-common/include/DeviceEnergyManagementDelegateImpl.h b/examples/all-clusters-app/all-clusters-common/include/DeviceEnergyManagementDelegateImpl.h new file mode 100644 index 00000000000000..4f30c4e808d2db --- /dev/null +++ b/examples/all-clusters-app/all-clusters-common/include/DeviceEnergyManagementDelegateImpl.h @@ -0,0 +1,92 @@ +/* + * + * Copyright (c) 2023 Project CHIP Authors + * All rights reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#pragma once + +#include "app/clusters/device-energy-management-server/device-energy-management-server.h" + +#include +#include +#include +#include +#include +#include +#include +#include +#include + +using chip::Protocols::InteractionModel::Status; + +namespace chip { +namespace app { +namespace Clusters { +namespace DeviceEnergyManagement { + +/** The application delegate. + */ +class DeviceEnergyManagementDelegate : public Delegate +{ +public: + DeviceEnergyManagementDelegate(); + virtual ~DeviceEnergyManagementDelegate() = default; + + virtual Status PowerAdjustRequest(const int64_t power, const uint32_t duration) override; + virtual Status CancelPowerAdjustRequest() override; + virtual Status StartTimeAdjustRequest(const uint32_t requestedStartTime) override; + virtual Status PauseRequest(const uint32_t duration) override; + virtual Status ResumeRequest() override; + virtual Status + ModifyForecastRequest(const uint32_t forecastId, + const DataModel::DecodableList & slotAdjustments) override; + virtual Status RequestConstraintBasedForecast( + const DataModel::DecodableList & constraints) override; + + // ------------------------------------------------------------------ + // Get attribute methods + virtual ESATypeEnum GetESAType() override; + virtual bool GetESACanGenerate() override; + virtual ESAStateEnum GetESAState() override; + virtual int64_t GetAbsMinPower() override; + virtual int64_t GetAbsMaxPower() override; + virtual DataModel::Nullable GetPowerAdjustmentCapability() override; + virtual DataModel::Nullable GetForecast() override; + + // ------------------------------------------------------------------ + // Set attribute methods + virtual CHIP_ERROR SetESAType(ESATypeEnum) override; + virtual CHIP_ERROR SetESACanGenerate(bool) override; + virtual CHIP_ERROR SetESAState(ESAStateEnum) override; + virtual CHIP_ERROR SetAbsMinPower(int64_t) override; + virtual CHIP_ERROR SetAbsMaxPower(int64_t) override; + virtual CHIP_ERROR SetPowerAdjustmentCapability(Attributes::PowerAdjustmentCapability::TypeInfo::Type &) override; + virtual CHIP_ERROR SetForecast(Structs::ForecastStruct::Type &) override; + +private: + ESATypeEnum mEsaType; + bool mEsaCanGenerate; + ESAStateEnum mEsaState; + int64_t mAbsMinPower; + int64_t mAbsMaxPower; + DataModel::Nullable mPowerAdjustmentCapability; + DataModel::Nullable mForecast; +}; + +} // namespace DeviceEnergyManagement +} // namespace Clusters +} // namespace app +} // namespace chip diff --git a/examples/all-clusters-app/all-clusters-common/src/DeviceEnergyManagementDelegateImpl.cpp b/examples/all-clusters-app/all-clusters-common/src/DeviceEnergyManagementDelegateImpl.cpp new file mode 100644 index 00000000000000..b71da7508c9e39 --- /dev/null +++ b/examples/all-clusters-app/all-clusters-common/src/DeviceEnergyManagementDelegateImpl.cpp @@ -0,0 +1,250 @@ +/* + * + * Copyright (c) 2023 Project CHIP Authors + * All rights reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#include "DeviceEnergyManagementDelegateImpl.h" +// #include +// #include +// #include + +using namespace chip::app::Clusters::DeviceEnergyManagement; +using namespace chip::app::Clusters::DeviceEnergyManagement::Attributes; + +using chip::Optional; +using namespace chip::app; +using CostsList = DataModel::List; + +Status DeviceEnergyManagementDelegate::PowerAdjustRequest(const int64_t power, const uint32_t duration) +{ + Status status = Status::UnsupportedCommand; // Status::Success; + + // TODO: implement + mEsaState = ESAStateEnum::kPowerAdjustActive; + + // TODO: Generate a PowerAdjustStart Event, then begins to adjust its power + // When done, raise PowerAdjustEnd & ESAState set to kOnline. + + MatterReportingAttributeChangeCallback(mEndpointId, DeviceEnergyManagement::Id, ESAState::Id); + + return status; +} + +Status DeviceEnergyManagementDelegate::CancelPowerAdjustRequest() +{ + Status status = Status::UnsupportedCommand; // Status::Success; + + // TODO: implement + /* TODO: If the command is accepted, the ESA SHALL generate an PowerAdjustEnd Event. */ + mEsaState = ESAStateEnum::kOnline; + MatterReportingAttributeChangeCallback(mEndpointId, DeviceEnergyManagement::Id, ESAState::Id); + + return status; +} + +Status DeviceEnergyManagementDelegate::StartTimeAdjustRequest(const uint32_t requestedStartTime) +{ + Status status = Status::UnsupportedCommand; // Status::Success; + + // TODO: implement + DataModel::Nullable forecast = mDelegate.GetForecast(); + + if (!forecast.IsNull()) + { + uint32_t duration = forecast.endTime - forecast.startTime; // the current entire forecast duration + + /* Modify start time and end time */ + forecast.startTime = requestedStartTime; + forecast.endTime = requestedStartTime + duration; + + mDelegate.SetForecast(forecast); + } + return status; +} + +Status DeviceEnergyManagementDelegate::PauseRequest(const uint32_t duration) +{ + Status status = Status::UnsupportedCommand; // Status::Success; + // TODO: implement + return status; +} + +Status DeviceEnergyManagementDelegate::ResumeRequest() +{ + Status status = Status::UnsupportedCommand; // Status::Success; + // TODO: implement + mEsaState = ESAStateEnum::kOnline; + MatterReportingAttributeChangeCallback(mEndpointId, DeviceEnergyManagement::Id, ESAState::Id); + + return status; +} + +Status DeviceEnergyManagementDelegate::ModifyForecastRequest( + const uint32_t forecastId, const DataModel::DecodableList & slotAdjustments) +{ + Status status = Status::UnsupportedCommand; // Status::Success; + // TODO: implement + return status; +} + +Status DeviceEnergyManagementDelegate::RequestConstraintBasedForecast( + const DataModel::DecodableList & constraints) +{ + Status status = Status::UnsupportedCommand; // Status::Success; + // TODO: implement + return status; +} + +// ------------------------------------------------------------------ +// Get attribute methods +ESATypeEnum DeviceEnergyManagementDelegate::GetESAType() +{ + return mEsaType; +} + +bool DeviceEnergyManagementDelegate::GetESACanGenerate() +{ + return mEsaCanGenerate; +} + +ESAStateEnum DeviceEnergyManagementDelegate::GetESAState() +{ + return mEsaState; +} + +int64_t DeviceEnergyManagementDelegate::GetAbsMinPower() +{ + return mAbsMinPower; +} + +int64_t DeviceEnergyManagementDelegate::GetAbsMaxPower() +{ + return mAbsMaxPower; +} + +Attributes::PowerAdjustmentCapability::TypeInfo::Type DeviceEnergyManagementDelegate::GetPowerAdjustmentCapability() +{ + return mPowerAdjustmentCapability; +} + +DataModel::Nullable DeviceEnergyManagementDelegate::GetForecast() +{ + return mForecast; +} + +// ------------------------------------------------------------------ +// Set attribute methods + +CHIP_ERROR DeviceEnergyManagementDelegate::SetESAType(ESATypeEnum newValue) +{ + ESATypeEnum oldValue = mEsaState; + + if (newValue >= ESATypeEnum::kUnknownEnumValue) + { + return CHIP_IM_GLOBAL_STATUS(ConstraintError); + } + + mEsaType = newValue; + if (oldValue != newValue) + { + ChipLogDetail(AppServer, "mEsaType updated to %d", (int) mEsaType); + MatterReportingAttributeChangeCallback(mEndpointId, DeviceEnergyManagement::Id, ESAType::Id); + } + + return CHIP_NO_ERROR; +} + +CHIP_ERROR DeviceEnergyManagementDelegate::SetESACanGenerate(bool newValue) +{ + bool oldValue = mEsaCanGenerate; + + mEsaCanGenerate = newValue; + if (oldValue != newValue) + { + ChipLogDetail(AppServer, "mEsaCanGenerate updated to %d", (int) mEsaCanGenerate); + MatterReportingAttributeChangeCallback(mEndpointId, DeviceEnergyManagement::Id, ESACanGenerate::Id); + } + + return CHIP_NO_ERROR; +} + +CHIP_ERROR DeviceEnergyManagementDelegate::SetESAState(ESAStateEnum newValue) +{ + ESAStateEnum oldValue = mEsaState; + + if (newValue >= ESAStateEnum::kUnknownEnumValue) + { + return CHIP_IM_GLOBAL_STATUS(ConstraintError); + } + + mEsaState = newValue; + if (oldValue != newValue) + { + ChipLogDetail(AppServer, "mEsaState updated to %d", (int) mEsaState); + MatterReportingAttributeChangeCallback(mEndpointId, DeviceEnergyManagement::Id, ESAState::Id); + } + + return CHIP_NO_ERROR; +} + +CHIP_ERROR DeviceEnergyManagementDelegate::SetAbsMinPower(int64_t newValue) +{ + int64_t oldValue = mAbsMinPower; + + mAbsMinPower = newValue; + if (oldValue != newValue) + { + ChipLogDetail(AppServer, "mAbsMinPower updated to %d", (int) mAbsMinPower); + MatterReportingAttributeChangeCallback(mEndpointId, DeviceEnergyManagement::Id, AbsMinPower::Id); + } + + return CHIP_NO_ERROR; +} + +CHIP_ERROR DeviceEnergyManagementDelegate::SetAbsMaxPower(int64_t newValue) +{ + int64_t oldValue = mAbsMaxPower; + + mAbsMaxPower = newValue; + if (oldValue != newValue) + { + ChipLogDetail(AppServer, "mAbsMaxPower updated to %d", (int) mAbsMaxPower); + MatterReportingAttributeChangeCallback(mEndpointId, DeviceEnergyManagement::Id, AbsMaxPower::Id); + } + + return CHIP_NO_ERROR; +} + +CHIP_ERROR DeviceEnergyManagementDelegate::SetPowerAdjustmentCapability( + Attributes::PowerAdjustmentCapability::TypeInfo::Type & powerAdjustmentCapability) +{ + // TODO copy the value + + MatterReportingAttributeChangeCallback(mEndpointId, DeviceEnergyManagement::Id, PowerAdjustmentCapability::Id); + return CHIP_NO_ERROR; +} + +CHIP_ERROR DeviceEnergyManagementDelegate::SetForecast(Structs::ForecastStruct::Type & forecast) +{ + mForecast = forecast; + mForecast.forecastId++; + + // TODO update the member variable structure + + MatterReportingAttributeChangeCallback(mEndpointId, DeviceEnergyManagement::Id, Forecast::Id); + + return CHIP_NO_ERROR; +} From c9ce2f73ebcf9fd0da6bbefc22967429bc3e0815 Mon Sep 17 00:00:00 2001 From: James Harrow Date: Wed, 13 Dec 2023 01:08:07 +0000 Subject: [PATCH 011/114] Changed ChipLogProgress to Error. Better handling of EnumerateCommands --- .../device-energy-management-server.cpp | 61 +++++++++---------- 1 file changed, 28 insertions(+), 33 deletions(-) diff --git a/src/app/clusters/device-energy-management-server/device-energy-management-server.cpp b/src/app/clusters/device-energy-management-server/device-energy-management-server.cpp index 4918a2f1013964..7ace836878cd6c 100644 --- a/src/app/clusters/device-energy-management-server/device-energy-management-server.cpp +++ b/src/app/clusters/device-energy-management-server/device-energy-management-server.cpp @@ -100,21 +100,18 @@ CHIP_ERROR Instance::EnumerateAcceptedCommands(const ConcreteClusterPath & clust if (HasFeature(Feature::kPowerAdjustment)) { - for (auto && id : { + for (auto && cmd : { PowerAdjustRequest::Id, CancelPowerAdjustRequest::Id, }) { - if (callback(id, context) == Loop::Break) - { - return CHIP_NO_ERROR; - } + VerifyOrExit(callback(cmd, context) == Loop::Continue, /**/); } } if (HasFeature(Feature::kForecastAdjustment)) { - for (auto && id : { + for (auto && cmd : { StartTimeAdjustRequest::Id, PauseRequest::Id, ResumeRequest::Id, @@ -122,13 +119,11 @@ CHIP_ERROR Instance::EnumerateAcceptedCommands(const ConcreteClusterPath & clust RequestConstraintBasedForecast::Id, }) { - if (callback(id, context) == Loop::Break) - { - return CHIP_NO_ERROR; - } + VerifyOrExit(callback(cmd, context) == Loop::Continue, /**/); } } +exit: return CHIP_NO_ERROR; } @@ -234,7 +229,7 @@ void Instance::HandlePowerAdjustRequest(HandlerContext & ctx, const Commands::Po if (powerAdjustmentCapability.IsNull()) { - ChipLogProgress(Zcl, "DEM: %s powerAdjustmentCapability IsNull", __FUNCTION__); + ChipLogError(Zcl, "DEM: %s powerAdjustmentCapability IsNull", __FUNCTION__); ctx.mCommandHandler.AddStatus(ctx.mRequestPath, Status::ConstraintError); return; } @@ -253,7 +248,7 @@ void Instance::HandlePowerAdjustRequest(HandlerContext & ctx, const Commands::Po if (!validArgs) { - ChipLogProgress(Zcl, "DEM: %s invalid request range", __FUNCTION__); + ChipLogError(Zcl, "DEM: %s invalid request range", __FUNCTION__); ctx.mCommandHandler.AddStatus(ctx.mRequestPath, Status::ConstraintError); return; } @@ -265,7 +260,7 @@ void Instance::HandlePowerAdjustRequest(HandlerContext & ctx, const Commands::Po ctx.mCommandHandler.AddStatus(ctx.mRequestPath, status); if (status != Status::Success) { - ChipLogProgress(Zcl, "DEM: %s Failed to PowerAdjustRequest() args.", __FUNCTION__); + ChipLogError(Zcl, "DEM: %s Failed to PowerAdjustRequest() args.", __FUNCTION__); } return; } @@ -280,7 +275,7 @@ void Instance::HandleCancelPowerAdjustRequest(HandlerContext & ctx, esaStatus = mDelegate.GetESAState(); if (ESAStateEnum::kPowerAdjustActive != esaStatus) { - ChipLogProgress(Zcl, "DEM: %s - kPowerAdjustActive != esaStatus", __FUNCTION__); + ChipLogError(Zcl, "DEM: %s - kPowerAdjustActive != esaStatus", __FUNCTION__); ctx.mCommandHandler.AddStatus(ctx.mRequestPath, Status::Failure); return; } @@ -290,7 +285,7 @@ void Instance::HandleCancelPowerAdjustRequest(HandlerContext & ctx, ctx.mCommandHandler.AddStatus(ctx.mRequestPath, status); if (status != Status::Success) { - ChipLogProgress(Zcl, "DEM: %s Failed to CancelPowerAdjustRequest()", __FUNCTION__); + ChipLogError(Zcl, "DEM: %s Failed to CancelPowerAdjustRequest()", __FUNCTION__); return; } @@ -310,14 +305,14 @@ void Instance::HandleStartTimeAdjustRequest(HandlerContext & ctx, if (forecast.IsNull()) { - ChipLogProgress(Zcl, "DEM: %s - Forecast is Null", __FUNCTION__); + ChipLogError(Zcl, "DEM: %s - Forecast is Null", __FUNCTION__); ctx.mCommandHandler.AddStatus(ctx.mRequestPath, Status::Failure); return; } if (ESAStateEnum::kUserOptOut == mDelegate.GetESAState()) { - ChipLogProgress(Zcl, "DEM: %s - ESAState = kUserOptOut", __FUNCTION__); + ChipLogError(Zcl, "DEM: %s - ESAState = kUserOptOut", __FUNCTION__); ctx.mCommandHandler.AddStatus(ctx.mRequestPath, Status::Failure); return; } @@ -331,7 +326,7 @@ void Instance::HandleStartTimeAdjustRequest(HandlerContext & ctx, if (forecast.Value().earliestStartTime.HasValue() || forecast.Value().latestEndTime.HasValue()) { /* These Should not be NULL since this command requires FA feature and these are mandatory for that */ - ChipLogProgress(Zcl, "DEM: %s - EarliestStartTime / LatestEndTime not valid", __FUNCTION__); + ChipLogError(Zcl, "DEM: %s - EarliestStartTime / LatestEndTime not valid", __FUNCTION__); ctx.mCommandHandler.AddStatus(ctx.mRequestPath, Status::Failure); return; } @@ -362,7 +357,7 @@ void Instance::HandleStartTimeAdjustRequest(HandlerContext & ctx, if ((requestedStartTime < earliestStartTime) || ((requestedStartTime + duration) > latestEndTime)) { - ChipLogProgress(Zcl, "DEM: %s - Bad requestedStartTime %d.", __FUNCTION__, requestedStartTime); + ChipLogError(Zcl, "DEM: %s - Bad requestedStartTime %d.", __FUNCTION__, requestedStartTime); ctx.mCommandHandler.AddStatus(ctx.mRequestPath, Status::ConstraintError); return; } @@ -374,7 +369,7 @@ void Instance::HandleStartTimeAdjustRequest(HandlerContext & ctx, ctx.mCommandHandler.AddStatus(ctx.mRequestPath, status); if (status != Status::Success) { - ChipLogProgress(Zcl, "DEM: %s - StartTimeAdjustRequest(%d) FAILURE", __FUNCTION__, requestedStartTime); + ChipLogError(Zcl, "DEM: %s - StartTimeAdjustRequest(%d) FAILURE", __FUNCTION__, requestedStartTime); return; } } @@ -392,14 +387,14 @@ void Instance::HandlePauseRequest(HandlerContext & ctx, const Commands::PauseReq if (forecast.IsNull()) { - ChipLogProgress(Zcl, "DEM: %s - Forecast is Null", __FUNCTION__); + ChipLogError(Zcl, "DEM: %s - Forecast is Null", __FUNCTION__); ctx.mCommandHandler.AddStatus(ctx.mRequestPath, Status::Failure); return; } if (ESAStateEnum::kUserOptOut == mDelegate.GetESAState()) { - ChipLogProgress(Zcl, "DEM: %s - ESAState = kUserOptOut", __FUNCTION__); + ChipLogError(Zcl, "DEM: %s - ESAState = kUserOptOut", __FUNCTION__); ctx.mCommandHandler.AddStatus(ctx.mRequestPath, Status::Failure); return; } @@ -410,7 +405,7 @@ void Instance::HandlePauseRequest(HandlerContext & ctx, const Commands::PauseReq uint16_t activeSlotNumber; if (forecast.Value().activeSlotNumber.IsNull()) { - ChipLogProgress(Zcl, "DEM: %s - activeSlotNumber Is Null", __FUNCTION__); + ChipLogError(Zcl, "DEM: %s - activeSlotNumber Is Null", __FUNCTION__); ctx.mCommandHandler.AddStatus(ctx.mRequestPath, Status::Failure); return; } @@ -418,15 +413,15 @@ void Instance::HandlePauseRequest(HandlerContext & ctx, const Commands::PauseReq activeSlotNumber = forecast.Value().activeSlotNumber.Value(); if (activeSlotNumber >= forecast.Value().slots.size()) { - ChipLogProgress(Zcl, "DEM: %s - Bad activeSlotNumber %d , size()=%d.", __FUNCTION__, activeSlotNumber, - static_cast(forecast.Value().slots.size())); + ChipLogError(Zcl, "DEM: %s - Bad activeSlotNumber %d , size()=%d.", __FUNCTION__, activeSlotNumber, + static_cast(forecast.Value().slots.size())); ctx.mCommandHandler.AddStatus(ctx.mRequestPath, Status::Failure); return; } if (!forecast.Value().slots[activeSlotNumber].slotIsPauseable) { - ChipLogProgress(Zcl, "DEM: %s - activeSlotNumber %d is NOT pausible.", __FUNCTION__, activeSlotNumber); + ChipLogError(Zcl, "DEM: %s - activeSlotNumber %d is NOT pausible.", __FUNCTION__, activeSlotNumber); ctx.mCommandHandler.AddStatus(ctx.mRequestPath, Status::ConstraintError); return; } @@ -434,7 +429,7 @@ void Instance::HandlePauseRequest(HandlerContext & ctx, const Commands::PauseReq if ((duration < forecast.Value().slots[activeSlotNumber].minPauseDuration) && (duration > forecast.Value().slots[activeSlotNumber].maxPauseDuration)) { - ChipLogProgress(Zcl, "DEM: %s - out of range pause duration %d", __FUNCTION__, duration); + ChipLogError(Zcl, "DEM: %s - out of range pause duration %d", __FUNCTION__, duration); ctx.mCommandHandler.AddStatus(ctx.mRequestPath, Status::ConstraintError); return; } @@ -442,7 +437,7 @@ void Instance::HandlePauseRequest(HandlerContext & ctx, const Commands::PauseReq err = mDelegate.SetESAState(ESAStateEnum::kPaused); if (CHIP_NO_ERROR != err) { - ChipLogProgress(Zcl, "DEM: %s - SetESAState(paused) FAILURE", __FUNCTION__); + ChipLogError(Zcl, "DEM: %s - SetESAState(paused) FAILURE", __FUNCTION__); ctx.mCommandHandler.AddStatus(ctx.mRequestPath, Status::Failure); return; } @@ -452,7 +447,7 @@ void Instance::HandlePauseRequest(HandlerContext & ctx, const Commands::PauseReq ctx.mCommandHandler.AddStatus(ctx.mRequestPath, Status::Failure); if (status != Status::Success) { - ChipLogProgress(Zcl, "DEM: %s - mDelegate.PauseRequest(%d) FAILURE", __FUNCTION__, duration); + ChipLogError(Zcl, "DEM: %s - mDelegate.PauseRequest(%d) FAILURE", __FUNCTION__, duration); return; } @@ -467,7 +462,7 @@ void Instance::HandleResumeRequest(HandlerContext & ctx, const Commands::ResumeR if (ESAStateEnum::kPaused != mDelegate.GetESAState()) { - ChipLogProgress(Zcl, "DEM: %s - ESAState not Paused.", __FUNCTION__); + ChipLogError(Zcl, "DEM: %s - ESAState not Paused.", __FUNCTION__); ctx.mCommandHandler.AddStatus(ctx.mRequestPath, Status::Failure); return; } @@ -477,7 +472,7 @@ void Instance::HandleResumeRequest(HandlerContext & ctx, const Commands::ResumeR ctx.mCommandHandler.AddStatus(ctx.mRequestPath, Status::Failure); if (status != Status::Success) { - ChipLogProgress(Zcl, "DEM: %s - mDelegate.ResumeRequest() FAILURE", __FUNCTION__); + ChipLogError(Zcl, "DEM: %s - mDelegate.ResumeRequest() FAILURE", __FUNCTION__); return; } @@ -493,7 +488,7 @@ void Instance::HandleModifyForecastRequest(HandlerContext & ctx, const Commands: if (forecast.IsNull()) { - ChipLogProgress(Zcl, "DEM: %s - Forecast is Null", __FUNCTION__); + ChipLogError(Zcl, "DEM: %s - Forecast is Null", __FUNCTION__); ctx.mCommandHandler.AddStatus(ctx.mRequestPath, Status::Failure); return; } @@ -509,7 +504,7 @@ void Instance::HandleRequestConstraintBasedForecast(HandlerContext & ctx, Status status = Status::UnsupportedCommand; // TODO Status::Success; // TODO pass this up to the delegate if it supports it - ChipLogProgress(Zcl, "DEM: %s - Handle Constraint based forecast ", __FUNCTION__); + ChipLogError(Zcl, "DEM: %s - Handle Constraint based forecast ", __FUNCTION__); ctx.mCommandHandler.AddStatus(ctx.mRequestPath, status); return; } From b44b86602b5c735ad4ae5cee4a461919b74ddabf Mon Sep 17 00:00:00 2001 From: James Harrow Date: Fri, 15 Dec 2023 08:24:35 +0000 Subject: [PATCH 012/114] Aligned EVSE XML to same state as PR#30857 (includes SessionID being Nullable etc and in Fault Event). --- .../data-model/chip/energy-evse-cluster.xml | 20 +++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/src/app/zap-templates/zcl/data-model/chip/energy-evse-cluster.xml b/src/app/zap-templates/zcl/data-model/chip/energy-evse-cluster.xml index 83f44e37f1eaf4..49457150b71754 100644 --- a/src/app/zap-templates/zcl/data-model/chip/energy-evse-cluster.xml +++ b/src/app/zap-templates/zcl/data-model/chip/energy-evse-cluster.xml @@ -69,7 +69,7 @@ limitations under the License. - + @@ -130,11 +130,11 @@ limitations under the License. BatteryCapacity VehicleID - SessionID - SessionDuration - SessionEnergyCharged + SessionID + SessionDuration + SessionEnergyCharged - SessionEnergyDischarged + SessionEnergyDischarged Allows a client to disable the EVSE from charging and discharging. @@ -171,11 +171,11 @@ limitations under the License. EVConnected - + EVNotDetected - + @@ -183,20 +183,20 @@ limitations under the License. EnergyTransferStarted - + EnergyTransferStopped - + Fault - + From 42b79f07f6ae35c83f0f6873bc01b2f35d189337 Mon Sep 17 00:00:00 2001 From: James Harrow Date: Fri, 15 Dec 2023 08:28:44 +0000 Subject: [PATCH 013/114] Updated Device Energy Management XML to use power_mw, energy_mwh per spec definition. --- .../chip/device-energy-management-cluster.xml | 30 +++++++++---------- 1 file changed, 15 insertions(+), 15 deletions(-) diff --git a/src/app/zap-templates/zcl/data-model/chip/device-energy-management-cluster.xml b/src/app/zap-templates/zcl/data-model/chip/device-energy-management-cluster.xml index 10e3af41e4a290..a07ac6d0d505e1 100644 --- a/src/app/zap-templates/zcl/data-model/chip/device-energy-management-cluster.xml +++ b/src/app/zap-templates/zcl/data-model/chip/device-energy-management-cluster.xml @@ -38,14 +38,14 @@ limitations under the License. ESAType ESACanGenerate ESAState - AbsMinPower - AbsMaxPower + AbsMinPower + AbsMaxPower PowerAdjustmentCapability Forecast - + Allows a client to request an adjustment in the power consumption of an ESA for a specified duration. @@ -79,7 +79,7 @@ limitations under the License. PowerAdjustEnd - + Paused @@ -138,8 +138,8 @@ limitations under the License. - - + + @@ -165,28 +165,28 @@ limitations under the License. - - - - + + + + - - + + - + - - + + \ No newline at end of file From 56e62ec019697bd0f1f8291828957fcd06b14110 Mon Sep 17 00:00:00 2001 From: James Harrow Date: Fri, 15 Dec 2023 08:29:58 +0000 Subject: [PATCH 014/114] Updated controller-clusters.zap --- src/controller/data_model/controller-clusters.zap | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/controller/data_model/controller-clusters.zap b/src/controller/data_model/controller-clusters.zap index fb41ede1f42920..b530fd8f277f05 100644 --- a/src/controller/data_model/controller-clusters.zap +++ b/src/controller/data_model/controller-clusters.zap @@ -428,6 +428,7 @@ "define": "ON_OFF_SWITCH_CONFIGURATION_CLUSTER", "side": "client", "enabled": 1, + "apiMaturity": "deprecated", "attributes": [ { "name": "ClusterRevision", @@ -562,6 +563,7 @@ "define": "BINARY_INPUT_BASIC_CLUSTER", "side": "client", "enabled": 1, + "apiMaturity": "deprecated", "attributes": [ { "name": "ClusterRevision", @@ -3484,6 +3486,7 @@ "define": "BARRIER_CONTROL_CLUSTER", "side": "client", "enabled": 1, + "apiMaturity": "deprecated", "commands": [ { "name": "BarrierControlGoToPercent", @@ -5108,6 +5111,7 @@ "define": "ELECTRICAL_MEASUREMENT_CLUSTER", "side": "client", "enabled": 1, + "apiMaturity": "deprecated", "attributes": [ { "name": "ClusterRevision", From 1b9316d48cd28b9a79d737bad3b754454c9c5260 Mon Sep 17 00:00:00 2001 From: James Harrow Date: Fri, 15 Dec 2023 09:06:25 +0000 Subject: [PATCH 015/114] regen_all.py --- .../data_model/controller-clusters.matter | 40 ++-- .../chip/devicecontroller/ChipClusters.java | 36 ++-- .../devicecontroller/ChipEventStructs.java | 8 +- .../chip/devicecontroller/ChipStructs.java | 22 +- .../devicecontroller/ClusterInfoMapping.java | 63 ++++++ .../devicecontroller/ClusterReadMapping.java | 12 +- .../EnergyEvseClusterFaultEvent.kt | 16 +- .../EnergyEvseClusterChargingTargetStruct.kt | 17 +- .../cluster/clusters/EnergyEvseCluster.kt | 43 +++- .../EnergyEvseClusterFaultEvent.kt | 16 +- .../EnergyEvseClusterChargingTargetStruct.kt | 17 +- .../CHIPAttributeTLVValueDecoder.cpp | 51 +++-- .../CHIPEventTLVValueDecoder.cpp | 17 +- .../zap-generated/CHIPInvokeCallbacks.cpp | 19 +- .../java/zap-generated/CHIPReadCallbacks.cpp | 202 ++++++++++++++++++ .../python/chip/clusters/Objects.py | 32 +-- .../MTRAttributeTLVValueDecoder.mm | 24 ++- .../zap-generated/MTRCommandPayloadsObjc.mm | 4 +- .../zap-generated/MTREventTLVValueDecoder.mm | 8 +- .../CHIP/zap-generated/MTRStructsObjc.h | 4 +- .../CHIP/zap-generated/MTRStructsObjc.mm | 8 +- .../zap-generated/attributes/Accessors.cpp | 100 +++++++-- .../zap-generated/attributes/Accessors.h | 16 +- .../zap-generated/cluster-objects.cpp | 6 +- .../zap-generated/cluster-objects.h | 36 ++-- .../zap-generated/cluster/Commands.h | 22 +- .../cluster/ComplexArgumentParser.cpp | 14 +- .../cluster/logging/DataModelLogger.cpp | 10 +- .../zap-generated/cluster/Commands.h | 4 +- 29 files changed, 659 insertions(+), 208 deletions(-) diff --git a/src/controller/data_model/controller-clusters.matter b/src/controller/data_model/controller-clusters.matter index 3de205777da77f..ef27bd2371d0c8 100644 --- a/src/controller/data_model/controller-clusters.matter +++ b/src/controller/data_model/controller-clusters.matter @@ -4451,13 +4451,13 @@ provisional cluster DeviceEnergyManagement = 152 { elapsed_s minPauseDuration = 6; elapsed_s maxPauseDuration = 7; optional int16u manufacturerESAState = 8; - optional int64s nominalPower = 9; - optional int64s minPower = 10; - optional int64s maxPower = 11; - optional int64s nominalEnergy = 12; + optional power_mw nominalPower = 9; + optional power_mw minPower = 10; + optional power_mw maxPower = 11; + optional energy_mwh nominalEnergy = 12; optional CostStruct costs[] = 13; - optional int64s minPowerAdjustment = 14; - optional int64s maxPowerAdjustment = 15; + optional power_mw minPowerAdjustment = 14; + optional power_mw maxPowerAdjustment = 15; optional elapsed_s minDurationAdjustment = 16; optional elapsed_s maxDurationAdjustment = 17; } @@ -4476,21 +4476,21 @@ provisional cluster DeviceEnergyManagement = 152 { struct ConstraintsStruct { epoch_s startTime = 0; elapsed_s duration = 1; - optional int64s nominalPower = 2; - optional int64s maximumEnergy = 3; + optional power_mw nominalPower = 2; + optional energy_mwh maximumEnergy = 3; optional int8s loadControl = 4; } struct PowerAdjustStruct { - int64s minPower = 0; - int64s maxPower = 1; + power_mw minPower = 0; + power_mw maxPower = 1; elapsed_s minDuration = 2; elapsed_s maxDuration = 3; } struct SlotAdjustmentStruct { int8u slotIndex = 0; - int64s nominalPower = 1; + power_mw nominalPower = 1; elapsed_s duration = 2; } @@ -4500,7 +4500,7 @@ provisional cluster DeviceEnergyManagement = 152 { info event PowerAdjustEnd = 1 { CauseEnum cause = 0; elapsed_s duration = 1; - int64s energyUse = 2; + energy_mwh energyUse = 2; } info event Paused = 2 { @@ -4512,8 +4512,8 @@ provisional cluster DeviceEnergyManagement = 152 { readonly attribute ESATypeEnum ESAType = 0; readonly attribute boolean ESACanGenerate = 1; readonly attribute ESAStateEnum ESAState = 2; - readonly attribute int64s absMinPower = 3; - readonly attribute int64s absMaxPower = 4; + readonly attribute power_mw absMinPower = 3; + readonly attribute power_mw absMaxPower = 4; readonly attribute optional nullable PowerAdjustStruct powerAdjustmentCapability[] = 5; readonly attribute optional nullable ForecastStruct forecast = 6; readonly attribute command_id generatedCommandList[] = 65528; @@ -4524,7 +4524,7 @@ provisional cluster DeviceEnergyManagement = 152 { readonly attribute int16u clusterRevision = 65533; request struct PowerAdjustRequestRequest { - int64s power = 0; + power_mw power = 0; elapsed_s duration = 1; } @@ -4628,7 +4628,7 @@ provisional cluster EnergyEvse = 153 { } struct ChargingTargetStruct { - int16u targetTime = 0; + int16u targetTimeMinutesPastMidnight = 0; optional percent targetSoC = 1; optional energy_mwh addedEnergy = 2; } @@ -4659,7 +4659,7 @@ provisional cluster EnergyEvse = 153 { } critical event Fault = 4 { - int32u sessionID = 0; + nullable int32u sessionID = 0; StateEnum state = 1; FaultStateEnum faultStatePreviousState = 2; FaultStateEnum faultStateCurrentState = 4; @@ -4691,9 +4691,9 @@ provisional cluster EnergyEvse = 153 { readonly attribute optional nullable energy_mwh 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 energy_mwh sessionEnergyCharged = 66; - readonly attribute optional energy_mwh sessionEnergyDischarged = 67; + readonly attribute nullable elapsed_s sessionDuration = 65; + readonly attribute nullable energy_mwh sessionEnergyCharged = 66; + readonly attribute optional nullable energy_mwh sessionEnergyDischarged = 67; readonly attribute command_id generatedCommandList[] = 65528; readonly attribute command_id acceptedCommandList[] = 65529; readonly attribute event_id eventList[] = 65530; diff --git a/src/controller/java/generated/java/chip/devicecontroller/ChipClusters.java b/src/controller/java/generated/java/chip/devicecontroller/ChipClusters.java index 224dab357f761a..d4a978192119d9 100644 --- a/src/controller/java/generated/java/chip/devicecontroller/ChipClusters.java +++ b/src/controller/java/generated/java/chip/devicecontroller/ChipClusters.java @@ -29927,6 +29927,18 @@ public interface SessionIDAttributeCallback extends BaseAttributeCallback { void onSuccess(@Nullable Long value); } + public interface SessionDurationAttributeCallback extends BaseAttributeCallback { + void onSuccess(@Nullable Long value); + } + + public interface SessionEnergyChargedAttributeCallback extends BaseAttributeCallback { + void onSuccess(@Nullable Long value); + } + + public interface SessionEnergyDischargedAttributeCallback extends BaseAttributeCallback { + void onSuccess(@Nullable Long value); + } + public interface GeneratedCommandListAttributeCallback extends BaseAttributeCallback { void onSuccess(List value); } @@ -30521,76 +30533,76 @@ public void onSuccess(byte[] tlv) { } public void readSessionDurationAttribute( - LongAttributeCallback callback) { + SessionDurationAttributeCallback 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); + @Nullable Long value = ChipTLVValueDecoder.decodeAttributeValue(path, tlv); callback.onSuccess(value); } }, SESSION_DURATION_ATTRIBUTE_ID, true); } public void subscribeSessionDurationAttribute( - LongAttributeCallback callback, int minInterval, int maxInterval) { + SessionDurationAttributeCallback 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); + @Nullable Long value = ChipTLVValueDecoder.decodeAttributeValue(path, tlv); } }, SESSION_DURATION_ATTRIBUTE_ID, minInterval, maxInterval); } public void readSessionEnergyChargedAttribute( - LongAttributeCallback callback) { + SessionEnergyChargedAttributeCallback 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); + @Nullable Long value = ChipTLVValueDecoder.decodeAttributeValue(path, tlv); callback.onSuccess(value); } }, SESSION_ENERGY_CHARGED_ATTRIBUTE_ID, true); } public void subscribeSessionEnergyChargedAttribute( - LongAttributeCallback callback, int minInterval, int maxInterval) { + SessionEnergyChargedAttributeCallback 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); + @Nullable Long value = ChipTLVValueDecoder.decodeAttributeValue(path, tlv); } }, SESSION_ENERGY_CHARGED_ATTRIBUTE_ID, minInterval, maxInterval); } public void readSessionEnergyDischargedAttribute( - LongAttributeCallback callback) { + SessionEnergyDischargedAttributeCallback 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); + @Nullable Long value = ChipTLVValueDecoder.decodeAttributeValue(path, tlv); callback.onSuccess(value); } }, SESSION_ENERGY_DISCHARGED_ATTRIBUTE_ID, true); } public void subscribeSessionEnergyDischargedAttribute( - LongAttributeCallback callback, int minInterval, int maxInterval) { + SessionEnergyDischargedAttributeCallback 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); + @Nullable Long value = ChipTLVValueDecoder.decodeAttributeValue(path, tlv); } }, SESSION_ENERGY_DISCHARGED_ATTRIBUTE_ID, minInterval, maxInterval); } diff --git a/src/controller/java/generated/java/chip/devicecontroller/ChipEventStructs.java b/src/controller/java/generated/java/chip/devicecontroller/ChipEventStructs.java index 81b0180a39df4f..79d160371f9712 100644 --- a/src/controller/java/generated/java/chip/devicecontroller/ChipEventStructs.java +++ b/src/controller/java/generated/java/chip/devicecontroller/ChipEventStructs.java @@ -3759,7 +3759,7 @@ public String toString() { } } public static class EnergyEvseClusterFaultEvent { - public Long sessionID; + public @Nullable Long sessionID; public Integer state; public Integer faultStatePreviousState; public Integer faultStateCurrentState; @@ -3769,7 +3769,7 @@ public static class EnergyEvseClusterFaultEvent { private static final long FAULT_STATE_CURRENT_STATE_ID = 4L; public EnergyEvseClusterFaultEvent( - Long sessionID, + @Nullable Long sessionID, Integer state, Integer faultStatePreviousState, Integer faultStateCurrentState @@ -3782,7 +3782,7 @@ public EnergyEvseClusterFaultEvent( public StructType encodeTlv() { ArrayList values = new ArrayList<>(); - values.add(new StructElement(SESSION_I_D_ID, new UIntType(sessionID))); + values.add(new StructElement(SESSION_I_D_ID, sessionID != null ? new UIntType(sessionID) : new NullType())); 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))); @@ -3794,7 +3794,7 @@ public static EnergyEvseClusterFaultEvent decodeTlv(BaseTLVType tlvValue) { if (tlvValue == null || tlvValue.type() != TLVType.Struct) { return null; } - Long sessionID = null; + @Nullable Long sessionID = null; Integer state = null; Integer faultStatePreviousState = null; Integer faultStateCurrentState = null; diff --git a/src/controller/java/generated/java/chip/devicecontroller/ChipStructs.java b/src/controller/java/generated/java/chip/devicecontroller/ChipStructs.java index 0237b3fc989cd2..e7e40657b7915f 100644 --- a/src/controller/java/generated/java/chip/devicecontroller/ChipStructs.java +++ b/src/controller/java/generated/java/chip/devicecontroller/ChipStructs.java @@ -7276,26 +7276,26 @@ public String toString() { } } public static class EnergyEvseClusterChargingTargetStruct { - public Integer targetTime; + public Integer targetTimeMinutesPastMidnight; public Optional targetSoC; public Optional addedEnergy; - private static final long TARGET_TIME_ID = 0L; + private static final long TARGET_TIME_MINUTES_PAST_MIDNIGHT_ID = 0L; private static final long TARGET_SO_C_ID = 1L; private static final long ADDED_ENERGY_ID = 2L; public EnergyEvseClusterChargingTargetStruct( - Integer targetTime, + Integer targetTimeMinutesPastMidnight, Optional targetSoC, Optional addedEnergy ) { - this.targetTime = targetTime; + this.targetTimeMinutesPastMidnight = targetTimeMinutesPastMidnight; this.targetSoC = targetSoC; this.addedEnergy = addedEnergy; } public StructType encodeTlv() { ArrayList values = new ArrayList<>(); - values.add(new StructElement(TARGET_TIME_ID, new UIntType(targetTime))); + values.add(new StructElement(TARGET_TIME_MINUTES_PAST_MIDNIGHT_ID, new UIntType(targetTimeMinutesPastMidnight))); values.add(new StructElement(TARGET_SO_C_ID, targetSoC.map((nonOptionaltargetSoC) -> new UIntType(nonOptionaltargetSoC)).orElse(new EmptyType()))); values.add(new StructElement(ADDED_ENERGY_ID, addedEnergy.map((nonOptionaladdedEnergy) -> new IntType(nonOptionaladdedEnergy)).orElse(new EmptyType()))); @@ -7306,14 +7306,14 @@ public static EnergyEvseClusterChargingTargetStruct decodeTlv(BaseTLVType tlvVal if (tlvValue == null || tlvValue.type() != TLVType.Struct) { return null; } - Integer targetTime = null; + Integer targetTimeMinutesPastMidnight = null; Optional targetSoC = Optional.empty(); Optional addedEnergy = Optional.empty(); for (StructElement element: ((StructType)tlvValue).value()) { - if (element.contextTagNum() == TARGET_TIME_ID) { + if (element.contextTagNum() == TARGET_TIME_MINUTES_PAST_MIDNIGHT_ID) { if (element.value(BaseTLVType.class).type() == TLVType.UInt) { UIntType castingValue = element.value(UIntType.class); - targetTime = castingValue.value(Integer.class); + targetTimeMinutesPastMidnight = castingValue.value(Integer.class); } } else if (element.contextTagNum() == TARGET_SO_C_ID) { if (element.value(BaseTLVType.class).type() == TLVType.UInt) { @@ -7328,7 +7328,7 @@ public static EnergyEvseClusterChargingTargetStruct decodeTlv(BaseTLVType tlvVal } } return new EnergyEvseClusterChargingTargetStruct( - targetTime, + targetTimeMinutesPastMidnight, targetSoC, addedEnergy ); @@ -7338,8 +7338,8 @@ public static EnergyEvseClusterChargingTargetStruct decodeTlv(BaseTLVType tlvVal public String toString() { StringBuilder output = new StringBuilder(); output.append("EnergyEvseClusterChargingTargetStruct {\n"); - output.append("\ttargetTime: "); - output.append(targetTime); + output.append("\ttargetTimeMinutesPastMidnight: "); + output.append(targetTimeMinutesPastMidnight); output.append("\n"); output.append("\ttargetSoC: "); output.append(targetSoC); diff --git a/src/controller/java/generated/java/chip/devicecontroller/ClusterInfoMapping.java b/src/controller/java/generated/java/chip/devicecontroller/ClusterInfoMapping.java index b92600bc9890a4..91b7d28b9fe564 100644 --- a/src/controller/java/generated/java/chip/devicecontroller/ClusterInfoMapping.java +++ b/src/controller/java/generated/java/chip/devicecontroller/ClusterInfoMapping.java @@ -10747,6 +10747,69 @@ public void onError(Exception ex) { } } + public static class DelegatedEnergyEvseClusterSessionDurationAttributeCallback implements ChipClusters.EnergyEvseCluster.SessionDurationAttributeCallback, DelegatedClusterCallback { + private ClusterCommandCallback callback; + @Override + public void setCallbackDelegate(ClusterCommandCallback callback) { + this.callback = callback; + } + + @Override + public void onSuccess(@Nullable Long value) { + Map responseValues = new LinkedHashMap<>(); + CommandResponseInfo commandResponseInfo = new CommandResponseInfo("value", "Long"); + responseValues.put(commandResponseInfo, value); + callback.onSuccess(responseValues); + } + + @Override + public void onError(Exception ex) { + callback.onFailure(ex); + } + } + + public static class DelegatedEnergyEvseClusterSessionEnergyChargedAttributeCallback implements ChipClusters.EnergyEvseCluster.SessionEnergyChargedAttributeCallback, DelegatedClusterCallback { + private ClusterCommandCallback callback; + @Override + public void setCallbackDelegate(ClusterCommandCallback callback) { + this.callback = callback; + } + + @Override + public void onSuccess(@Nullable Long value) { + Map responseValues = new LinkedHashMap<>(); + CommandResponseInfo commandResponseInfo = new CommandResponseInfo("value", "Long"); + responseValues.put(commandResponseInfo, value); + callback.onSuccess(responseValues); + } + + @Override + public void onError(Exception ex) { + callback.onFailure(ex); + } + } + + public static class DelegatedEnergyEvseClusterSessionEnergyDischargedAttributeCallback implements ChipClusters.EnergyEvseCluster.SessionEnergyDischargedAttributeCallback, DelegatedClusterCallback { + private ClusterCommandCallback callback; + @Override + public void setCallbackDelegate(ClusterCommandCallback callback) { + this.callback = callback; + } + + @Override + public void onSuccess(@Nullable Long value) { + Map responseValues = new LinkedHashMap<>(); + CommandResponseInfo commandResponseInfo = new CommandResponseInfo("value", "Long"); + responseValues.put(commandResponseInfo, value); + callback.onSuccess(responseValues); + } + + @Override + public void onError(Exception ex) { + callback.onFailure(ex); + } + } + public static class DelegatedEnergyEvseClusterGeneratedCommandListAttributeCallback implements ChipClusters.EnergyEvseCluster.GeneratedCommandListAttributeCallback, DelegatedClusterCallback { private ClusterCommandCallback callback; @Override diff --git a/src/controller/java/generated/java/chip/devicecontroller/ClusterReadMapping.java b/src/controller/java/generated/java/chip/devicecontroller/ClusterReadMapping.java index fecf9c31d761ee..ec96ce4c2bc8a7 100644 --- a/src/controller/java/generated/java/chip/devicecontroller/ClusterReadMapping.java +++ b/src/controller/java/generated/java/chip/devicecontroller/ClusterReadMapping.java @@ -9542,10 +9542,10 @@ private static Map readEnergyEvseInteractionInfo() { InteractionInfo readEnergyEvseSessionDurationAttributeInteractionInfo = new InteractionInfo( (cluster, callback, commandArguments) -> { ((ChipClusters.EnergyEvseCluster) cluster).readSessionDurationAttribute( - (ChipClusters.LongAttributeCallback) callback + (ChipClusters.EnergyEvseCluster.SessionDurationAttributeCallback) callback ); }, - () -> new ClusterInfoMapping.DelegatedLongAttributeCallback(), + () -> new ClusterInfoMapping.DelegatedEnergyEvseClusterSessionDurationAttributeCallback(), readEnergyEvseSessionDurationCommandParams ); result.put("readSessionDurationAttribute", readEnergyEvseSessionDurationAttributeInteractionInfo); @@ -9553,10 +9553,10 @@ private static Map readEnergyEvseInteractionInfo() { InteractionInfo readEnergyEvseSessionEnergyChargedAttributeInteractionInfo = new InteractionInfo( (cluster, callback, commandArguments) -> { ((ChipClusters.EnergyEvseCluster) cluster).readSessionEnergyChargedAttribute( - (ChipClusters.LongAttributeCallback) callback + (ChipClusters.EnergyEvseCluster.SessionEnergyChargedAttributeCallback) callback ); }, - () -> new ClusterInfoMapping.DelegatedLongAttributeCallback(), + () -> new ClusterInfoMapping.DelegatedEnergyEvseClusterSessionEnergyChargedAttributeCallback(), readEnergyEvseSessionEnergyChargedCommandParams ); result.put("readSessionEnergyChargedAttribute", readEnergyEvseSessionEnergyChargedAttributeInteractionInfo); @@ -9564,10 +9564,10 @@ private static Map readEnergyEvseInteractionInfo() { InteractionInfo readEnergyEvseSessionEnergyDischargedAttributeInteractionInfo = new InteractionInfo( (cluster, callback, commandArguments) -> { ((ChipClusters.EnergyEvseCluster) cluster).readSessionEnergyDischargedAttribute( - (ChipClusters.LongAttributeCallback) callback + (ChipClusters.EnergyEvseCluster.SessionEnergyDischargedAttributeCallback) callback ); }, - () -> new ClusterInfoMapping.DelegatedLongAttributeCallback(), + () -> new ClusterInfoMapping.DelegatedEnergyEvseClusterSessionEnergyDischargedAttributeCallback(), readEnergyEvseSessionEnergyDischargedCommandParams ); result.put("readSessionEnergyDischargedAttribute", readEnergyEvseSessionEnergyDischargedAttributeInteractionInfo); 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 index 2b82c363aa442c..53ca88273b038d 100644 --- a/src/controller/java/generated/java/chip/devicecontroller/cluster/eventstructs/EnergyEvseClusterFaultEvent.kt +++ b/src/controller/java/generated/java/chip/devicecontroller/cluster/eventstructs/EnergyEvseClusterFaultEvent.kt @@ -23,7 +23,7 @@ import matter.tlv.TlvReader import matter.tlv.TlvWriter class EnergyEvseClusterFaultEvent( - val sessionID: ULong, + val sessionID: ULong?, val state: UInt, val faultStatePreviousState: UInt, val faultStateCurrentState: UInt @@ -40,7 +40,11 @@ class EnergyEvseClusterFaultEvent( fun toTlv(tlvTag: Tag, tlvWriter: TlvWriter) { tlvWriter.apply { startStructure(tlvTag) - put(ContextSpecificTag(TAG_SESSION_I_D), sessionID) + if (sessionID != null) { + put(ContextSpecificTag(TAG_SESSION_I_D), sessionID) + } else { + putNull(ContextSpecificTag(TAG_SESSION_I_D)) + } put(ContextSpecificTag(TAG_STATE), state) put(ContextSpecificTag(TAG_FAULT_STATE_PREVIOUS_STATE), faultStatePreviousState) put(ContextSpecificTag(TAG_FAULT_STATE_CURRENT_STATE), faultStateCurrentState) @@ -56,7 +60,13 @@ class EnergyEvseClusterFaultEvent( fun fromTlv(tlvTag: Tag, tlvReader: TlvReader): EnergyEvseClusterFaultEvent { tlvReader.enterStructure(tlvTag) - val sessionID = tlvReader.getULong(ContextSpecificTag(TAG_SESSION_I_D)) + val sessionID = + if (!tlvReader.isNull()) { + tlvReader.getULong(ContextSpecificTag(TAG_SESSION_I_D)) + } else { + tlvReader.getNull(ContextSpecificTag(TAG_SESSION_I_D)) + null + } val state = tlvReader.getUInt(ContextSpecificTag(TAG_STATE)) val faultStatePreviousState = tlvReader.getUInt(ContextSpecificTag(TAG_FAULT_STATE_PREVIOUS_STATE)) 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 index f457f066ff27bc..9e859dbdf40e53 100644 --- a/src/controller/java/generated/java/chip/devicecontroller/cluster/structs/EnergyEvseClusterChargingTargetStruct.kt +++ b/src/controller/java/generated/java/chip/devicecontroller/cluster/structs/EnergyEvseClusterChargingTargetStruct.kt @@ -24,13 +24,13 @@ import matter.tlv.TlvReader import matter.tlv.TlvWriter class EnergyEvseClusterChargingTargetStruct( - val targetTime: UInt, + val targetTimeMinutesPastMidnight: UInt, val targetSoC: Optional, val addedEnergy: Optional ) { override fun toString(): String = buildString { append("EnergyEvseClusterChargingTargetStruct {\n") - append("\ttargetTime : $targetTime\n") + append("\ttargetTimeMinutesPastMidnight : $targetTimeMinutesPastMidnight\n") append("\ttargetSoC : $targetSoC\n") append("\taddedEnergy : $addedEnergy\n") append("}\n") @@ -39,7 +39,7 @@ class EnergyEvseClusterChargingTargetStruct( fun toTlv(tlvTag: Tag, tlvWriter: TlvWriter) { tlvWriter.apply { startStructure(tlvTag) - put(ContextSpecificTag(TAG_TARGET_TIME), targetTime) + put(ContextSpecificTag(TAG_TARGET_TIME_MINUTES_PAST_MIDNIGHT), targetTimeMinutesPastMidnight) if (targetSoC.isPresent) { val opttargetSoC = targetSoC.get() put(ContextSpecificTag(TAG_TARGET_SO_C), opttargetSoC) @@ -53,13 +53,14 @@ class EnergyEvseClusterChargingTargetStruct( } companion object { - private const val TAG_TARGET_TIME = 0 + private const val TAG_TARGET_TIME_MINUTES_PAST_MIDNIGHT = 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 targetTimeMinutesPastMidnight = + tlvReader.getUInt(ContextSpecificTag(TAG_TARGET_TIME_MINUTES_PAST_MIDNIGHT)) val targetSoC = if (tlvReader.isNextTag(ContextSpecificTag(TAG_TARGET_SO_C))) { Optional.of(tlvReader.getUInt(ContextSpecificTag(TAG_TARGET_SO_C))) @@ -75,7 +76,11 @@ class EnergyEvseClusterChargingTargetStruct( tlvReader.exitContainer() - return EnergyEvseClusterChargingTargetStruct(targetTime, targetSoC, addedEnergy) + return EnergyEvseClusterChargingTargetStruct( + targetTimeMinutesPastMidnight, + targetSoC, + addedEnergy + ) } } } diff --git a/src/controller/java/generated/java/matter/controller/cluster/clusters/EnergyEvseCluster.kt b/src/controller/java/generated/java/matter/controller/cluster/clusters/EnergyEvseCluster.kt index 93e1c213748fe1..615839a2191b26 100644 --- a/src/controller/java/generated/java/matter/controller/cluster/clusters/EnergyEvseCluster.kt +++ b/src/controller/java/generated/java/matter/controller/cluster/clusters/EnergyEvseCluster.kt @@ -66,6 +66,12 @@ class EnergyEvseCluster(private val controller: MatterController, private val en class SessionIDAttribute(val value: UInt?) + class SessionDurationAttribute(val value: UInt?) + + class SessionEnergyChargedAttribute(val value: Long?) + + class SessionEnergyDischargedAttribute(val value: Long?) + class GeneratedCommandListAttribute(val value: List) class AcceptedCommandListAttribute(val value: List) @@ -1230,7 +1236,7 @@ class EnergyEvseCluster(private val controller: MatterController, private val en return SessionIDAttribute(decodedValue) } - suspend fun readSessionDurationAttribute(): UInt { + suspend fun readSessionDurationAttribute(): SessionDurationAttribute { val ATTRIBUTE_ID: UInt = 65u val attributePath = @@ -1256,12 +1262,18 @@ class EnergyEvseCluster(private val controller: MatterController, private val en // Decode the TLV data into the appropriate type val tlvReader = TlvReader(attributeData.data) - val decodedValue: UInt = tlvReader.getUInt(AnonymousTag) + val decodedValue: UInt? = + if (!tlvReader.isNull()) { + tlvReader.getUInt(AnonymousTag) + } else { + tlvReader.getNull(AnonymousTag) + null + } - return decodedValue + return SessionDurationAttribute(decodedValue) } - suspend fun readSessionEnergyChargedAttribute(): Long { + suspend fun readSessionEnergyChargedAttribute(): SessionEnergyChargedAttribute { val ATTRIBUTE_ID: UInt = 66u val attributePath = @@ -1287,12 +1299,18 @@ class EnergyEvseCluster(private val controller: MatterController, private val en // Decode the TLV data into the appropriate type val tlvReader = TlvReader(attributeData.data) - val decodedValue: Long = tlvReader.getLong(AnonymousTag) + val decodedValue: Long? = + if (!tlvReader.isNull()) { + tlvReader.getLong(AnonymousTag) + } else { + tlvReader.getNull(AnonymousTag) + null + } - return decodedValue + return SessionEnergyChargedAttribute(decodedValue) } - suspend fun readSessionEnergyDischargedAttribute(): Long? { + suspend fun readSessionEnergyDischargedAttribute(): SessionEnergyDischargedAttribute { val ATTRIBUTE_ID: UInt = 67u val attributePath = @@ -1319,13 +1337,18 @@ class EnergyEvseCluster(private val controller: MatterController, private val en // Decode the TLV data into the appropriate type val tlvReader = TlvReader(attributeData.data) val decodedValue: Long? = - if (tlvReader.isNextTag(AnonymousTag)) { - tlvReader.getLong(AnonymousTag) + if (!tlvReader.isNull()) { + if (tlvReader.isNextTag(AnonymousTag)) { + tlvReader.getLong(AnonymousTag) + } else { + null + } } else { + tlvReader.getNull(AnonymousTag) null } - return decodedValue + return SessionEnergyDischargedAttribute(decodedValue) } suspend fun readGeneratedCommandListAttribute(): GeneratedCommandListAttribute { diff --git a/src/controller/java/generated/java/matter/controller/cluster/eventstructs/EnergyEvseClusterFaultEvent.kt b/src/controller/java/generated/java/matter/controller/cluster/eventstructs/EnergyEvseClusterFaultEvent.kt index 03e5ca83816f70..2167c1fca408eb 100644 --- a/src/controller/java/generated/java/matter/controller/cluster/eventstructs/EnergyEvseClusterFaultEvent.kt +++ b/src/controller/java/generated/java/matter/controller/cluster/eventstructs/EnergyEvseClusterFaultEvent.kt @@ -23,7 +23,7 @@ import matter.tlv.TlvReader import matter.tlv.TlvWriter class EnergyEvseClusterFaultEvent( - val sessionID: UInt, + val sessionID: UInt?, val state: UByte, val faultStatePreviousState: UByte, val faultStateCurrentState: UByte @@ -40,7 +40,11 @@ class EnergyEvseClusterFaultEvent( fun toTlv(tlvTag: Tag, tlvWriter: TlvWriter) { tlvWriter.apply { startStructure(tlvTag) - put(ContextSpecificTag(TAG_SESSION_I_D), sessionID) + if (sessionID != null) { + put(ContextSpecificTag(TAG_SESSION_I_D), sessionID) + } else { + putNull(ContextSpecificTag(TAG_SESSION_I_D)) + } put(ContextSpecificTag(TAG_STATE), state) put(ContextSpecificTag(TAG_FAULT_STATE_PREVIOUS_STATE), faultStatePreviousState) put(ContextSpecificTag(TAG_FAULT_STATE_CURRENT_STATE), faultStateCurrentState) @@ -56,7 +60,13 @@ class EnergyEvseClusterFaultEvent( fun fromTlv(tlvTag: Tag, tlvReader: TlvReader): EnergyEvseClusterFaultEvent { tlvReader.enterStructure(tlvTag) - val sessionID = tlvReader.getUInt(ContextSpecificTag(TAG_SESSION_I_D)) + val sessionID = + if (!tlvReader.isNull()) { + tlvReader.getUInt(ContextSpecificTag(TAG_SESSION_I_D)) + } else { + tlvReader.getNull(ContextSpecificTag(TAG_SESSION_I_D)) + null + } val state = tlvReader.getUByte(ContextSpecificTag(TAG_STATE)) val faultStatePreviousState = tlvReader.getUByte(ContextSpecificTag(TAG_FAULT_STATE_PREVIOUS_STATE)) diff --git a/src/controller/java/generated/java/matter/controller/cluster/structs/EnergyEvseClusterChargingTargetStruct.kt b/src/controller/java/generated/java/matter/controller/cluster/structs/EnergyEvseClusterChargingTargetStruct.kt index 65c1b49f4af9f1..db61226e1adf55 100644 --- a/src/controller/java/generated/java/matter/controller/cluster/structs/EnergyEvseClusterChargingTargetStruct.kt +++ b/src/controller/java/generated/java/matter/controller/cluster/structs/EnergyEvseClusterChargingTargetStruct.kt @@ -24,13 +24,13 @@ import matter.tlv.TlvReader import matter.tlv.TlvWriter class EnergyEvseClusterChargingTargetStruct( - val targetTime: UShort, + val targetTimeMinutesPastMidnight: UShort, val targetSoC: Optional, val addedEnergy: Optional ) { override fun toString(): String = buildString { append("EnergyEvseClusterChargingTargetStruct {\n") - append("\ttargetTime : $targetTime\n") + append("\ttargetTimeMinutesPastMidnight : $targetTimeMinutesPastMidnight\n") append("\ttargetSoC : $targetSoC\n") append("\taddedEnergy : $addedEnergy\n") append("}\n") @@ -39,7 +39,7 @@ class EnergyEvseClusterChargingTargetStruct( fun toTlv(tlvTag: Tag, tlvWriter: TlvWriter) { tlvWriter.apply { startStructure(tlvTag) - put(ContextSpecificTag(TAG_TARGET_TIME), targetTime) + put(ContextSpecificTag(TAG_TARGET_TIME_MINUTES_PAST_MIDNIGHT), targetTimeMinutesPastMidnight) if (targetSoC.isPresent) { val opttargetSoC = targetSoC.get() put(ContextSpecificTag(TAG_TARGET_SO_C), opttargetSoC) @@ -53,13 +53,14 @@ class EnergyEvseClusterChargingTargetStruct( } companion object { - private const val TAG_TARGET_TIME = 0 + private const val TAG_TARGET_TIME_MINUTES_PAST_MIDNIGHT = 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 targetTimeMinutesPastMidnight = + tlvReader.getUShort(ContextSpecificTag(TAG_TARGET_TIME_MINUTES_PAST_MIDNIGHT)) val targetSoC = if (tlvReader.isNextTag(ContextSpecificTag(TAG_TARGET_SO_C))) { Optional.of(tlvReader.getUByte(ContextSpecificTag(TAG_TARGET_SO_C))) @@ -75,7 +76,11 @@ class EnergyEvseClusterChargingTargetStruct( tlvReader.exitContainer() - return EnergyEvseClusterChargingTargetStruct(targetTime, targetSoC, addedEnergy) + return EnergyEvseClusterChargingTargetStruct( + targetTimeMinutesPastMidnight, + targetSoC, + addedEnergy + ) } } } diff --git a/src/controller/java/zap-generated/CHIPAttributeTLVValueDecoder.cpp b/src/controller/java/zap-generated/CHIPAttributeTLVValueDecoder.cpp index e87c3ea5961c68..b1764fa2e9a1be 100644 --- a/src/controller/java/zap-generated/CHIPAttributeTLVValueDecoder.cpp +++ b/src/controller/java/zap-generated/CHIPAttributeTLVValueDecoder.cpp @@ -22723,11 +22723,18 @@ jobject DecodeAttributeValue(const app::ConcreteAttributePath & aPath, TLV::TLVR return nullptr; } jobject value; - std::string valueClassName = "java/lang/Long"; - std::string valueCtorSignature = "(J)V"; - jlong jnivalue = static_cast(cppValue); - chip::JniReferences::GetInstance().CreateBoxedObject(valueClassName.c_str(), valueCtorSignature.c_str(), - jnivalue, value); + if (cppValue.IsNull()) + { + value = nullptr; + } + else + { + std::string valueClassName = "java/lang/Long"; + std::string valueCtorSignature = "(J)V"; + jlong jnivalue = static_cast(cppValue.Value()); + chip::JniReferences::GetInstance().CreateBoxedObject(valueClassName.c_str(), valueCtorSignature.c_str(), + jnivalue, value); + } return value; } case Attributes::SessionEnergyCharged::Id: { @@ -22739,11 +22746,18 @@ jobject DecodeAttributeValue(const app::ConcreteAttributePath & aPath, TLV::TLVR return nullptr; } jobject value; - std::string valueClassName = "java/lang/Long"; - std::string valueCtorSignature = "(J)V"; - jlong jnivalue = static_cast(cppValue); - chip::JniReferences::GetInstance().CreateBoxedObject(valueClassName.c_str(), valueCtorSignature.c_str(), - jnivalue, value); + if (cppValue.IsNull()) + { + value = nullptr; + } + else + { + std::string valueClassName = "java/lang/Long"; + std::string valueCtorSignature = "(J)V"; + jlong jnivalue = static_cast(cppValue.Value()); + chip::JniReferences::GetInstance().CreateBoxedObject(valueClassName.c_str(), valueCtorSignature.c_str(), + jnivalue, value); + } return value; } case Attributes::SessionEnergyDischarged::Id: { @@ -22755,11 +22769,18 @@ jobject DecodeAttributeValue(const app::ConcreteAttributePath & aPath, TLV::TLVR return nullptr; } jobject value; - std::string valueClassName = "java/lang/Long"; - std::string valueCtorSignature = "(J)V"; - jlong jnivalue = static_cast(cppValue); - chip::JniReferences::GetInstance().CreateBoxedObject(valueClassName.c_str(), valueCtorSignature.c_str(), - jnivalue, value); + if (cppValue.IsNull()) + { + value = nullptr; + } + else + { + std::string valueClassName = "java/lang/Long"; + std::string valueCtorSignature = "(J)V"; + jlong jnivalue = static_cast(cppValue.Value()); + chip::JniReferences::GetInstance().CreateBoxedObject(valueClassName.c_str(), valueCtorSignature.c_str(), + jnivalue, value); + } return value; } case Attributes::GeneratedCommandList::Id: { diff --git a/src/controller/java/zap-generated/CHIPEventTLVValueDecoder.cpp b/src/controller/java/zap-generated/CHIPEventTLVValueDecoder.cpp index 4dd1ffd1e2e2c1..6e3b2093ead51c 100644 --- a/src/controller/java/zap-generated/CHIPEventTLVValueDecoder.cpp +++ b/src/controller/java/zap-generated/CHIPEventTLVValueDecoder.cpp @@ -5248,11 +5248,18 @@ jobject DecodeEventValue(const app::ConcreteEventPath & aPath, TLV::TLVReader & return nullptr; } jobject value_sessionID; - std::string value_sessionIDClassName = "java/lang/Long"; - std::string value_sessionIDCtorSignature = "(J)V"; - jlong jnivalue_sessionID = static_cast(cppValue.sessionID); - chip::JniReferences::GetInstance().CreateBoxedObject( - value_sessionIDClassName.c_str(), value_sessionIDCtorSignature.c_str(), jnivalue_sessionID, value_sessionID); + if (cppValue.sessionID.IsNull()) + { + value_sessionID = nullptr; + } + else + { + std::string value_sessionIDClassName = "java/lang/Long"; + std::string value_sessionIDCtorSignature = "(J)V"; + jlong jnivalue_sessionID = static_cast(cppValue.sessionID.Value()); + chip::JniReferences::GetInstance().CreateBoxedObject( + value_sessionIDClassName.c_str(), value_sessionIDCtorSignature.c_str(), jnivalue_sessionID, value_sessionID); + } jobject value_state; std::string value_stateClassName = "java/lang/Integer"; diff --git a/src/controller/java/zap-generated/CHIPInvokeCallbacks.cpp b/src/controller/java/zap-generated/CHIPInvokeCallbacks.cpp index 3b65b69a3a456a..2b5fa3ff8429ea 100644 --- a/src/controller/java/zap-generated/CHIPInvokeCallbacks.cpp +++ b/src/controller/java/zap-generated/CHIPInvokeCallbacks.cpp @@ -3959,13 +3959,14 @@ void CHIPEnergyEvseClusterGetTargetsResponseCallback::CallbackFn( { 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(entry_0.targetTime); - chip::JniReferences::GetInstance().CreateBoxedObject(newElement_0_targetTimeClassName.c_str(), - newElement_0_targetTimeCtorSignature.c_str(), - jninewElement_0_targetTime, newElement_0_targetTime); + jobject newElement_0_targetTimeMinutesPastMidnight; + std::string newElement_0_targetTimeMinutesPastMidnightClassName = "java/lang/Integer"; + std::string newElement_0_targetTimeMinutesPastMidnightCtorSignature = "(I)V"; + jint jninewElement_0_targetTimeMinutesPastMidnight = static_cast(entry_0.targetTimeMinutesPastMidnight); + chip::JniReferences::GetInstance().CreateBoxedObject(newElement_0_targetTimeMinutesPastMidnightClassName.c_str(), + newElement_0_targetTimeMinutesPastMidnightCtorSignature.c_str(), + jninewElement_0_targetTimeMinutesPastMidnight, + newElement_0_targetTimeMinutesPastMidnight); jobject newElement_0_targetSoC; if (!entry_0.targetSoC.HasValue()) { @@ -4016,8 +4017,8 @@ void CHIPEnergyEvseClusterGetTargetsResponseCallback::CallbackFn( return; } - newElement_0 = env->NewObject(chargingTargetStructStructClass_1, chargingTargetStructStructCtor_1, newElement_0_targetTime, - newElement_0_targetSoC, newElement_0_addedEnergy); + newElement_0 = env->NewObject(chargingTargetStructStructClass_1, chargingTargetStructStructCtor_1, + newElement_0_targetTimeMinutesPastMidnight, newElement_0_targetSoC, newElement_0_addedEnergy); chip::JniReferences::GetInstance().AddToList(ChargingTargets, newElement_0); } diff --git a/src/controller/java/zap-generated/CHIPReadCallbacks.cpp b/src/controller/java/zap-generated/CHIPReadCallbacks.cpp index 630984be29b0a7..e7d797ce9f0e92 100644 --- a/src/controller/java/zap-generated/CHIPReadCallbacks.cpp +++ b/src/controller/java/zap-generated/CHIPReadCallbacks.cpp @@ -33874,6 +33874,208 @@ void CHIPEnergyEvseSessionIDAttributeCallback::CallbackFn(void * context, const env->CallVoidMethod(javaCallbackRef, javaMethod, javaValue); } +CHIPEnergyEvseSessionDurationAttributeCallback::CHIPEnergyEvseSessionDurationAttributeCallback(jobject javaCallback, + bool keepAlive) : + chip::Callback::Callback(CallbackFn, this), keepAlive(keepAlive) +{ + JNIEnv * env = chip::JniReferences::GetInstance().GetEnvForCurrentThread(); + if (env == nullptr) + { + ChipLogError(Zcl, "Could not create global reference for Java callback"); + return; + } + + javaCallbackRef = env->NewGlobalRef(javaCallback); + if (javaCallbackRef == nullptr) + { + ChipLogError(Zcl, "Could not create global reference for Java callback"); + } +} + +CHIPEnergyEvseSessionDurationAttributeCallback::~CHIPEnergyEvseSessionDurationAttributeCallback() +{ + JNIEnv * env = chip::JniReferences::GetInstance().GetEnvForCurrentThread(); + if (env == nullptr) + { + ChipLogError(Zcl, "Could not delete global reference for Java callback"); + return; + } + env->DeleteGlobalRef(javaCallbackRef); +} + +void CHIPEnergyEvseSessionDurationAttributeCallback::CallbackFn(void * context, + const chip::app::DataModel::Nullable & value) +{ + chip::DeviceLayer::StackUnlock unlock; + CHIP_ERROR err = CHIP_NO_ERROR; + JNIEnv * env = chip::JniReferences::GetInstance().GetEnvForCurrentThread(); + jobject javaCallbackRef; + + VerifyOrReturn(env != nullptr, ChipLogError(Zcl, "Could not get JNI env")); + std::unique_ptr cppCallback( + reinterpret_cast(context), maybeDestroy); + + // It's valid for javaCallbackRef to be nullptr if the Java code passed in a null callback. + javaCallbackRef = cppCallback.get()->javaCallbackRef; + VerifyOrReturn(javaCallbackRef != nullptr, + ChipLogProgress(Zcl, "Early return from attribute callback since Java callback is null")); + + jmethodID javaMethod; + err = chip::JniReferences::GetInstance().FindMethod(env, javaCallbackRef, "onSuccess", "(Ljava/lang/Long;)V", &javaMethod); + VerifyOrReturn(err == CHIP_NO_ERROR, ChipLogError(Zcl, "Could not find onSuccess() method")); + + jobject javaValue; + if (value.IsNull()) + { + javaValue = nullptr; + } + else + { + std::string javaValueClassName = "java/lang/Long"; + std::string javaValueCtorSignature = "(J)V"; + jlong jnijavaValue = static_cast(value.Value()); + chip::JniReferences::GetInstance().CreateBoxedObject(javaValueClassName.c_str(), javaValueCtorSignature.c_str(), + jnijavaValue, javaValue); + } + + env->CallVoidMethod(javaCallbackRef, javaMethod, javaValue); +} + +CHIPEnergyEvseSessionEnergyChargedAttributeCallback::CHIPEnergyEvseSessionEnergyChargedAttributeCallback(jobject javaCallback, + bool keepAlive) : + chip::Callback::Callback(CallbackFn, this), keepAlive(keepAlive) +{ + JNIEnv * env = chip::JniReferences::GetInstance().GetEnvForCurrentThread(); + if (env == nullptr) + { + ChipLogError(Zcl, "Could not create global reference for Java callback"); + return; + } + + javaCallbackRef = env->NewGlobalRef(javaCallback); + if (javaCallbackRef == nullptr) + { + ChipLogError(Zcl, "Could not create global reference for Java callback"); + } +} + +CHIPEnergyEvseSessionEnergyChargedAttributeCallback::~CHIPEnergyEvseSessionEnergyChargedAttributeCallback() +{ + JNIEnv * env = chip::JniReferences::GetInstance().GetEnvForCurrentThread(); + if (env == nullptr) + { + ChipLogError(Zcl, "Could not delete global reference for Java callback"); + return; + } + env->DeleteGlobalRef(javaCallbackRef); +} + +void CHIPEnergyEvseSessionEnergyChargedAttributeCallback::CallbackFn(void * context, + const chip::app::DataModel::Nullable & value) +{ + chip::DeviceLayer::StackUnlock unlock; + CHIP_ERROR err = CHIP_NO_ERROR; + JNIEnv * env = chip::JniReferences::GetInstance().GetEnvForCurrentThread(); + jobject javaCallbackRef; + + VerifyOrReturn(env != nullptr, ChipLogError(Zcl, "Could not get JNI env")); + std::unique_ptr cppCallback( + reinterpret_cast(context), maybeDestroy); + + // It's valid for javaCallbackRef to be nullptr if the Java code passed in a null callback. + javaCallbackRef = cppCallback.get()->javaCallbackRef; + VerifyOrReturn(javaCallbackRef != nullptr, + ChipLogProgress(Zcl, "Early return from attribute callback since Java callback is null")); + + jmethodID javaMethod; + err = chip::JniReferences::GetInstance().FindMethod(env, javaCallbackRef, "onSuccess", "(Ljava/lang/Long;)V", &javaMethod); + VerifyOrReturn(err == CHIP_NO_ERROR, ChipLogError(Zcl, "Could not find onSuccess() method")); + + jobject javaValue; + if (value.IsNull()) + { + javaValue = nullptr; + } + else + { + std::string javaValueClassName = "java/lang/Long"; + std::string javaValueCtorSignature = "(J)V"; + jlong jnijavaValue = static_cast(value.Value()); + chip::JniReferences::GetInstance().CreateBoxedObject(javaValueClassName.c_str(), javaValueCtorSignature.c_str(), + jnijavaValue, javaValue); + } + + env->CallVoidMethod(javaCallbackRef, javaMethod, javaValue); +} + +CHIPEnergyEvseSessionEnergyDischargedAttributeCallback::CHIPEnergyEvseSessionEnergyDischargedAttributeCallback(jobject javaCallback, + bool keepAlive) : + chip::Callback::Callback(CallbackFn, this), + keepAlive(keepAlive) +{ + JNIEnv * env = chip::JniReferences::GetInstance().GetEnvForCurrentThread(); + if (env == nullptr) + { + ChipLogError(Zcl, "Could not create global reference for Java callback"); + return; + } + + javaCallbackRef = env->NewGlobalRef(javaCallback); + if (javaCallbackRef == nullptr) + { + ChipLogError(Zcl, "Could not create global reference for Java callback"); + } +} + +CHIPEnergyEvseSessionEnergyDischargedAttributeCallback::~CHIPEnergyEvseSessionEnergyDischargedAttributeCallback() +{ + JNIEnv * env = chip::JniReferences::GetInstance().GetEnvForCurrentThread(); + if (env == nullptr) + { + ChipLogError(Zcl, "Could not delete global reference for Java callback"); + return; + } + env->DeleteGlobalRef(javaCallbackRef); +} + +void CHIPEnergyEvseSessionEnergyDischargedAttributeCallback::CallbackFn(void * context, + const chip::app::DataModel::Nullable & value) +{ + chip::DeviceLayer::StackUnlock unlock; + CHIP_ERROR err = CHIP_NO_ERROR; + JNIEnv * env = chip::JniReferences::GetInstance().GetEnvForCurrentThread(); + jobject javaCallbackRef; + + VerifyOrReturn(env != nullptr, ChipLogError(Zcl, "Could not get JNI env")); + std::unique_ptr cppCallback( + reinterpret_cast(context), maybeDestroy); + + // It's valid for javaCallbackRef to be nullptr if the Java code passed in a null callback. + javaCallbackRef = cppCallback.get()->javaCallbackRef; + VerifyOrReturn(javaCallbackRef != nullptr, + ChipLogProgress(Zcl, "Early return from attribute callback since Java callback is null")); + + jmethodID javaMethod; + err = chip::JniReferences::GetInstance().FindMethod(env, javaCallbackRef, "onSuccess", "(Ljava/lang/Long;)V", &javaMethod); + VerifyOrReturn(err == CHIP_NO_ERROR, ChipLogError(Zcl, "Could not find onSuccess() method")); + + jobject javaValue; + if (value.IsNull()) + { + javaValue = nullptr; + } + else + { + std::string javaValueClassName = "java/lang/Long"; + std::string javaValueCtorSignature = "(J)V"; + jlong jnijavaValue = static_cast(value.Value()); + chip::JniReferences::GetInstance().CreateBoxedObject(javaValueClassName.c_str(), javaValueCtorSignature.c_str(), + jnijavaValue, javaValue); + } + + env->CallVoidMethod(javaCallbackRef, javaMethod, javaValue); +} + CHIPEnergyEvseGeneratedCommandListAttributeCallback::CHIPEnergyEvseGeneratedCommandListAttributeCallback(jobject javaCallback, bool keepAlive) : chip::Callback::Callback(CallbackFn, this), keepAlive(keepAlive) diff --git a/src/controller/python/chip/clusters/Objects.py b/src/controller/python/chip/clusters/Objects.py index 735228c9725f71..5fd82a3382a339 100644 --- a/src/controller/python/chip/clusters/Objects.py +++ b/src/controller/python/chip/clusters/Objects.py @@ -23780,9 +23780,9 @@ def descriptor(cls) -> ClusterObjectDescriptor: 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="sessionDuration", Tag=0x00000041, Type=typing.Union[Nullable, uint]), + ClusterObjectFieldDescriptor(Label="sessionEnergyCharged", Tag=0x00000042, Type=typing.Union[Nullable, int]), + ClusterObjectFieldDescriptor(Label="sessionEnergyDischarged", Tag=0x00000043, Type=typing.Union[None, Nullable, 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]), @@ -23813,9 +23813,9 @@ def descriptor(cls) -> ClusterObjectDescriptor: 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 + sessionDuration: 'typing.Union[Nullable, uint]' = None + sessionEnergyCharged: 'typing.Union[Nullable, int]' = None + sessionEnergyDischarged: 'typing.Union[None, Nullable, int]' = None generatedCommandList: 'typing.List[uint]' = None acceptedCommandList: 'typing.List[uint]' = None eventList: 'typing.List[uint]' = None @@ -23908,12 +23908,12 @@ class ChargingTargetStruct(ClusterObject): def descriptor(cls) -> ClusterObjectDescriptor: return ClusterObjectDescriptor( Fields=[ - ClusterObjectFieldDescriptor(Label="targetTime", Tag=0, Type=uint), + ClusterObjectFieldDescriptor(Label="targetTimeMinutesPastMidnight", 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 + targetTimeMinutesPastMidnight: 'uint' = 0 targetSoC: 'typing.Optional[uint]' = None addedEnergy: 'typing.Optional[int]' = None @@ -24440,9 +24440,9 @@ def attribute_id(cls) -> int: @ChipUtility.classproperty def attribute_type(cls) -> ClusterObjectFieldDescriptor: - return ClusterObjectFieldDescriptor(Type=uint) + return ClusterObjectFieldDescriptor(Type=typing.Union[Nullable, uint]) - value: 'uint' = 0 + value: 'typing.Union[Nullable, uint]' = NullValue @dataclass class SessionEnergyCharged(ClusterAttributeDescriptor): @@ -24456,9 +24456,9 @@ def attribute_id(cls) -> int: @ChipUtility.classproperty def attribute_type(cls) -> ClusterObjectFieldDescriptor: - return ClusterObjectFieldDescriptor(Type=int) + return ClusterObjectFieldDescriptor(Type=typing.Union[Nullable, int]) - value: 'int' = 0 + value: 'typing.Union[Nullable, int]' = NullValue @dataclass class SessionEnergyDischarged(ClusterAttributeDescriptor): @@ -24472,9 +24472,9 @@ def attribute_id(cls) -> int: @ChipUtility.classproperty def attribute_type(cls) -> ClusterObjectFieldDescriptor: - return ClusterObjectFieldDescriptor(Type=typing.Optional[int]) + return ClusterObjectFieldDescriptor(Type=typing.Union[None, Nullable, int]) - value: 'typing.Optional[int]' = None + value: 'typing.Union[None, Nullable, int]' = None @dataclass class GeneratedCommandList(ClusterAttributeDescriptor): @@ -24681,13 +24681,13 @@ def event_id(cls) -> int: def descriptor(cls) -> ClusterObjectDescriptor: return ClusterObjectDescriptor( Fields=[ - ClusterObjectFieldDescriptor(Label="sessionID", Tag=0, Type=uint), + ClusterObjectFieldDescriptor(Label="sessionID", Tag=0, Type=typing.Union[Nullable, 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 + sessionID: 'typing.Union[Nullable, uint]' = NullValue state: 'EnergyEvse.Enums.StateEnum' = 0 faultStatePreviousState: 'EnergyEvse.Enums.FaultStateEnum' = 0 faultStateCurrentState: 'EnergyEvse.Enums.FaultStateEnum' = 0 diff --git a/src/darwin/Framework/CHIP/zap-generated/MTRAttributeTLVValueDecoder.mm b/src/darwin/Framework/CHIP/zap-generated/MTRAttributeTLVValueDecoder.mm index 2deb87873533aa..25d41e9c8bf966 100644 --- a/src/darwin/Framework/CHIP/zap-generated/MTRAttributeTLVValueDecoder.mm +++ b/src/darwin/Framework/CHIP/zap-generated/MTRAttributeTLVValueDecoder.mm @@ -8723,8 +8723,12 @@ static id _Nullable DecodeAttributeValueForEnergyEVSECluster(AttributeId aAttrib if (*aError != CHIP_NO_ERROR) { return nil; } - NSNumber * _Nonnull value; - value = [NSNumber numberWithUnsignedInt:cppValue]; + NSNumber * _Nullable value; + if (cppValue.IsNull()) { + value = nil; + } else { + value = [NSNumber numberWithUnsignedInt:cppValue.Value()]; + } return value; } case Attributes::SessionEnergyCharged::Id: { @@ -8734,8 +8738,12 @@ static id _Nullable DecodeAttributeValueForEnergyEVSECluster(AttributeId aAttrib if (*aError != CHIP_NO_ERROR) { return nil; } - NSNumber * _Nonnull value; - value = [NSNumber numberWithLongLong:cppValue]; + NSNumber * _Nullable value; + if (cppValue.IsNull()) { + value = nil; + } else { + value = [NSNumber numberWithLongLong:cppValue.Value()]; + } return value; } case Attributes::SessionEnergyDischarged::Id: { @@ -8745,8 +8753,12 @@ static id _Nullable DecodeAttributeValueForEnergyEVSECluster(AttributeId aAttrib if (*aError != CHIP_NO_ERROR) { return nil; } - NSNumber * _Nonnull value; - value = [NSNumber numberWithLongLong:cppValue]; + NSNumber * _Nullable value; + if (cppValue.IsNull()) { + value = nil; + } else { + value = [NSNumber numberWithLongLong:cppValue.Value()]; + } return value; } default: { diff --git a/src/darwin/Framework/CHIP/zap-generated/MTRCommandPayloadsObjc.mm b/src/darwin/Framework/CHIP/zap-generated/MTRCommandPayloadsObjc.mm index f9cfc8e297a801..5d47571ec5ad3e 100644 --- a/src/darwin/Framework/CHIP/zap-generated/MTRCommandPayloadsObjc.mm +++ b/src/darwin/Framework/CHIP/zap-generated/MTRCommandPayloadsObjc.mm @@ -16910,7 +16910,7 @@ - (CHIP_ERROR)_setFieldsFromDecodableStruct:(const chip::app::Clusters::EnergyEv auto & entry_0 = iter_0.GetValue(); MTREnergyEVSEClusterChargingTargetStruct * newElement_0; newElement_0 = [MTREnergyEVSEClusterChargingTargetStruct new]; - newElement_0.targetTime = [NSNumber numberWithUnsignedShort:entry_0.targetTime]; + newElement_0.targetTimeMinutesPastMidnight = [NSNumber numberWithUnsignedShort:entry_0.targetTimeMinutesPastMidnight]; if (entry_0.targetSoC.HasValue()) { newElement_0.targetSoC = [NSNumber numberWithUnsignedChar:entry_0.targetSoC.Value()]; } else { @@ -17326,7 +17326,7 @@ - (CHIP_ERROR)_encodeToTLVReader:(chip::System::PacketBufferTLVReader &)reader return CHIP_ERROR_INVALID_ARGUMENT; } auto element_0 = (MTREnergyEVSEClusterChargingTargetStruct *) self.chargingTargets[i_0]; - listHolder_0->mList[i_0].targetTime = element_0.targetTime.unsignedShortValue; + listHolder_0->mList[i_0].targetTimeMinutesPastMidnight = element_0.targetTimeMinutesPastMidnight.unsignedShortValue; if (element_0.targetSoC != nil) { auto & definedValue_2 = listHolder_0->mList[i_0].targetSoC.Emplace(); definedValue_2 = element_0.targetSoC.unsignedCharValue; diff --git a/src/darwin/Framework/CHIP/zap-generated/MTREventTLVValueDecoder.mm b/src/darwin/Framework/CHIP/zap-generated/MTREventTLVValueDecoder.mm index c9a38080b463dc..fdffaae3ca3761 100644 --- a/src/darwin/Framework/CHIP/zap-generated/MTREventTLVValueDecoder.mm +++ b/src/darwin/Framework/CHIP/zap-generated/MTREventTLVValueDecoder.mm @@ -2978,8 +2978,12 @@ static id _Nullable DecodeEventPayloadForEnergyEVSECluster(EventId aEventId, TLV __auto_type * value = [MTREnergyEVSEClusterFaultEvent new]; do { - NSNumber * _Nonnull memberValue; - memberValue = [NSNumber numberWithUnsignedInt:cppValue.sessionID]; + NSNumber * _Nullable memberValue; + if (cppValue.sessionID.IsNull()) { + memberValue = nil; + } else { + memberValue = [NSNumber numberWithUnsignedInt:cppValue.sessionID.Value()]; + } value.sessionID = memberValue; } while (0); do { diff --git a/src/darwin/Framework/CHIP/zap-generated/MTRStructsObjc.h b/src/darwin/Framework/CHIP/zap-generated/MTRStructsObjc.h index 6242c7e9460229..f76506226b4701 100644 --- a/src/darwin/Framework/CHIP/zap-generated/MTRStructsObjc.h +++ b/src/darwin/Framework/CHIP/zap-generated/MTRStructsObjc.h @@ -1275,7 +1275,7 @@ MTR_PROVISIONALLY_AVAILABLE MTR_PROVISIONALLY_AVAILABLE @interface MTREnergyEVSEClusterChargingTargetStruct : NSObject -@property (nonatomic, copy) NSNumber * _Nonnull targetTime MTR_PROVISIONALLY_AVAILABLE; +@property (nonatomic, copy) NSNumber * _Nonnull targetTimeMinutesPastMidnight MTR_PROVISIONALLY_AVAILABLE; @property (nonatomic, copy) NSNumber * _Nullable targetSoC MTR_PROVISIONALLY_AVAILABLE; @property (nonatomic, copy) NSNumber * _Nullable addedEnergy MTR_PROVISIONALLY_AVAILABLE; @end @@ -1311,7 +1311,7 @@ MTR_PROVISIONALLY_AVAILABLE MTR_PROVISIONALLY_AVAILABLE @interface MTREnergyEVSEClusterFaultEvent : NSObject -@property (nonatomic, copy) NSNumber * _Nonnull sessionID MTR_PROVISIONALLY_AVAILABLE; +@property (nonatomic, copy) NSNumber * _Nullable 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; diff --git a/src/darwin/Framework/CHIP/zap-generated/MTRStructsObjc.mm b/src/darwin/Framework/CHIP/zap-generated/MTRStructsObjc.mm index 06be97e69ee61b..4c08c7228fd870 100644 --- a/src/darwin/Framework/CHIP/zap-generated/MTRStructsObjc.mm +++ b/src/darwin/Framework/CHIP/zap-generated/MTRStructsObjc.mm @@ -5203,7 +5203,7 @@ - (instancetype)init { if (self = [super init]) { - _targetTime = @(0); + _targetTimeMinutesPastMidnight = @(0); _targetSoC = nil; @@ -5216,7 +5216,7 @@ - (id)copyWithZone:(NSZone * _Nullable)zone { auto other = [[MTREnergyEVSEClusterChargingTargetStruct alloc] init]; - other.targetTime = self.targetTime; + other.targetTimeMinutesPastMidnight = self.targetTimeMinutesPastMidnight; other.targetSoC = self.targetSoC; other.addedEnergy = self.addedEnergy; @@ -5225,7 +5225,7 @@ - (id)copyWithZone:(NSZone * _Nullable)zone - (NSString *)description { - NSString * descriptionString = [NSString stringWithFormat:@"<%@: targetTime:%@; targetSoC:%@; addedEnergy:%@; >", NSStringFromClass([self class]), _targetTime, _targetSoC, _addedEnergy]; + NSString * descriptionString = [NSString stringWithFormat:@"<%@: targetTimeMinutesPastMidnight:%@; targetSoC:%@; addedEnergy:%@; >", NSStringFromClass([self class]), _targetTimeMinutesPastMidnight, _targetSoC, _addedEnergy]; return descriptionString; } @@ -5371,7 +5371,7 @@ - (instancetype)init { if (self = [super init]) { - _sessionID = @(0); + _sessionID = nil; _state = @(0); 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 6a1c629033c162..83d5f86a3a7f12 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 @@ -10605,7 +10605,7 @@ EmberAfStatus Set(chip::EndpointId endpoint, int64_t value) Traits::StorageType storageValue; Traits::WorkingToStorage(value, storageValue); uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue); - return emberAfWriteAttribute(endpoint, Clusters::DeviceEnergyManagement::Id, Id, writable, ZCL_INT64S_ATTRIBUTE_TYPE); + return emberAfWriteAttribute(endpoint, Clusters::DeviceEnergyManagement::Id, Id, writable, ZCL_POWER_MW_ATTRIBUTE_TYPE); } } // namespace AbsMinPower @@ -10636,7 +10636,7 @@ EmberAfStatus Set(chip::EndpointId endpoint, int64_t value) Traits::StorageType storageValue; Traits::WorkingToStorage(value, storageValue); uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue); - return emberAfWriteAttribute(endpoint, Clusters::DeviceEnergyManagement::Id, Id, writable, ZCL_INT64S_ATTRIBUTE_TYPE); + return emberAfWriteAttribute(endpoint, Clusters::DeviceEnergyManagement::Id, Id, writable, ZCL_POWER_MW_ATTRIBUTE_TYPE); } } // namespace AbsMaxPower @@ -11654,24 +11654,27 @@ EmberAfStatus Set(chip::EndpointId endpoint, const chip::app::DataModel::Nullabl namespace SessionDuration { -EmberAfStatus Get(chip::EndpointId endpoint, uint32_t * value) +EmberAfStatus Get(chip::EndpointId endpoint, DataModel::Nullable & value) { using Traits = NumericAttributeTraits; Traits::StorageType temp; uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp); EmberAfStatus status = emberAfReadAttribute(endpoint, Clusters::EnergyEvse::Id, Id, readable, sizeof(temp)); VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); - if (!Traits::CanRepresentValue(/* isNullable = */ false, temp)) + if (Traits::IsNullValue(temp)) { - return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; + value.SetNull(); + } + else + { + value.SetNonNull() = Traits::StorageToWorking(temp); } - *value = Traits::StorageToWorking(temp); return status; } EmberAfStatus Set(chip::EndpointId endpoint, uint32_t value) { using Traits = NumericAttributeTraits; - if (!Traits::CanRepresentValue(/* isNullable = */ false, value)) + if (!Traits::CanRepresentValue(/* isNullable = */ true, value)) { return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; } @@ -11681,28 +11684,50 @@ EmberAfStatus Set(chip::EndpointId endpoint, uint32_t value) return emberAfWriteAttribute(endpoint, Clusters::EnergyEvse::Id, Id, writable, ZCL_ELAPSED_S_ATTRIBUTE_TYPE); } +EmberAfStatus SetNull(chip::EndpointId endpoint) +{ + using Traits = NumericAttributeTraits; + Traits::StorageType value; + Traits::SetNull(value); + uint8_t * writable = Traits::ToAttributeStoreRepresentation(value); + return emberAfWriteAttribute(endpoint, Clusters::EnergyEvse::Id, Id, writable, ZCL_ELAPSED_S_ATTRIBUTE_TYPE); +} + +EmberAfStatus Set(chip::EndpointId endpoint, const chip::app::DataModel::Nullable & value) +{ + if (value.IsNull()) + { + return SetNull(endpoint); + } + + return Set(endpoint, value.Value()); +} + } // namespace SessionDuration namespace SessionEnergyCharged { -EmberAfStatus Get(chip::EndpointId endpoint, int64_t * value) +EmberAfStatus Get(chip::EndpointId endpoint, DataModel::Nullable & value) { using Traits = NumericAttributeTraits; Traits::StorageType temp; uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp); EmberAfStatus status = emberAfReadAttribute(endpoint, Clusters::EnergyEvse::Id, Id, readable, sizeof(temp)); VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); - if (!Traits::CanRepresentValue(/* isNullable = */ false, temp)) + if (Traits::IsNullValue(temp)) { - return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; + value.SetNull(); + } + else + { + value.SetNonNull() = Traits::StorageToWorking(temp); } - *value = Traits::StorageToWorking(temp); return status; } EmberAfStatus Set(chip::EndpointId endpoint, int64_t value) { using Traits = NumericAttributeTraits; - if (!Traits::CanRepresentValue(/* isNullable = */ false, value)) + if (!Traits::CanRepresentValue(/* isNullable = */ true, value)) { return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; } @@ -11712,28 +11737,50 @@ EmberAfStatus Set(chip::EndpointId endpoint, int64_t value) return emberAfWriteAttribute(endpoint, Clusters::EnergyEvse::Id, Id, writable, ZCL_ENERGY_MWH_ATTRIBUTE_TYPE); } +EmberAfStatus SetNull(chip::EndpointId endpoint) +{ + using Traits = NumericAttributeTraits; + Traits::StorageType value; + Traits::SetNull(value); + uint8_t * writable = Traits::ToAttributeStoreRepresentation(value); + return emberAfWriteAttribute(endpoint, Clusters::EnergyEvse::Id, Id, writable, ZCL_ENERGY_MWH_ATTRIBUTE_TYPE); +} + +EmberAfStatus Set(chip::EndpointId endpoint, const chip::app::DataModel::Nullable & value) +{ + if (value.IsNull()) + { + return SetNull(endpoint); + } + + return Set(endpoint, value.Value()); +} + } // namespace SessionEnergyCharged namespace SessionEnergyDischarged { -EmberAfStatus Get(chip::EndpointId endpoint, int64_t * value) +EmberAfStatus Get(chip::EndpointId endpoint, DataModel::Nullable & value) { using Traits = NumericAttributeTraits; Traits::StorageType temp; uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp); EmberAfStatus status = emberAfReadAttribute(endpoint, Clusters::EnergyEvse::Id, Id, readable, sizeof(temp)); VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); - if (!Traits::CanRepresentValue(/* isNullable = */ false, temp)) + if (Traits::IsNullValue(temp)) { - return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; + value.SetNull(); + } + else + { + value.SetNonNull() = Traits::StorageToWorking(temp); } - *value = Traits::StorageToWorking(temp); return status; } EmberAfStatus Set(chip::EndpointId endpoint, int64_t value) { using Traits = NumericAttributeTraits; - if (!Traits::CanRepresentValue(/* isNullable = */ false, value)) + if (!Traits::CanRepresentValue(/* isNullable = */ true, value)) { return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; } @@ -11743,6 +11790,25 @@ EmberAfStatus Set(chip::EndpointId endpoint, int64_t value) return emberAfWriteAttribute(endpoint, Clusters::EnergyEvse::Id, Id, writable, ZCL_ENERGY_MWH_ATTRIBUTE_TYPE); } +EmberAfStatus SetNull(chip::EndpointId endpoint) +{ + using Traits = NumericAttributeTraits; + Traits::StorageType value; + Traits::SetNull(value); + uint8_t * writable = Traits::ToAttributeStoreRepresentation(value); + return emberAfWriteAttribute(endpoint, Clusters::EnergyEvse::Id, Id, writable, ZCL_ENERGY_MWH_ATTRIBUTE_TYPE); +} + +EmberAfStatus Set(chip::EndpointId endpoint, const chip::app::DataModel::Nullable & value) +{ + if (value.IsNull()) + { + return SetNull(endpoint); + } + + return Set(endpoint, value.Value()); +} + } // namespace SessionEnergyDischarged namespace FeatureMap { diff --git a/zzz_generated/app-common/app-common/zap-generated/attributes/Accessors.h b/zzz_generated/app-common/app-common/zap-generated/attributes/Accessors.h index 0b8661dd0f728d..290cbf692f2d04 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 @@ -2049,12 +2049,12 @@ EmberAfStatus Set(chip::EndpointId endpoint, chip::app::Clusters::DeviceEnergyMa } // namespace ESAState namespace AbsMinPower { -EmberAfStatus Get(chip::EndpointId endpoint, int64_t * value); // int64s +EmberAfStatus Get(chip::EndpointId endpoint, int64_t * value); // power_mw EmberAfStatus Set(chip::EndpointId endpoint, int64_t value); } // namespace AbsMinPower namespace AbsMaxPower { -EmberAfStatus Get(chip::EndpointId endpoint, int64_t * value); // int64s +EmberAfStatus Get(chip::EndpointId endpoint, int64_t * value); // power_mw EmberAfStatus Set(chip::EndpointId endpoint, int64_t value); } // namespace AbsMaxPower @@ -2210,18 +2210,24 @@ EmberAfStatus Set(chip::EndpointId endpoint, const chip::app::DataModel::Nullabl } // namespace SessionID namespace SessionDuration { -EmberAfStatus Get(chip::EndpointId endpoint, uint32_t * value); // elapsed_s +EmberAfStatus Get(chip::EndpointId endpoint, DataModel::Nullable & value); // elapsed_s EmberAfStatus Set(chip::EndpointId endpoint, uint32_t value); +EmberAfStatus SetNull(chip::EndpointId endpoint); +EmberAfStatus Set(chip::EndpointId endpoint, const chip::app::DataModel::Nullable & value); } // namespace SessionDuration namespace SessionEnergyCharged { -EmberAfStatus Get(chip::EndpointId endpoint, int64_t * value); // energy_mwh +EmberAfStatus Get(chip::EndpointId endpoint, DataModel::Nullable & value); // energy_mwh EmberAfStatus Set(chip::EndpointId endpoint, int64_t value); +EmberAfStatus SetNull(chip::EndpointId endpoint); +EmberAfStatus Set(chip::EndpointId endpoint, const chip::app::DataModel::Nullable & value); } // namespace SessionEnergyCharged namespace SessionEnergyDischarged { -EmberAfStatus Get(chip::EndpointId endpoint, int64_t * value); // energy_mwh +EmberAfStatus Get(chip::EndpointId endpoint, DataModel::Nullable & value); // energy_mwh EmberAfStatus Set(chip::EndpointId endpoint, int64_t value); +EmberAfStatus SetNull(chip::EndpointId endpoint); +EmberAfStatus Set(chip::EndpointId endpoint, const chip::app::DataModel::Nullable & value); } // namespace SessionEnergyDischarged namespace FeatureMap { diff --git a/zzz_generated/app-common/app-common/zap-generated/cluster-objects.cpp b/zzz_generated/app-common/app-common/zap-generated/cluster-objects.cpp index 4869634c35461f..99196eceb6effc 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 @@ -15763,7 +15763,7 @@ 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::kTargetTimeMinutesPastMidnight), targetTimeMinutesPastMidnight); encoder.Encode(to_underlying(Fields::kTargetSoC), targetSoC); encoder.Encode(to_underlying(Fields::kAddedEnergy), addedEnergy); return encoder.Finalize(); @@ -15783,9 +15783,9 @@ CHIP_ERROR DecodableType::Decode(TLV::TLVReader & reader) CHIP_ERROR err = CHIP_NO_ERROR; const uint8_t __context_tag = std::get(__element); - if (__context_tag == to_underlying(Fields::kTargetTime)) + if (__context_tag == to_underlying(Fields::kTargetTimeMinutesPastMidnight)) { - err = DataModel::Decode(reader, targetTime); + err = DataModel::Decode(reader, targetTimeMinutesPastMidnight); } else if (__context_tag == to_underlying(Fields::kTargetSoC)) { 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 9438ed24a7cd5f..7c90c8a9d5a3e1 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 @@ -21865,15 +21865,15 @@ namespace Structs { namespace ChargingTargetStruct { enum class Fields : uint8_t { - kTargetTime = 0, - kTargetSoC = 1, - kAddedEnergy = 2, + kTargetTimeMinutesPastMidnight = 0, + kTargetSoC = 1, + kAddedEnergy = 2, }; struct Type { public: - uint16_t targetTime = static_cast(0); + uint16_t targetTimeMinutesPastMidnight = static_cast(0); Optional targetSoC; Optional addedEnergy; @@ -22466,9 +22466,9 @@ struct TypeInfo namespace SessionDuration { struct TypeInfo { - using Type = uint32_t; - using DecodableType = uint32_t; - using DecodableArgType = uint32_t; + using Type = chip::app::DataModel::Nullable; + using DecodableType = chip::app::DataModel::Nullable; + using DecodableArgType = const chip::app::DataModel::Nullable &; static constexpr ClusterId GetClusterId() { return Clusters::EnergyEvse::Id; } static constexpr AttributeId GetAttributeId() { return Attributes::SessionDuration::Id; } @@ -22478,9 +22478,9 @@ struct TypeInfo namespace SessionEnergyCharged { struct TypeInfo { - using Type = int64_t; - using DecodableType = int64_t; - using DecodableArgType = int64_t; + using Type = chip::app::DataModel::Nullable; + using DecodableType = chip::app::DataModel::Nullable; + using DecodableArgType = const chip::app::DataModel::Nullable &; static constexpr ClusterId GetClusterId() { return Clusters::EnergyEvse::Id; } static constexpr AttributeId GetAttributeId() { return Attributes::SessionEnergyCharged::Id; } @@ -22490,9 +22490,9 @@ struct TypeInfo namespace SessionEnergyDischarged { struct TypeInfo { - using Type = int64_t; - using DecodableType = int64_t; - using DecodableArgType = int64_t; + using Type = chip::app::DataModel::Nullable; + using DecodableType = chip::app::DataModel::Nullable; + using DecodableArgType = const chip::app::DataModel::Nullable &; static constexpr ClusterId GetClusterId() { return Clusters::EnergyEvse::Id; } static constexpr AttributeId GetAttributeId() { return Attributes::SessionEnergyDischarged::Id; } @@ -22568,9 +22568,9 @@ struct TypeInfo Attributes::BatteryCapacity::TypeInfo::DecodableType batteryCapacity; Attributes::VehicleID::TypeInfo::DecodableType vehicleID; Attributes::SessionID::TypeInfo::DecodableType sessionID; - Attributes::SessionDuration::TypeInfo::DecodableType sessionDuration = static_cast(0); - Attributes::SessionEnergyCharged::TypeInfo::DecodableType sessionEnergyCharged = static_cast(0); - Attributes::SessionEnergyDischarged::TypeInfo::DecodableType sessionEnergyDischarged = static_cast(0); + Attributes::SessionDuration::TypeInfo::DecodableType sessionDuration; + Attributes::SessionEnergyCharged::TypeInfo::DecodableType sessionEnergyCharged; + Attributes::SessionEnergyDischarged::TypeInfo::DecodableType sessionEnergyDischarged; Attributes::GeneratedCommandList::TypeInfo::DecodableType generatedCommandList; Attributes::AcceptedCommandList::TypeInfo::DecodableType acceptedCommandList; Attributes::EventList::TypeInfo::DecodableType eventList; @@ -22759,7 +22759,7 @@ struct Type static constexpr ClusterId GetClusterId() { return Clusters::EnergyEvse::Id; } static constexpr bool kIsFabricScoped = false; - uint32_t sessionID = static_cast(0); + DataModel::Nullable sessionID; StateEnum state = static_cast(0); FaultStateEnum faultStatePreviousState = static_cast(0); FaultStateEnum faultStateCurrentState = static_cast(0); @@ -22774,7 +22774,7 @@ struct DecodableType static constexpr EventId GetEventId() { return Events::Fault::Id; } static constexpr ClusterId GetClusterId() { return Clusters::EnergyEvse::Id; } - uint32_t sessionID = static_cast(0); + DataModel::Nullable sessionID; StateEnum state = static_cast(0); FaultStateEnum faultStatePreviousState = static_cast(0); FaultStateEnum faultStateCurrentState = static_cast(0); diff --git a/zzz_generated/chip-tool/zap-generated/cluster/Commands.h b/zzz_generated/chip-tool/zap-generated/cluster/Commands.h index 82097029565e8f..7948d81d41f181 100644 --- a/zzz_generated/chip-tool/zap-generated/cluster/Commands.h +++ b/zzz_generated/chip-tool/zap-generated/cluster/Commands.h @@ -6874,7 +6874,7 @@ class DeviceEnergyManagementPowerAdjustRequest : public ClusterCommand DeviceEnergyManagementPowerAdjustRequest(CredentialIssuerCommands * credsIssuerConfig) : ClusterCommand("power-adjust-request", credsIssuerConfig) { - AddArgument("Power", INT64_MIN, INT64_MAX, &mRequest.power); + AddArgument("Power", 0, UINT64_MAX, &mRequest.power); AddArgument("Duration", 0, UINT32_MAX, &mRequest.duration); ClusterCommand::AddArguments(); } @@ -19583,9 +19583,9 @@ void registerClusterDeviceEnergyManagement(Commands & commands, CredentialIssuer WriteCommandType::kForceWrite, credsIssuerConfig), // make_unique>( Id, "esastate", 0, UINT8_MAX, Attributes::ESAState::Id, WriteCommandType::kForceWrite, credsIssuerConfig), // - make_unique>(Id, "abs-min-power", INT64_MIN, INT64_MAX, Attributes::AbsMinPower::Id, + make_unique>(Id, "abs-min-power", 0, UINT64_MAX, Attributes::AbsMinPower::Id, WriteCommandType::kForceWrite, credsIssuerConfig), // - make_unique>(Id, "abs-max-power", INT64_MIN, INT64_MAX, Attributes::AbsMaxPower::Id, + make_unique>(Id, "abs-max-power", 0, UINT64_MAX, Attributes::AbsMaxPower::Id, WriteCommandType::kForceWrite, credsIssuerConfig), // make_unique>>>( @@ -19752,13 +19752,15 @@ void registerClusterEnergyEvse(Commands & commands, CredentialIssuerCommands * c Id, "vehicle-id", Attributes::VehicleID::Id, WriteCommandType::kForceWrite, credsIssuerConfig), // make_unique>>( Id, "session-id", 0, UINT32_MAX, Attributes::SessionID::Id, WriteCommandType::kForceWrite, credsIssuerConfig), // - make_unique>(Id, "session-duration", 0, UINT32_MAX, Attributes::SessionDuration::Id, - WriteCommandType::kForceWrite, credsIssuerConfig), // - make_unique>(Id, "session-energy-charged", 0, UINT64_MAX, Attributes::SessionEnergyCharged::Id, - WriteCommandType::kForceWrite, credsIssuerConfig), // - make_unique>(Id, "session-energy-discharged", 0, UINT64_MAX, - Attributes::SessionEnergyDischarged::Id, WriteCommandType::kForceWrite, - credsIssuerConfig), // + make_unique>>(Id, "session-duration", 0, UINT32_MAX, + Attributes::SessionDuration::Id, + WriteCommandType::kForceWrite, credsIssuerConfig), // + make_unique>>(Id, "session-energy-charged", 0, UINT64_MAX, + Attributes::SessionEnergyCharged::Id, + WriteCommandType::kForceWrite, credsIssuerConfig), // + make_unique>>(Id, "session-energy-discharged", 0, UINT64_MAX, + Attributes::SessionEnergyDischarged::Id, + WriteCommandType::kForceWrite, credsIssuerConfig), // make_unique>>( Id, "generated-command-list", Attributes::GeneratedCommandList::Id, WriteCommandType::kForceWrite, credsIssuerConfig), // diff --git a/zzz_generated/chip-tool/zap-generated/cluster/ComplexArgumentParser.cpp b/zzz_generated/chip-tool/zap-generated/cluster/ComplexArgumentParser.cpp index 7aeb538c962c95..155f91f1db84c9 100644 --- a/zzz_generated/chip-tool/zap-generated/cluster/ComplexArgumentParser.cpp +++ b/zzz_generated/chip-tool/zap-generated/cluster/ComplexArgumentParser.cpp @@ -3215,13 +3215,15 @@ CHIP_ERROR ComplexArgumentParser::Setup(const char * label, // Copy to track which members we already processed. Json::Value valueCopy(value); - ReturnErrorOnFailure( - ComplexArgumentParser::EnsureMemberExist("ChargingTargetStruct.targetTime", "targetTime", value.isMember("targetTime"))); + ReturnErrorOnFailure(ComplexArgumentParser::EnsureMemberExist("ChargingTargetStruct.targetTimeMinutesPastMidnight", + "targetTimeMinutesPastMidnight", + value.isMember("targetTimeMinutesPastMidnight"))); char labelWithMember[kMaxLabelLength]; - snprintf(labelWithMember, sizeof(labelWithMember), "%s.%s", label, "targetTime"); - ReturnErrorOnFailure(ComplexArgumentParser::Setup(labelWithMember, request.targetTime, value["targetTime"])); - valueCopy.removeMember("targetTime"); + snprintf(labelWithMember, sizeof(labelWithMember), "%s.%s", label, "targetTimeMinutesPastMidnight"); + ReturnErrorOnFailure(ComplexArgumentParser::Setup(labelWithMember, request.targetTimeMinutesPastMidnight, + value["targetTimeMinutesPastMidnight"])); + valueCopy.removeMember("targetTimeMinutesPastMidnight"); if (value.isMember("targetSoC")) { @@ -3242,7 +3244,7 @@ CHIP_ERROR ComplexArgumentParser::Setup(const char * label, void ComplexArgumentParser::Finalize(chip::app::Clusters::EnergyEvse::Structs::ChargingTargetStruct::Type & request) { - ComplexArgumentParser::Finalize(request.targetTime); + ComplexArgumentParser::Finalize(request.targetTimeMinutesPastMidnight); ComplexArgumentParser::Finalize(request.targetSoC); ComplexArgumentParser::Finalize(request.addedEnergy); } 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 913a28be7583fc..6a56a914177981 100644 --- a/zzz_generated/chip-tool/zap-generated/cluster/logging/DataModelLogger.cpp +++ b/zzz_generated/chip-tool/zap-generated/cluster/logging/DataModelLogger.cpp @@ -2862,10 +2862,10 @@ CHIP_ERROR DataModelLogger::LogValue(const char * label, size_t indent, { DataModelLogger::LogString(label, indent, "{"); { - CHIP_ERROR err = LogValue("TargetTime", indent + 1, value.targetTime); + CHIP_ERROR err = LogValue("TargetTimeMinutesPastMidnight", indent + 1, value.targetTimeMinutesPastMidnight); if (err != CHIP_NO_ERROR) { - DataModelLogger::LogString(indent + 1, "Struct truncated due to invalid value for 'TargetTime'"); + DataModelLogger::LogString(indent + 1, "Struct truncated due to invalid value for 'TargetTimeMinutesPastMidnight'"); return err; } } @@ -12031,17 +12031,17 @@ CHIP_ERROR DataModelLogger::LogAttribute(const chip::app::ConcreteDataAttributeP return DataModelLogger::LogValue("SessionID", 1, value); } case EnergyEvse::Attributes::SessionDuration::Id: { - uint32_t value; + chip::app::DataModel::Nullable value; ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); return DataModelLogger::LogValue("SessionDuration", 1, value); } case EnergyEvse::Attributes::SessionEnergyCharged::Id: { - int64_t value; + chip::app::DataModel::Nullable value; ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); return DataModelLogger::LogValue("SessionEnergyCharged", 1, value); } case EnergyEvse::Attributes::SessionEnergyDischarged::Id: { - int64_t value; + chip::app::DataModel::Nullable value; ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); return DataModelLogger::LogValue("SessionEnergyDischarged", 1, value); } diff --git a/zzz_generated/darwin-framework-tool/zap-generated/cluster/Commands.h b/zzz_generated/darwin-framework-tool/zap-generated/cluster/Commands.h index fb850d2ede4e99..5ff2d4bff4737c 100644 --- a/zzz_generated/darwin-framework-tool/zap-generated/cluster/Commands.h +++ b/zzz_generated/darwin-framework-tool/zap-generated/cluster/Commands.h @@ -78700,7 +78700,7 @@ class DeviceEnergyManagementPowerAdjustRequest : public ClusterCommand { : ClusterCommand("power-adjust-request") { #if MTR_ENABLE_PROVISIONAL - AddArgument("Power", INT64_MIN, INT64_MAX, &mRequest.power); + AddArgument("Power", 0, UINT64_MAX, &mRequest.power); #endif // MTR_ENABLE_PROVISIONAL #if MTR_ENABLE_PROVISIONAL AddArgument("Duration", 0, UINT32_MAX, &mRequest.duration); @@ -80524,7 +80524,7 @@ class EnergyEvseSetTargets : public ClusterCommand { for (auto & entry_0 : mRequest.chargingTargets) { MTREnergyEVSEClusterChargingTargetStruct * newElement_0; newElement_0 = [MTREnergyEVSEClusterChargingTargetStruct new]; - newElement_0.targetTime = [NSNumber numberWithUnsignedShort:entry_0.targetTime]; + newElement_0.targetTimeMinutesPastMidnight = [NSNumber numberWithUnsignedShort:entry_0.targetTimeMinutesPastMidnight]; if (entry_0.targetSoC.HasValue()) { newElement_0.targetSoC = [NSNumber numberWithUnsignedChar:entry_0.targetSoC.Value()]; } else { From 460ca152898c432a4ccecf1873e66400f493fa26 Mon Sep 17 00:00:00 2001 From: "Restyled.io" Date: Fri, 15 Dec 2023 09:06:56 +0000 Subject: [PATCH 016/114] Restyled by whitespace --- src/app/zap-templates/common/override.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/app/zap-templates/common/override.js b/src/app/zap-templates/common/override.js index 098af41e5154e2..6930a0479f0fb7 100644 --- a/src/app/zap-templates/common/override.js +++ b/src/app/zap-templates/common/override.js @@ -78,7 +78,7 @@ function atomicType(arg) case 'amperage_ma': case 'voltage_mv': case 'energy_mwh': - return 'int64_t'; + return 'int64_t'; case 'epoch_us': case 'systime_us': case 'posix_ms': From 3caf114e7ac58632d43eca8ea8219822677312eb Mon Sep 17 00:00:00 2001 From: James Harrow Date: Fri, 15 Dec 2023 13:48:15 +0000 Subject: [PATCH 017/114] Regen_all after merging in changes for XML --- .../all-clusters-app.matter | 230 ++++++++++++++- .../all-clusters-common/all-clusters-app.zap | 273 +++++++++++++++++- 2 files changed, 485 insertions(+), 18 deletions(-) diff --git a/examples/all-clusters-app/all-clusters-common/all-clusters-app.matter b/examples/all-clusters-app/all-clusters-common/all-clusters-app.matter index 89e9aff9f175a3..59cbffcbaf7980 100644 --- a/examples/all-clusters-app/all-clusters-common/all-clusters-app.matter +++ b/examples/all-clusters-app/all-clusters-common/all-clusters-app.matter @@ -3786,13 +3786,13 @@ provisional cluster DeviceEnergyManagement = 152 { elapsed_s minPauseDuration = 6; elapsed_s maxPauseDuration = 7; optional int16u manufacturerESAState = 8; - optional int64s nominalPower = 9; - optional int64s minPower = 10; - optional int64s maxPower = 11; - optional int64s nominalEnergy = 12; + optional power_mw nominalPower = 9; + optional power_mw minPower = 10; + optional power_mw maxPower = 11; + optional energy_mwh nominalEnergy = 12; optional CostStruct costs[] = 13; - optional int64s minPowerAdjustment = 14; - optional int64s maxPowerAdjustment = 15; + optional power_mw minPowerAdjustment = 14; + optional power_mw maxPowerAdjustment = 15; optional elapsed_s minDurationAdjustment = 16; optional elapsed_s maxDurationAdjustment = 17; } @@ -3811,21 +3811,21 @@ provisional cluster DeviceEnergyManagement = 152 { struct ConstraintsStruct { epoch_s startTime = 0; elapsed_s duration = 1; - optional int64s nominalPower = 2; - optional int64s maximumEnergy = 3; + optional power_mw nominalPower = 2; + optional energy_mwh maximumEnergy = 3; optional int8s loadControl = 4; } struct PowerAdjustStruct { - int64s minPower = 0; - int64s maxPower = 1; + power_mw minPower = 0; + power_mw maxPower = 1; elapsed_s minDuration = 2; elapsed_s maxDuration = 3; } struct SlotAdjustmentStruct { int8u slotIndex = 0; - int64s nominalPower = 1; + power_mw nominalPower = 1; elapsed_s duration = 2; } @@ -3835,7 +3835,7 @@ provisional cluster DeviceEnergyManagement = 152 { info event PowerAdjustEnd = 1 { CauseEnum cause = 0; elapsed_s duration = 1; - int64s energyUse = 2; + energy_mwh energyUse = 2; } info event Paused = 2 { @@ -3847,8 +3847,8 @@ provisional cluster DeviceEnergyManagement = 152 { readonly attribute ESATypeEnum ESAType = 0; readonly attribute boolean ESACanGenerate = 1; readonly attribute ESAStateEnum ESAState = 2; - readonly attribute int64s absMinPower = 3; - readonly attribute int64s absMaxPower = 4; + readonly attribute power_mw absMinPower = 3; + readonly attribute power_mw absMaxPower = 4; readonly attribute optional nullable PowerAdjustStruct powerAdjustmentCapability[] = 5; readonly attribute optional nullable ForecastStruct forecast = 6; readonly attribute command_id generatedCommandList[] = 65528; @@ -3859,7 +3859,7 @@ provisional cluster DeviceEnergyManagement = 152 { readonly attribute int16u clusterRevision = 65533; request struct PowerAdjustRequestRequest { - int64s power = 0; + power_mw power = 0; elapsed_s duration = 1; } @@ -3896,6 +3896,187 @@ provisional cluster DeviceEnergyManagement = 152 { command RequestConstraintBasedForecast(RequestConstraintBasedForecastRequest): DefaultSuccess = 6; } +/** 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 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 targetTimeMinutesPastMidnight = 0; + optional percent targetSoC = 1; + optional energy_mwh addedEnergy = 2; + } + + info event EVConnected = 0 { + int32u sessionID = 0; + } + + info event EVNotDetected = 1 { + int32u sessionID = 0; + StateEnum state = 1; + elapsed_s sessionDuration = 2; + energy_mwh sessionEnergyCharged = 3; + optional energy_mwh sessionEnergyDischarged = 4; + } + + info event EnergyTransferStarted = 2 { + int32u sessionID = 0; + StateEnum state = 1; + amperage_ma maximumCurrent = 2; + } + + info event EnergyTransferStopped = 3 { + int32u sessionID = 0; + StateEnum state = 1; + EnergyTransferStoppedReasonEnum reason = 2; + energy_mwh energyTransferred = 4; + } + + critical event Fault = 4 { + nullable 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 amperage_ma circuitCapacity = 5; + readonly attribute amperage_ma minimumChargeCurrent = 6; + readonly attribute amperage_ma maximumChargeCurrent = 7; + readonly attribute optional amperage_ma maximumDischargeCurrent = 8; + attribute access(write: manage) optional amperage_ma userMaximumChargeCurrent = 9; + attribute access(write: manage) optional elapsed_s randomizationDelayWindow = 10; + readonly attribute optional int8u numberOfWeeklyTargets = 33; + readonly attribute optional int8u numberOfDailyTargets = 34; + readonly attribute optional nullable epoch_s nextChargeStartTime = 35; + readonly attribute optional nullable epoch_s nextChargeTargetTime = 36; + readonly attribute optional nullable energy_mwh nextChargeRequiredEnergy = 37; + 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 energy_mwh batteryCapacity = 49; + readonly attribute optional nullable char_string<32> vehicleID = 50; + readonly attribute nullable int32u sessionID = 64; + readonly attribute nullable elapsed_s sessionDuration = 65; + readonly attribute nullable energy_mwh sessionEnergyCharged = 66; + readonly attribute optional nullable energy_mwh 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; + amperage_ma minimumChargeCurrent = 1; + amperage_ma maximumChargeCurrent = 2; + } + + request struct EnableDischargingRequest { + nullable epoch_s dischargingEnabledUntil = 0; + amperage_ma 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; +} + /** Provides an interface for controlling and adjusting automatic window coverings. */ cluster WindowCovering = 258 { revision 5; @@ -7336,6 +7517,25 @@ endpoint 1 { ram attribute clusterRevision default = 2; } + server cluster EnergyEvse { + ram attribute state; + ram attribute supplyState; + ram attribute faultState; + ram attribute chargingEnabledUntil default = 0; + ram attribute circuitCapacity default = 0; + ram attribute minimumChargeCurrent default = 6000; + ram attribute maximumChargeCurrent default = 0; + ram attribute sessionID; + ram attribute sessionDuration; + ram attribute sessionEnergyCharged; + callback attribute generatedCommandList; + callback attribute acceptedCommandList; + callback attribute eventList; + callback attribute attributeList; + ram attribute featureMap default = 0; + ram attribute clusterRevision default = 2; + } + server cluster WindowCovering { ram attribute type default = 0x08; ram attribute physicalClosedLimitLift default = 0xFFFF; diff --git a/examples/all-clusters-app/all-clusters-common/all-clusters-app.zap b/examples/all-clusters-app/all-clusters-common/all-clusters-app.zap index aa1ae2ffb08f06..a1f1fc5c7be054 100644 --- a/examples/all-clusters-app/all-clusters-common/all-clusters-app.zap +++ b/examples/all-clusters-app/all-clusters-common/all-clusters-app.zap @@ -11791,7 +11791,7 @@ "code": 3, "mfgCode": null, "side": "server", - "type": "int64s", + "type": "power_mw", "included": 1, "storageOption": "External", "singleton": 0, @@ -11807,7 +11807,7 @@ "code": 4, "mfgCode": null, "side": "server", - "type": "int64s", + "type": "power_mw", "included": 1, "storageOption": "External", "singleton": 0, @@ -11828,7 +11828,7 @@ "storageOption": "External", "singleton": 0, "bounded": 0, - "defaultValue": "", + "defaultValue": null, "reportable": 1, "minInterval": 1, "maxInterval": 65534, @@ -11844,6 +11844,273 @@ "storageOption": "External", "singleton": 0, "bounded": 0, + "defaultValue": null, + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "GeneratedCommandList", + "code": 65528, + "mfgCode": null, + "side": "server", + "type": "array", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": null, + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "AcceptedCommandList", + "code": 65529, + "mfgCode": null, + "side": "server", + "type": "array", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": null, + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "EventList", + "code": 65530, + "mfgCode": null, + "side": "server", + "type": "array", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": null, + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "AttributeList", + "code": 65531, + "mfgCode": null, + "side": "server", + "type": "array", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": null, + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "FeatureMap", + "code": 65532, + "mfgCode": null, + "side": "server", + "type": "bitmap32", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "0", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "ClusterRevision", + "code": 65533, + "mfgCode": null, + "side": "server", + "type": "int16u", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "2", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + } + ] + }, + { + "name": "Energy EVSE", + "code": 153, + "mfgCode": null, + "define": "ENERGY_EVSE_CLUSTER", + "side": "server", + "enabled": 1, + "apiMaturity": "provisional", + "attributes": [ + { + "name": "State", + "code": 0, + "mfgCode": null, + "side": "server", + "type": "StateEnum", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "SupplyState", + "code": 1, + "mfgCode": null, + "side": "server", + "type": "SupplyStateEnum", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "FaultState", + "code": 2, + "mfgCode": null, + "side": "server", + "type": "FaultStateEnum", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "ChargingEnabledUntil", + "code": 3, + "mfgCode": null, + "side": "server", + "type": "epoch_s", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "0", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "CircuitCapacity", + "code": 5, + "mfgCode": null, + "side": "server", + "type": "amperage_ma", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "0", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "MinimumChargeCurrent", + "code": 6, + "mfgCode": null, + "side": "server", + "type": "amperage_ma", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "6000", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "MaximumChargeCurrent", + "code": 7, + "mfgCode": null, + "side": "server", + "type": "amperage_ma", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "0", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "SessionID", + "code": 64, + "mfgCode": null, + "side": "server", + "type": "int32u", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "SessionDuration", + "code": 65, + "mfgCode": null, + "side": "server", + "type": "elapsed_s", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "SessionEnergyCharged", + "code": 66, + "mfgCode": null, + "side": "server", + "type": "energy_mwh", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, "defaultValue": "", "reportable": 1, "minInterval": 1, From 3047c5a223db6126fbfca8864dd3c4a6ae41f1e8 Mon Sep 17 00:00:00 2001 From: James Harrow Date: Sat, 16 Dec 2023 19:42:03 +0000 Subject: [PATCH 018/114] Fixed types to be signed=true --- .../zcl/data-model/chip/chip-types.xml | 8 ++--- .../zap-generated/cluster/Commands.h | 32 ++++++++++--------- .../zap-generated/cluster/Commands.h | 8 ++--- 3 files changed, 25 insertions(+), 23 deletions(-) diff --git a/src/app/zap-templates/zcl/data-model/chip/chip-types.xml b/src/app/zap-templates/zcl/data-model/chip/chip-types.xml index 02d81623cc3394..cae3f4a87df8c0 100644 --- a/src/app/zap-templates/zcl/data-model/chip/chip-types.xml +++ b/src/app/zap-templates/zcl/data-model/chip/chip-types.xml @@ -55,10 +55,10 @@ limitations under the License. - - - - + + + + diff --git a/zzz_generated/chip-tool/zap-generated/cluster/Commands.h b/zzz_generated/chip-tool/zap-generated/cluster/Commands.h index 7948d81d41f181..ab6a6372063478 100644 --- a/zzz_generated/chip-tool/zap-generated/cluster/Commands.h +++ b/zzz_generated/chip-tool/zap-generated/cluster/Commands.h @@ -7238,8 +7238,8 @@ class EnergyEvseEnableCharging : public ClusterCommand EnergyEvseEnableCharging(CredentialIssuerCommands * credsIssuerConfig) : ClusterCommand("enable-charging", credsIssuerConfig) { AddArgument("ChargingEnabledUntil", 0, UINT32_MAX, &mRequest.chargingEnabledUntil); - AddArgument("MinimumChargeCurrent", 0, UINT64_MAX, &mRequest.minimumChargeCurrent); - AddArgument("MaximumChargeCurrent", 0, UINT64_MAX, &mRequest.maximumChargeCurrent); + AddArgument("MinimumChargeCurrent", INT64_MIN, INT64_MAX, &mRequest.minimumChargeCurrent); + AddArgument("MaximumChargeCurrent", INT64_MIN, INT64_MAX, &mRequest.maximumChargeCurrent); ClusterCommand::AddArguments(); } @@ -7278,7 +7278,7 @@ class EnergyEvseEnableDischarging : public ClusterCommand ClusterCommand("enable-discharging", credsIssuerConfig) { AddArgument("DischargingEnabledUntil", 0, UINT32_MAX, &mRequest.dischargingEnabledUntil); - AddArgument("MaximumDischargeCurrent", 0, UINT64_MAX, &mRequest.maximumDischargeCurrent); + AddArgument("MaximumDischargeCurrent", INT64_MIN, INT64_MAX, &mRequest.maximumDischargeCurrent); ClusterCommand::AddArguments(); } @@ -19708,16 +19708,18 @@ void registerClusterEnergyEvse(Commands & commands, CredentialIssuerCommands * c make_unique>>(Id, "discharging-enabled-until", 0, UINT32_MAX, Attributes::DischargingEnabledUntil::Id, WriteCommandType::kForceWrite, credsIssuerConfig), // - make_unique>(Id, "circuit-capacity", 0, UINT64_MAX, Attributes::CircuitCapacity::Id, + make_unique>(Id, "circuit-capacity", INT64_MIN, INT64_MAX, Attributes::CircuitCapacity::Id, WriteCommandType::kForceWrite, credsIssuerConfig), // - make_unique>(Id, "minimum-charge-current", 0, UINT64_MAX, Attributes::MinimumChargeCurrent::Id, - WriteCommandType::kForceWrite, credsIssuerConfig), // - make_unique>(Id, "maximum-charge-current", 0, UINT64_MAX, Attributes::MaximumChargeCurrent::Id, - WriteCommandType::kForceWrite, credsIssuerConfig), // - make_unique>(Id, "maximum-discharge-current", 0, UINT64_MAX, + make_unique>(Id, "minimum-charge-current", INT64_MIN, INT64_MAX, + Attributes::MinimumChargeCurrent::Id, WriteCommandType::kForceWrite, + credsIssuerConfig), // + make_unique>(Id, "maximum-charge-current", INT64_MIN, INT64_MAX, + Attributes::MaximumChargeCurrent::Id, WriteCommandType::kForceWrite, + credsIssuerConfig), // + make_unique>(Id, "maximum-discharge-current", INT64_MIN, INT64_MAX, Attributes::MaximumDischargeCurrent::Id, WriteCommandType::kForceWrite, credsIssuerConfig), // - make_unique>(Id, "user-maximum-charge-current", 0, UINT64_MAX, + make_unique>(Id, "user-maximum-charge-current", INT64_MIN, INT64_MAX, Attributes::UserMaximumChargeCurrent::Id, WriteCommandType::kWrite, credsIssuerConfig), // make_unique>(Id, "randomization-delay-window", 0, UINT32_MAX, @@ -19733,8 +19735,8 @@ void registerClusterEnergyEvse(Commands & commands, CredentialIssuerCommands * c make_unique>>(Id, "next-charge-target-time", 0, UINT32_MAX, Attributes::NextChargeTargetTime::Id, WriteCommandType::kForceWrite, credsIssuerConfig), // - make_unique>>(Id, "next-charge-required-energy", 0, UINT64_MAX, - Attributes::NextChargeRequiredEnergy::Id, + make_unique>>(Id, "next-charge-required-energy", INT64_MIN, + INT64_MAX, Attributes::NextChargeRequiredEnergy::Id, WriteCommandType::kForceWrite, credsIssuerConfig), // make_unique>>( Id, "next-charge-target-so-c", 0, UINT8_MAX, Attributes::NextChargeTargetSoC::Id, WriteCommandType::kForceWrite, @@ -19745,7 +19747,7 @@ void registerClusterEnergyEvse(Commands & commands, CredentialIssuerCommands * c make_unique>>( Id, "state-of-charge", 0, UINT8_MAX, Attributes::StateOfCharge::Id, WriteCommandType::kForceWrite, credsIssuerConfig), // - make_unique>>(Id, "battery-capacity", 0, UINT64_MAX, + make_unique>>(Id, "battery-capacity", INT64_MIN, INT64_MAX, Attributes::BatteryCapacity::Id, WriteCommandType::kForceWrite, credsIssuerConfig), // make_unique>>( @@ -19755,10 +19757,10 @@ void registerClusterEnergyEvse(Commands & commands, CredentialIssuerCommands * c make_unique>>(Id, "session-duration", 0, UINT32_MAX, Attributes::SessionDuration::Id, WriteCommandType::kForceWrite, credsIssuerConfig), // - make_unique>>(Id, "session-energy-charged", 0, UINT64_MAX, + make_unique>>(Id, "session-energy-charged", INT64_MIN, INT64_MAX, Attributes::SessionEnergyCharged::Id, WriteCommandType::kForceWrite, credsIssuerConfig), // - make_unique>>(Id, "session-energy-discharged", 0, UINT64_MAX, + make_unique>>(Id, "session-energy-discharged", INT64_MIN, INT64_MAX, Attributes::SessionEnergyDischarged::Id, WriteCommandType::kForceWrite, credsIssuerConfig), // make_unique>>( 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 5ff2d4bff4737c..6d158196626b71 100644 --- a/zzz_generated/darwin-framework-tool/zap-generated/cluster/Commands.h +++ b/zzz_generated/darwin-framework-tool/zap-generated/cluster/Commands.h @@ -80320,10 +80320,10 @@ class EnergyEvseEnableCharging : public ClusterCommand { AddArgument("ChargingEnabledUntil", 0, UINT32_MAX, &mRequest.chargingEnabledUntil); #endif // MTR_ENABLE_PROVISIONAL #if MTR_ENABLE_PROVISIONAL - AddArgument("MinimumChargeCurrent", 0, UINT64_MAX, &mRequest.minimumChargeCurrent); + AddArgument("MinimumChargeCurrent", INT64_MIN, INT64_MAX, &mRequest.minimumChargeCurrent); #endif // MTR_ENABLE_PROVISIONAL #if MTR_ENABLE_PROVISIONAL - AddArgument("MaximumChargeCurrent", 0, UINT64_MAX, &mRequest.maximumChargeCurrent); + AddArgument("MaximumChargeCurrent", INT64_MIN, INT64_MAX, &mRequest.maximumChargeCurrent); #endif // MTR_ENABLE_PROVISIONAL ClusterCommand::AddArguments(); } @@ -80389,7 +80389,7 @@ class EnergyEvseEnableDischarging : public ClusterCommand { AddArgument("DischargingEnabledUntil", 0, UINT32_MAX, &mRequest.dischargingEnabledUntil); #endif // MTR_ENABLE_PROVISIONAL #if MTR_ENABLE_PROVISIONAL - AddArgument("MaximumDischargeCurrent", 0, UINT64_MAX, &mRequest.maximumDischargeCurrent); + AddArgument("MaximumDischargeCurrent", INT64_MIN, INT64_MAX, &mRequest.maximumDischargeCurrent); #endif // MTR_ENABLE_PROVISIONAL ClusterCommand::AddArguments(); } @@ -81481,7 +81481,7 @@ class WriteEnergyEvseUserMaximumChargeCurrent : public WriteAttribute { : WriteAttribute("user-maximum-charge-current") { AddArgument("attr-name", "user-maximum-charge-current"); - AddArgument("attr-value", 0, UINT64_MAX, &mValue); + AddArgument("attr-value", INT64_MIN, INT64_MAX, &mValue); WriteAttribute::AddArguments(); } From e10f2cc4db2004e693a23a08eed4371ef690541e Mon Sep 17 00:00:00 2001 From: James Harrow Date: Sat, 16 Dec 2023 19:51:11 +0000 Subject: [PATCH 019/114] Fixed 31032 - revert removal of side="server". --- .../zcl/data-model/chip/energy-evse-cluster.xml | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/src/app/zap-templates/zcl/data-model/chip/energy-evse-cluster.xml b/src/app/zap-templates/zcl/data-model/chip/energy-evse-cluster.xml index 49457150b71754..874a112c49f29b 100644 --- a/src/app/zap-templates/zcl/data-model/chip/energy-evse-cluster.xml +++ b/src/app/zap-templates/zcl/data-model/chip/energy-evse-cluster.xml @@ -169,11 +169,11 @@ limitations under the License. The GetTargetsResponse is sent in response to the GetTargets Command. - + EVConnected - + EVNotDetected @@ -181,27 +181,27 @@ limitations under the License. - + EnergyTransferStarted - + EnergyTransferStopped - + Fault - + RFID From 711851c1acbc99e6f54d171428eaebb4e2f879c5 Mon Sep 17 00:00:00 2001 From: James Harrow Date: Sat, 16 Dec 2023 20:16:02 +0000 Subject: [PATCH 020/114] regen_all.py --- zzz_generated/chip-tool/zap-generated/cluster/Commands.h | 6 +++--- .../darwin-framework-tool/zap-generated/cluster/Commands.h | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/zzz_generated/chip-tool/zap-generated/cluster/Commands.h b/zzz_generated/chip-tool/zap-generated/cluster/Commands.h index ab6a6372063478..0ab3cd79e655bb 100644 --- a/zzz_generated/chip-tool/zap-generated/cluster/Commands.h +++ b/zzz_generated/chip-tool/zap-generated/cluster/Commands.h @@ -6874,7 +6874,7 @@ class DeviceEnergyManagementPowerAdjustRequest : public ClusterCommand DeviceEnergyManagementPowerAdjustRequest(CredentialIssuerCommands * credsIssuerConfig) : ClusterCommand("power-adjust-request", credsIssuerConfig) { - AddArgument("Power", 0, UINT64_MAX, &mRequest.power); + AddArgument("Power", INT64_MIN, INT64_MAX, &mRequest.power); AddArgument("Duration", 0, UINT32_MAX, &mRequest.duration); ClusterCommand::AddArguments(); } @@ -19583,9 +19583,9 @@ void registerClusterDeviceEnergyManagement(Commands & commands, CredentialIssuer WriteCommandType::kForceWrite, credsIssuerConfig), // make_unique>( Id, "esastate", 0, UINT8_MAX, Attributes::ESAState::Id, WriteCommandType::kForceWrite, credsIssuerConfig), // - make_unique>(Id, "abs-min-power", 0, UINT64_MAX, Attributes::AbsMinPower::Id, + make_unique>(Id, "abs-min-power", INT64_MIN, INT64_MAX, Attributes::AbsMinPower::Id, WriteCommandType::kForceWrite, credsIssuerConfig), // - make_unique>(Id, "abs-max-power", 0, UINT64_MAX, Attributes::AbsMaxPower::Id, + make_unique>(Id, "abs-max-power", INT64_MIN, INT64_MAX, Attributes::AbsMaxPower::Id, WriteCommandType::kForceWrite, credsIssuerConfig), // make_unique>>>( 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 6d158196626b71..50b3acfbcfbf44 100644 --- a/zzz_generated/darwin-framework-tool/zap-generated/cluster/Commands.h +++ b/zzz_generated/darwin-framework-tool/zap-generated/cluster/Commands.h @@ -78700,7 +78700,7 @@ class DeviceEnergyManagementPowerAdjustRequest : public ClusterCommand { : ClusterCommand("power-adjust-request") { #if MTR_ENABLE_PROVISIONAL - AddArgument("Power", 0, UINT64_MAX, &mRequest.power); + AddArgument("Power", INT64_MIN, INT64_MAX, &mRequest.power); #endif // MTR_ENABLE_PROVISIONAL #if MTR_ENABLE_PROVISIONAL AddArgument("Duration", 0, UINT32_MAX, &mRequest.duration); From 8243d7684a5c8d85472e68e9ef59a1158c543bcc Mon Sep 17 00:00:00 2001 From: James Harrow Date: Mon, 18 Dec 2023 21:18:34 +0000 Subject: [PATCH 021/114] Added Device Energy Management cluster back into all-clusters.zap and regen_all after merging from master. --- .../all-clusters-app.matter | 199 ++++++++++++++ .../all-clusters-common/all-clusters-app.zap | 252 +++++++++++++++++- 2 files changed, 450 insertions(+), 1 deletion(-) diff --git a/examples/all-clusters-app/all-clusters-common/all-clusters-app.matter b/examples/all-clusters-app/all-clusters-common/all-clusters-app.matter index 45be7ed614d227..d58b0eeb6df1d0 100644 --- a/examples/all-clusters-app/all-clusters-common/all-clusters-app.matter +++ b/examples/all-clusters-app/all-clusters-common/all-clusters-app.matter @@ -3717,6 +3717,185 @@ provisional cluster ElectricalEnergyMeasurement = 145 { readonly attribute int16u clusterRevision = 65533; } +/** This cluster allows a client to manage the power draw of a device. An example of such a client could be an Energy Management System (EMS) which controls an Energy Smart Appliance (ESA). */ +provisional cluster DeviceEnergyManagement = 152 { + revision 1; // NOTE: Default/not specifically set + + enum CauseEnum : enum8 { + kNormalCompletion = 0; + kOffline = 1; + kFault = 2; + kUserOptOut = 3; + } + + enum CostTypeEnum : enum8 { + kFinancial = 0; + kGHGEmissions = 1; + kComfort = 2; + kTemperature = 3; + } + + enum ESAStateEnum : enum8 { + kOffline = 0; + kOnline = 1; + kFault = 2; + kUserOptOut = 3; + kPowerAdjustActive = 4; + kPaused = 5; + } + + enum ESATypeEnum : enum8 { + kEVSE = 0; + kSpaceHeating = 1; + kWaterHeating = 2; + kSpaceCooling = 3; + kSpaceHeatingCooling = 4; + kBatteryStorage = 5; + kSolarPV = 6; + kFridgeFreezer = 7; + kWashingMachine = 8; + kDishwasher = 9; + kCooking = 10; + kHomeWaterPump = 11; + kIrrigationWaterPump = 12; + kPoolPump = 13; + kOther = 255; + } + + bitmap Feature : bitmap32 { + kPowerAdjustment = 0x1; + kPowerForecastReporting = 0x2; + kStateForecastReporting = 0x4; + kForecastAdjustment = 0x8; + } + + struct CostStruct { + CostTypeEnum costType = 0; + int32s value = 1; + int8u decimalPoints = 2; + optional int16u currency = 3; + } + + struct SlotStruct { + elapsed_s minDuration = 0; + elapsed_s maxDuration = 1; + elapsed_s defaultDuration = 2; + elapsed_s elapsedSlotTime = 3; + elapsed_s remainingSlotTime = 4; + boolean slotIsPauseable = 5; + elapsed_s minPauseDuration = 6; + elapsed_s maxPauseDuration = 7; + optional int16u manufacturerESAState = 8; + optional power_mw nominalPower = 9; + optional power_mw minPower = 10; + optional power_mw maxPower = 11; + optional energy_mwh nominalEnergy = 12; + optional CostStruct costs[] = 13; + optional power_mw minPowerAdjustment = 14; + optional power_mw maxPowerAdjustment = 15; + optional elapsed_s minDurationAdjustment = 16; + optional elapsed_s maxDurationAdjustment = 17; + } + + struct ForecastStruct { + int16u forecastId = 0; + nullable int16u activeSlotNumber = 1; + epoch_s startTime = 2; + epoch_s endTime = 3; + optional nullable epoch_s earliestStartTime = 4; + optional epoch_s latestEndTime = 5; + boolean isPauseable = 6; + SlotStruct slots[] = 7; + } + + struct ConstraintsStruct { + epoch_s startTime = 0; + elapsed_s duration = 1; + optional power_mw nominalPower = 2; + optional energy_mwh maximumEnergy = 3; + optional int8s loadControl = 4; + } + + struct PowerAdjustStruct { + power_mw minPower = 0; + power_mw maxPower = 1; + elapsed_s minDuration = 2; + elapsed_s maxDuration = 3; + } + + struct SlotAdjustmentStruct { + int8u slotIndex = 0; + power_mw nominalPower = 1; + elapsed_s duration = 2; + } + + info event PowerAdjustStart = 0 { + } + + info event PowerAdjustEnd = 1 { + CauseEnum cause = 0; + elapsed_s duration = 1; + energy_mwh energyUse = 2; + } + + info event Paused = 2 { + } + + info event Resumed = 3 { + } + + readonly attribute ESATypeEnum ESAType = 0; + readonly attribute boolean ESACanGenerate = 1; + readonly attribute ESAStateEnum ESAState = 2; + readonly attribute power_mw absMinPower = 3; + readonly attribute power_mw absMaxPower = 4; + readonly attribute optional nullable PowerAdjustStruct powerAdjustmentCapability[] = 5; + readonly attribute optional nullable ForecastStruct forecast = 6; + readonly attribute command_id generatedCommandList[] = 65528; + readonly attribute command_id acceptedCommandList[] = 65529; + readonly attribute event_id eventList[] = 65530; + readonly attribute attrib_id attributeList[] = 65531; + readonly attribute bitmap32 featureMap = 65532; + readonly attribute int16u clusterRevision = 65533; + + request struct PowerAdjustRequestRequest { + power_mw power = 0; + elapsed_s duration = 1; + } + + request struct StartTimeAdjustRequestRequest { + epoch_s requestedStartTime = 0; + } + + request struct PauseRequestRequest { + elapsed_s duration = 0; + } + + request struct ModifyForecastRequestRequest { + int32u forecastId = 0; + SlotAdjustmentStruct slotAdjustments[] = 1; + } + + request struct RequestConstraintBasedForecastRequest { + ConstraintsStruct constraints[] = 0; + } + + /** Allows a client to request an adjustment in the power consumption of an ESA for a specified duration. */ + command PowerAdjustRequest(PowerAdjustRequestRequest): DefaultSuccess = 0; + /** Allows a client to cancel an ongoing PowerAdjustmentRequest operation. */ + command CancelPowerAdjustRequest(): DefaultSuccess = 1; + /** Allows a client to adjust the start time of a Forecast sequence that has not yet started operation (i.e. where the current Forecast StartTime is in the future). */ + command StartTimeAdjustRequest(StartTimeAdjustRequestRequest): DefaultSuccess = 2; + /** Allows a client to temporarily pause an operation and reduce the ESAs energy demand. */ + command PauseRequest(PauseRequestRequest): DefaultSuccess = 3; + /** Allows a client to cancel the PauseRequest command and enable earlier resumption of operation. */ + command ResumeRequest(): DefaultSuccess = 4; + /** Allows a client to modify a Forecast within the limits allowed by the ESA. */ + command ModifyForecastRequest(ModifyForecastRequestRequest): DefaultSuccess = 5; + /** Allows a client to ask the ESA to recompute its Forecast based on power and time constraints. */ + command RequestConstraintBasedForecast(RequestConstraintBasedForecastRequest): DefaultSuccess = 6; +} + /** 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 cluster EnergyEvse = 153 { revision 1; // NOTE: Default/not specifically set @@ -7322,6 +7501,26 @@ endpoint 1 { ram attribute clusterRevision default = 1; } + server cluster DeviceEnergyManagement { + emits event PowerAdjustStart; + emits event PowerAdjustEnd; + emits event Paused; + emits event Resumed; + callback attribute ESAType default = 0; + callback attribute ESACanGenerate default = 0; + callback attribute ESAState default = 0; + callback attribute absMinPower default = 0; + callback attribute absMaxPower default = 0; + callback attribute powerAdjustmentCapability; + callback attribute forecast; + callback attribute generatedCommandList; + callback attribute acceptedCommandList; + callback attribute eventList; + callback attribute attributeList; + ram attribute featureMap default = 0; + ram attribute clusterRevision default = 2; + } + server cluster EnergyEvse { callback attribute state default = 0; callback attribute supplyState default = 0; diff --git a/examples/all-clusters-app/all-clusters-common/all-clusters-app.zap b/examples/all-clusters-app/all-clusters-common/all-clusters-app.zap index 0bba4b8871e6c2..6251243480657a 100644 --- a/examples/all-clusters-app/all-clusters-common/all-clusters-app.zap +++ b/examples/all-clusters-app/all-clusters-common/all-clusters-app.zap @@ -11729,6 +11729,255 @@ } ] }, + { + "name": "Device Energy Management", + "code": 152, + "mfgCode": null, + "define": "DEVICE_ENERGY_MANAGEMENT_CLUSTER", + "side": "server", + "enabled": 1, + "apiMaturity": "provisional", + "attributes": [ + { + "name": "ESAType", + "code": 0, + "mfgCode": null, + "side": "server", + "type": "ESATypeEnum", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": "0", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "ESACanGenerate", + "code": 1, + "mfgCode": null, + "side": "server", + "type": "boolean", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": "0", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "ESAState", + "code": 2, + "mfgCode": null, + "side": "server", + "type": "ESAStateEnum", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": "0", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "AbsMinPower", + "code": 3, + "mfgCode": null, + "side": "server", + "type": "power_mw", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": "0", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "AbsMaxPower", + "code": 4, + "mfgCode": null, + "side": "server", + "type": "power_mw", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": "0", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "PowerAdjustmentCapability", + "code": 5, + "mfgCode": null, + "side": "server", + "type": "array", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": "", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "Forecast", + "code": 6, + "mfgCode": null, + "side": "server", + "type": "ForecastStruct", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": "", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "GeneratedCommandList", + "code": 65528, + "mfgCode": null, + "side": "server", + "type": "array", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": "", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "AcceptedCommandList", + "code": 65529, + "mfgCode": null, + "side": "server", + "type": "array", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": "", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "EventList", + "code": 65530, + "mfgCode": null, + "side": "server", + "type": "array", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": "", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "AttributeList", + "code": 65531, + "mfgCode": null, + "side": "server", + "type": "array", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": "", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "FeatureMap", + "code": 65532, + "mfgCode": null, + "side": "server", + "type": "bitmap32", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "0", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "ClusterRevision", + "code": 65533, + "mfgCode": null, + "side": "server", + "type": "int16u", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "2", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + } + ], + "events": [ + { + "name": "PowerAdjustStart", + "code": 0, + "mfgCode": null, + "side": "server", + "included": 1 + }, + { + "name": "PowerAdjustEnd", + "code": 1, + "mfgCode": null, + "side": "server", + "included": 1 + }, + { + "name": "Paused", + "code": 2, + "mfgCode": null, + "side": "server", + "included": 1 + }, + { + "name": "Resumed", + "code": 3, + "mfgCode": null, + "side": "server", + "included": 1 + } + ] + }, { "name": "Energy EVSE", "code": 153, @@ -12234,7 +12483,8 @@ "maxInterval": 65534, "reportableChange": 0 } - ] + ], + "events": [] }, { "name": "Window Covering", From d6b5e4566b3ecf98c005a76275a409f5324a803c Mon Sep 17 00:00:00 2001 From: James Harrow Date: Mon, 18 Dec 2023 23:14:12 +0000 Subject: [PATCH 022/114] Compiles but doesn't work. Needs stub to instantiate class --- .../DeviceEnergyManagementDelegateImpl.h | 16 ++------- .../DeviceEnergyManagementDelegateImpl.cpp | 36 ++++++++++--------- examples/all-clusters-app/linux/BUILD.gn | 1 + 3 files changed, 23 insertions(+), 30 deletions(-) diff --git a/examples/all-clusters-app/all-clusters-common/include/DeviceEnergyManagementDelegateImpl.h b/examples/all-clusters-app/all-clusters-common/include/DeviceEnergyManagementDelegateImpl.h index 4f30c4e808d2db..652e26140e216e 100644 --- a/examples/all-clusters-app/all-clusters-common/include/DeviceEnergyManagementDelegateImpl.h +++ b/examples/all-clusters-app/all-clusters-common/include/DeviceEnergyManagementDelegateImpl.h @@ -20,16 +20,6 @@ #include "app/clusters/device-energy-management-server/device-energy-management-server.h" -#include -#include -#include -#include -#include -#include -#include -#include -#include - using chip::Protocols::InteractionModel::Status; namespace chip { @@ -63,7 +53,7 @@ class DeviceEnergyManagementDelegate : public Delegate virtual ESAStateEnum GetESAState() override; virtual int64_t GetAbsMinPower() override; virtual int64_t GetAbsMaxPower() override; - virtual DataModel::Nullable GetPowerAdjustmentCapability() override; + virtual Attributes::PowerAdjustmentCapability::TypeInfo::Type GetPowerAdjustmentCapability() override; virtual DataModel::Nullable GetForecast() override; // ------------------------------------------------------------------ @@ -74,7 +64,7 @@ class DeviceEnergyManagementDelegate : public Delegate virtual CHIP_ERROR SetAbsMinPower(int64_t) override; virtual CHIP_ERROR SetAbsMaxPower(int64_t) override; virtual CHIP_ERROR SetPowerAdjustmentCapability(Attributes::PowerAdjustmentCapability::TypeInfo::Type &) override; - virtual CHIP_ERROR SetForecast(Structs::ForecastStruct::Type &) override; + virtual CHIP_ERROR SetForecast(DataModel::Nullable &) override; private: ESATypeEnum mEsaType; @@ -82,7 +72,7 @@ class DeviceEnergyManagementDelegate : public Delegate ESAStateEnum mEsaState; int64_t mAbsMinPower; int64_t mAbsMaxPower; - DataModel::Nullable mPowerAdjustmentCapability; + Attributes::PowerAdjustmentCapability::TypeInfo::Type mPowerAdjustmentCapability; DataModel::Nullable mForecast; }; diff --git a/examples/all-clusters-app/all-clusters-common/src/DeviceEnergyManagementDelegateImpl.cpp b/examples/all-clusters-app/all-clusters-common/src/DeviceEnergyManagementDelegateImpl.cpp index b71da7508c9e39..e71955dff56327 100644 --- a/examples/all-clusters-app/all-clusters-common/src/DeviceEnergyManagementDelegateImpl.cpp +++ b/examples/all-clusters-app/all-clusters-common/src/DeviceEnergyManagementDelegateImpl.cpp @@ -17,9 +17,10 @@ */ #include "DeviceEnergyManagementDelegateImpl.h" -// #include -// #include -// #include + +#include +#include +#include using namespace chip::app::Clusters::DeviceEnergyManagement; using namespace chip::app::Clusters::DeviceEnergyManagement::Attributes; @@ -60,17 +61,17 @@ Status DeviceEnergyManagementDelegate::StartTimeAdjustRequest(const uint32_t req Status status = Status::UnsupportedCommand; // Status::Success; // TODO: implement - DataModel::Nullable forecast = mDelegate.GetForecast(); + DataModel::Nullable forecast = GetForecast(); if (!forecast.IsNull()) { - uint32_t duration = forecast.endTime - forecast.startTime; // the current entire forecast duration + uint32_t duration = forecast.Value().endTime - forecast.Value().startTime; // the current entire forecast duration /* Modify start time and end time */ - forecast.startTime = requestedStartTime; - forecast.endTime = requestedStartTime + duration; + forecast.Value().startTime = requestedStartTime; + forecast.Value().endTime = requestedStartTime + duration; - mDelegate.SetForecast(forecast); + SetForecast(forecast); } return status; } @@ -150,7 +151,7 @@ DataModel::Nullable DeviceEnergyManagementDelegat CHIP_ERROR DeviceEnergyManagementDelegate::SetESAType(ESATypeEnum newValue) { - ESATypeEnum oldValue = mEsaState; + ESATypeEnum oldValue = mEsaType; if (newValue >= ESATypeEnum::kUnknownEnumValue) { @@ -160,7 +161,7 @@ CHIP_ERROR DeviceEnergyManagementDelegate::SetESAType(ESATypeEnum newValue) mEsaType = newValue; if (oldValue != newValue) { - ChipLogDetail(AppServer, "mEsaType updated to %d", (int) mEsaType); + ChipLogDetail(AppServer, "mEsaType updated to %d", static_cast(mEsaType)); MatterReportingAttributeChangeCallback(mEndpointId, DeviceEnergyManagement::Id, ESAType::Id); } @@ -174,7 +175,7 @@ CHIP_ERROR DeviceEnergyManagementDelegate::SetESACanGenerate(bool newValue) mEsaCanGenerate = newValue; if (oldValue != newValue) { - ChipLogDetail(AppServer, "mEsaCanGenerate updated to %d", (int) mEsaCanGenerate); + ChipLogDetail(AppServer, "mEsaCanGenerate updated to %d", static_cast(mEsaCanGenerate)); MatterReportingAttributeChangeCallback(mEndpointId, DeviceEnergyManagement::Id, ESACanGenerate::Id); } @@ -193,7 +194,7 @@ CHIP_ERROR DeviceEnergyManagementDelegate::SetESAState(ESAStateEnum newValue) mEsaState = newValue; if (oldValue != newValue) { - ChipLogDetail(AppServer, "mEsaState updated to %d", (int) mEsaState); + ChipLogDetail(AppServer, "mEsaState updated to %d", static_cast(mEsaState)); MatterReportingAttributeChangeCallback(mEndpointId, DeviceEnergyManagement::Id, ESAState::Id); } @@ -207,7 +208,7 @@ CHIP_ERROR DeviceEnergyManagementDelegate::SetAbsMinPower(int64_t newValue) mAbsMinPower = newValue; if (oldValue != newValue) { - ChipLogDetail(AppServer, "mAbsMinPower updated to %d", (int) mAbsMinPower); + ChipLogDetail(AppServer, "mAbsMinPower updated to %d", static_cast(mAbsMinPower)); MatterReportingAttributeChangeCallback(mEndpointId, DeviceEnergyManagement::Id, AbsMinPower::Id); } @@ -221,14 +222,15 @@ CHIP_ERROR DeviceEnergyManagementDelegate::SetAbsMaxPower(int64_t newValue) mAbsMaxPower = newValue; if (oldValue != newValue) { - ChipLogDetail(AppServer, "mAbsMaxPower updated to %d", (int) mAbsMaxPower); + ChipLogDetail(AppServer, "mAbsMaxPower updated to %d", static_cast(mAbsMaxPower)); MatterReportingAttributeChangeCallback(mEndpointId, DeviceEnergyManagement::Id, AbsMaxPower::Id); } return CHIP_NO_ERROR; } -CHIP_ERROR DeviceEnergyManagementDelegate::SetPowerAdjustmentCapability( +CHIP_ERROR +DeviceEnergyManagementDelegate::SetPowerAdjustmentCapability( Attributes::PowerAdjustmentCapability::TypeInfo::Type & powerAdjustmentCapability) { // TODO copy the value @@ -237,10 +239,10 @@ CHIP_ERROR DeviceEnergyManagementDelegate::SetPowerAdjustmentCapability( return CHIP_NO_ERROR; } -CHIP_ERROR DeviceEnergyManagementDelegate::SetForecast(Structs::ForecastStruct::Type & forecast) +CHIP_ERROR DeviceEnergyManagementDelegate::SetForecast(DataModel::Nullable & forecast) { mForecast = forecast; - mForecast.forecastId++; + mForecast.Value().forecastId++; // TODO update the member variable structure diff --git a/examples/all-clusters-app/linux/BUILD.gn b/examples/all-clusters-app/linux/BUILD.gn index b3eb61c29f875a..a06e28e5456795 100644 --- a/examples/all-clusters-app/linux/BUILD.gn +++ b/examples/all-clusters-app/linux/BUILD.gn @@ -21,6 +21,7 @@ import("${chip_root}/src/platform/device.gni") source_set("chip-all-clusters-common") { sources = [ + "${chip_root}/examples/all-clusters-app/all-clusters-common/src/DeviceEnergyManagementDelegateImpl.cpp", "${chip_root}/examples/all-clusters-app/all-clusters-common/src/EnergyEvseDelegateImpl.cpp", "${chip_root}/examples/all-clusters-app/all-clusters-common/src/EnergyEvseManager.cpp", "${chip_root}/examples/all-clusters-app/all-clusters-common/src/air-quality-instance.cpp", From 68de7f8406a193b414313ce60db68ecf8417b4f4 Mon Sep 17 00:00:00 2001 From: James Harrow Date: Mon, 18 Dec 2023 23:29:06 +0000 Subject: [PATCH 023/114] Fixed EnumerateCommands to allow optional ModifyForecastRequest and RequestConstraintBasedForecast commands --- .../device-energy-management-server.cpp | 12 ++++++++++-- .../device-energy-management-server.h | 12 ++++++++++-- 2 files changed, 20 insertions(+), 4 deletions(-) diff --git a/src/app/clusters/device-energy-management-server/device-energy-management-server.cpp b/src/app/clusters/device-energy-management-server/device-energy-management-server.cpp index 7ace836878cd6c..cea0e993eb8adf 100644 --- a/src/app/clusters/device-energy-management-server/device-energy-management-server.cpp +++ b/src/app/clusters/device-energy-management-server/device-energy-management-server.cpp @@ -115,14 +115,22 @@ CHIP_ERROR Instance::EnumerateAcceptedCommands(const ConcreteClusterPath & clust StartTimeAdjustRequest::Id, PauseRequest::Id, ResumeRequest::Id, - ModifyForecastRequest::Id, - RequestConstraintBasedForecast::Id, }) { VerifyOrExit(callback(cmd, context) == Loop::Continue, /**/); } } + if (SupportsOptCmd(OptionalCommands::kSupportsModifyForecastRequest)) + { + VerifyOrExit(callback(ModifyForecastRequest::Id, context) == Loop::Continue, /**/); + } + + if (SupportsOptCmd(OptionalCommands::kSupportsRequestConstraintBasedForecast)) + { + VerifyOrExit(callback(RequestConstraintBasedForecast::Id, context) == Loop::Continue, /**/); + } + exit: return CHIP_NO_ERROR; } diff --git a/src/app/clusters/device-energy-management-server/device-energy-management-server.h b/src/app/clusters/device-energy-management-server/device-energy-management-server.h index 37e23a720172ca..d1964488f9097e 100644 --- a/src/app/clusters/device-energy-management-server/device-energy-management-server.h +++ b/src/app/clusters/device-energy-management-server/device-energy-management-server.h @@ -157,12 +157,18 @@ class Delegate EndpointId mEndpointId = 0; }; +enum class OptionalCommands : uint32_t +{ + kSupportsModifyForecastRequest = 0x1, + kSupportsRequestConstraintBasedForecast = 0x2 +}; + class Instance : public AttributeAccessInterface, public CommandHandlerInterface { public: - Instance(EndpointId aEndpointId, Delegate & aDelegate, Feature aFeature) : + Instance(EndpointId aEndpointId, Delegate & aDelegate, Feature aFeature, OptionalCommands aOptionalCmds) : AttributeAccessInterface(MakeOptional(aEndpointId), Id), CommandHandlerInterface(MakeOptional(aEndpointId), Id), - mDelegate(aDelegate), mFeature(aFeature) + mDelegate(aDelegate), mFeature(aFeature), mOptionalCmds(aOptionalCmds) { /* set the base class delegates endpointId */ mDelegate.SetEndpointId(aEndpointId); @@ -174,10 +180,12 @@ class Instance : public AttributeAccessInterface, public CommandHandlerInterface void Shutdown(); bool HasFeature(Feature aFeature) const; + bool SupportsOptCmd(OptionalCommands aOptionalCmds) const; private: Delegate & mDelegate; BitMask mFeature; + BitMask mOptionalCmds; // AttributeAccessInterface CHIP_ERROR Read(const ConcreteReadAttributePath & aPath, AttributeValueEncoder & aEncoder) override; From 729fef0db27d8ca5791fcd037eda62cc34f6509d Mon Sep 17 00:00:00 2001 From: James Harrow Date: Mon, 18 Dec 2023 23:33:06 +0000 Subject: [PATCH 024/114] Fixed InvokeCommand issues to allow optional commands. --- .../device-energy-management-server.cpp | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/src/app/clusters/device-energy-management-server/device-energy-management-server.cpp b/src/app/clusters/device-energy-management-server/device-energy-management-server.cpp index cea0e993eb8adf..e336f48a0f5d1e 100644 --- a/src/app/clusters/device-energy-management-server/device-energy-management-server.cpp +++ b/src/app/clusters/device-energy-management-server/device-energy-management-server.cpp @@ -166,7 +166,7 @@ void Instance::InvokeCommand(HandlerContext & handlerContext) } return; case StartTimeAdjustRequest::Id: - if (HasFeature(Feature::kForecastAdjustment)) + if (!HasFeature(Feature::kForecastAdjustment)) { handlerContext.mCommandHandler.AddStatus(handlerContext.mRequestPath, Status::UnsupportedCommand); } @@ -178,7 +178,7 @@ void Instance::InvokeCommand(HandlerContext & handlerContext) } return; case PauseRequest::Id: - if (HasFeature(Feature::kForecastAdjustment)) + if (!HasFeature(Feature::kForecastAdjustment)) { handlerContext.mCommandHandler.AddStatus(handlerContext.mRequestPath, Status::UnsupportedCommand); } @@ -189,7 +189,7 @@ void Instance::InvokeCommand(HandlerContext & handlerContext) } return; case ResumeRequest::Id: - if (HasFeature(Feature::kForecastAdjustment)) + if (!HasFeature(Feature::kForecastAdjustment)) { handlerContext.mCommandHandler.AddStatus(handlerContext.mRequestPath, Status::UnsupportedCommand); } @@ -200,7 +200,7 @@ void Instance::InvokeCommand(HandlerContext & handlerContext) } return; case ModifyForecastRequest::Id: - if (HasFeature(Feature::kForecastAdjustment)) + if (!SupportsOptCmd(OptionalCommands::kSupportsModifyForecastRequest)) { handlerContext.mCommandHandler.AddStatus(handlerContext.mRequestPath, Status::UnsupportedCommand); } @@ -212,7 +212,7 @@ void Instance::InvokeCommand(HandlerContext & handlerContext) } return; case RequestConstraintBasedForecast::Id: - if (HasFeature(Feature::kForecastAdjustment)) + if (!SupportsOptCmd(OptionalCommands::kSupportsRequestConstraintBasedForecast)) { handlerContext.mCommandHandler.AddStatus(handlerContext.mRequestPath, Status::UnsupportedCommand); } From c731f2bfb2a2fe5a317d7d623ff8e34e206cf4f3 Mon Sep 17 00:00:00 2001 From: James Harrow Date: Mon, 18 Dec 2023 23:41:44 +0000 Subject: [PATCH 025/114] Improved HandleModifyForecastRequest and HandleRequestConstraintBasedForecast in sdk --- .../device-energy-management-server.cpp | 45 ++++++++++++++----- 1 file changed, 34 insertions(+), 11 deletions(-) diff --git a/src/app/clusters/device-energy-management-server/device-energy-management-server.cpp b/src/app/clusters/device-energy-management-server/device-energy-management-server.cpp index e336f48a0f5d1e..3ea05edb698bd4 100644 --- a/src/app/clusters/device-energy-management-server/device-energy-management-server.cpp +++ b/src/app/clusters/device-energy-management-server/device-energy-management-server.cpp @@ -489,11 +489,17 @@ void Instance::HandleResumeRequest(HandlerContext & ctx, const Commands::ResumeR void Instance::HandleModifyForecastRequest(HandlerContext & ctx, const Commands::ModifyForecastRequest::DecodableType & commandData) { - Status status = Status::UnsupportedCommand; // TODO Status::Success; - // CHIP_ERROR err = CHIP_NO_ERROR; + Status status = Status::Success; + uint32_t forecastId = commandData.forecastId; - DataModel::Nullable forecast = mDelegate.GetForecast(); + if (ESAStateEnum::kUserOptOut == mDelegate.GetESAState()) + { + ChipLogError(Zcl, "DEM: %s - ESAState = kUserOptOut", __FUNCTION__); + ctx.mCommandHandler.AddStatus(ctx.mRequestPath, Status::Failure); + return; + } + auto forecast = mDelegate.GetForecast(); // DataModel::Nullable if (forecast.IsNull()) { ChipLogError(Zcl, "DEM: %s - Forecast is Null", __FUNCTION__); @@ -501,20 +507,37 @@ void Instance::HandleModifyForecastRequest(HandlerContext & ctx, const Commands: return; } - // TODO update the forecast details - ctx.mCommandHandler.AddStatus(ctx.mRequestPath, status); - return; + /* Call the delegate to potentially update the forecast */ + DataModel::DecodableList slotAdjustments = commandData.slotAdjustments; + status = mDelegate.ModifyForecastRequest(forecastId, slotAdjustments); + if (status != Status::Success) + { + ChipLogError(Zcl, "DEM: %s - mDelegate.ModifyForecastRequest() FAILURE", __FUNCTION__); + ctx.mCommandHandler.AddStatus(ctx.mRequestPath, Status::Failure); + return; + } } void Instance::HandleRequestConstraintBasedForecast(HandlerContext & ctx, const Commands::RequestConstraintBasedForecast::DecodableType & commandData) { - Status status = Status::UnsupportedCommand; // TODO Status::Success; + Status status = Status::Success; - // TODO pass this up to the delegate if it supports it - ChipLogError(Zcl, "DEM: %s - Handle Constraint based forecast ", __FUNCTION__); - ctx.mCommandHandler.AddStatus(ctx.mRequestPath, status); - return; + if (ESAStateEnum::kUserOptOut == mDelegate.GetESAState()) + { + ChipLogError(Zcl, "DEM: %s - ESAState = kUserOptOut", __FUNCTION__); + ctx.mCommandHandler.AddStatus(ctx.mRequestPath, Status::Failure); + return; + } + + /* delegate requested to generate a new forecast */ + status = mDelegate.RequestConstraintBasedForecast(commandData.constraints); + if (status != Status::Success) + { + ChipLogError(Zcl, "DEM: %s - mDelegate.commandData.constraints() FAILURE", __FUNCTION__); + ctx.mCommandHandler.AddStatus(ctx.mRequestPath, Status::Failure); + return; + } } } // namespace DeviceEnergyManagement From 202420aa04583d5df855ae696a0fb3d39478d8fd Mon Sep 17 00:00:00 2001 From: James Harrow Date: Tue, 19 Dec 2023 17:32:15 +0000 Subject: [PATCH 026/114] Updates to add DeviceEnergyManagement to all-clusters. --- .../DeviceEnergyManagementDelegateImpl.h | 5 +- .../include/DeviceEnergyManagementManager.h | 57 ++++ .../DeviceEnergyManagementDelegateImpl.cpp | 3 + .../src/DeviceEnergyManagementManager.cpp | 33 +++ .../src/device-energy-management-stub.cpp | 75 ++++++ examples/all-clusters-app/linux/BUILD.gn | 2 + .../DeviceEnergyManagementDelegateImpl.h | 81 ++++++ .../include/DeviceEnergyManagementManager.h | 57 ++++ .../DeviceEnergyManagementDelegateImpl.cpp | 255 ++++++++++++++++++ .../src/DeviceEnergyManagementManager.cpp | 33 +++ .../device-energy-management-server.cpp | 5 + 11 files changed, 603 insertions(+), 3 deletions(-) create mode 100644 examples/all-clusters-app/all-clusters-common/include/DeviceEnergyManagementManager.h create mode 100644 examples/all-clusters-app/all-clusters-common/src/DeviceEnergyManagementManager.cpp create mode 100644 examples/all-clusters-app/all-clusters-common/src/device-energy-management-stub.cpp create mode 100644 examples/energy-management-app/energy-management-common/include/DeviceEnergyManagementDelegateImpl.h create mode 100644 examples/energy-management-app/energy-management-common/include/DeviceEnergyManagementManager.h create mode 100644 examples/energy-management-app/energy-management-common/src/DeviceEnergyManagementDelegateImpl.cpp create mode 100644 examples/energy-management-app/energy-management-common/src/DeviceEnergyManagementManager.cpp diff --git a/examples/all-clusters-app/all-clusters-common/include/DeviceEnergyManagementDelegateImpl.h b/examples/all-clusters-app/all-clusters-common/include/DeviceEnergyManagementDelegateImpl.h index 652e26140e216e..5ee6dbc013c319 100644 --- a/examples/all-clusters-app/all-clusters-common/include/DeviceEnergyManagementDelegateImpl.h +++ b/examples/all-clusters-app/all-clusters-common/include/DeviceEnergyManagementDelegateImpl.h @@ -29,11 +29,10 @@ namespace DeviceEnergyManagement { /** The application delegate. */ -class DeviceEnergyManagementDelegate : public Delegate +class DeviceEnergyManagementDelegate : public DeviceEnergyManagement::Delegate { public: - DeviceEnergyManagementDelegate(); - virtual ~DeviceEnergyManagementDelegate() = default; + ~DeviceEnergyManagementDelegate(); virtual Status PowerAdjustRequest(const int64_t power, const uint32_t duration) override; virtual Status CancelPowerAdjustRequest() override; diff --git a/examples/all-clusters-app/all-clusters-common/include/DeviceEnergyManagementManager.h b/examples/all-clusters-app/all-clusters-common/include/DeviceEnergyManagementManager.h new file mode 100644 index 00000000000000..6d131dd4ae90fa --- /dev/null +++ b/examples/all-clusters-app/all-clusters-common/include/DeviceEnergyManagementManager.h @@ -0,0 +1,57 @@ +/* + * + * Copyright (c) 2023 Project CHIP Authors + * All rights reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#pragma once + +#include +#include +#include +#include + +namespace chip { +namespace app { +namespace Clusters { + +using namespace chip::app::Clusters::DeviceEnergyManagement; +class DeviceEnergyManagementManager : public Instance +{ +public: + DeviceEnergyManagementManager(EndpointId aEndpointId, DeviceEnergyManagementDelegate & aDelegate, Feature aFeature, + OptionalCommands aOptionalCmds) : + DeviceEnergyManagement::Instance(aEndpointId, aDelegate, aFeature, aOptionalCmds) + { + mDelegate = &aDelegate; + } + + // Delete copy constructor and assignment operator. + DeviceEnergyManagementManager(const DeviceEnergyManagementManager &) = delete; + DeviceEnergyManagementManager(const DeviceEnergyManagementManager &&) = delete; + DeviceEnergyManagementManager & operator=(const DeviceEnergyManagementManager &) = delete; + + CHIP_ERROR Init(); + void Shutdown(); + + DeviceEnergyManagementDelegate * GetDelegate() { return mDelegate; }; + +private: + DeviceEnergyManagementDelegate * mDelegate; +}; + +} // namespace Clusters +} // namespace app +} // namespace chip diff --git a/examples/all-clusters-app/all-clusters-common/src/DeviceEnergyManagementDelegateImpl.cpp b/examples/all-clusters-app/all-clusters-common/src/DeviceEnergyManagementDelegateImpl.cpp index e71955dff56327..b7c3e0abcadb73 100644 --- a/examples/all-clusters-app/all-clusters-common/src/DeviceEnergyManagementDelegateImpl.cpp +++ b/examples/all-clusters-app/all-clusters-common/src/DeviceEnergyManagementDelegateImpl.cpp @@ -22,6 +22,9 @@ #include #include +using namespace chip; +using namespace chip::app; +using namespace chip::app::Clusters; using namespace chip::app::Clusters::DeviceEnergyManagement; using namespace chip::app::Clusters::DeviceEnergyManagement::Attributes; diff --git a/examples/all-clusters-app/all-clusters-common/src/DeviceEnergyManagementManager.cpp b/examples/all-clusters-app/all-clusters-common/src/DeviceEnergyManagementManager.cpp new file mode 100644 index 00000000000000..c31e0624e4c743 --- /dev/null +++ b/examples/all-clusters-app/all-clusters-common/src/DeviceEnergyManagementManager.cpp @@ -0,0 +1,33 @@ +/* + * + * Copyright (c) 2023 Project CHIP Authors + * All rights reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#include + +using namespace chip::app; +using namespace chip::app::Clusters; +using namespace chip::app::Clusters::DeviceEnergyManagement; + +CHIP_ERROR DeviceEnergyManagementManager::Init() +{ + return Instance::Init(); +} + +void DeviceEnergyManagementManager::Shutdown() +{ + Instance::Shutdown(); +} diff --git a/examples/all-clusters-app/all-clusters-common/src/device-energy-management-stub.cpp b/examples/all-clusters-app/all-clusters-common/src/device-energy-management-stub.cpp new file mode 100644 index 00000000000000..2f73613fbabbe5 --- /dev/null +++ b/examples/all-clusters-app/all-clusters-common/src/device-energy-management-stub.cpp @@ -0,0 +1,75 @@ +/* + * + * Copyright (c) 2023 Project CHIP Authors + * All rights reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#include + +using namespace chip; +using namespace chip::app::Clusters; +using namespace chip::app::Clusters::DeviceEnergyManagement; + +static DeviceEnergyManagementDelegate * gDelegate = nullptr; +static DeviceEnergyManagementManager * gInstance = nullptr; + +void emberAfDeviceEnergyManagementClusterInitCallback(chip::EndpointId endpointId) +{ + VerifyOrDie(endpointId == 1); // this cluster is only enabled for endpoint 1. + VerifyOrDie(gInstance == nullptr); + + CHIP_ERROR err; + + if ((gDelegate != nullptr) || (gInstance != nullptr)) + { + ChipLogError(AppServer, "DEM Instance or Delegate already exist."); + return; + } + + gDelegate = new DeviceEnergyManagementDelegate(); + if (gDelegate == nullptr) + { + ChipLogError(AppServer, "Failed to allocate memory for DeviceEnergyManagementDelegate"); + return; + } + + /* Manufacturer may optionally not support all features, commands & attributes */ + gInstance = new DeviceEnergyManagementManager( + endpointId, *gDelegate, + BitMask( + DeviceEnergyManagement::Feature::kPowerForecastReporting, DeviceEnergyManagement::Feature::kStateForecastReporting, + DeviceEnergyManagement::Feature::kPowerAdjustment, DeviceEnergyManagement::Feature::kForecastAdjustment), + BitMask(OptionalCommands::kSupportsModifyForecastRequest, + OptionalCommands::kSupportsRequestConstraintBasedForecast)); + + if (gInstance == nullptr) + { + ChipLogError(AppServer, "Failed to allocate memory for DeviceEnergyManagementManager"); + delete gDelegate; + gDelegate = nullptr; + return; + } + + err = gInstance->Init(); /* Register Attribute & Command handlers */ + if (err != CHIP_NO_ERROR) + { + ChipLogError(AppServer, "Init failed on gInstance"); + delete gInstance; + delete gDelegate; + gInstance = nullptr; + gDelegate = nullptr; + return; + } +} diff --git a/examples/all-clusters-app/linux/BUILD.gn b/examples/all-clusters-app/linux/BUILD.gn index a06e28e5456795..b3117fd74cf8a6 100644 --- a/examples/all-clusters-app/linux/BUILD.gn +++ b/examples/all-clusters-app/linux/BUILD.gn @@ -22,12 +22,14 @@ import("${chip_root}/src/platform/device.gni") source_set("chip-all-clusters-common") { sources = [ "${chip_root}/examples/all-clusters-app/all-clusters-common/src/DeviceEnergyManagementDelegateImpl.cpp", + "${chip_root}/examples/all-clusters-app/all-clusters-common/src/DeviceEnergyManagementManager.cpp", "${chip_root}/examples/all-clusters-app/all-clusters-common/src/EnergyEvseDelegateImpl.cpp", "${chip_root}/examples/all-clusters-app/all-clusters-common/src/EnergyEvseManager.cpp", "${chip_root}/examples/all-clusters-app/all-clusters-common/src/air-quality-instance.cpp", "${chip_root}/examples/all-clusters-app/all-clusters-common/src/binding-handler.cpp", "${chip_root}/examples/all-clusters-app/all-clusters-common/src/bridged-actions-stub.cpp", "${chip_root}/examples/all-clusters-app/all-clusters-common/src/concentration-measurement-instances.cpp", + "${chip_root}/examples/all-clusters-app/all-clusters-common/src/device-energy-management-stub.cpp", "${chip_root}/examples/all-clusters-app/all-clusters-common/src/dishwasher-alarm-stub.cpp", "${chip_root}/examples/all-clusters-app/all-clusters-common/src/dishwasher-mode.cpp", "${chip_root}/examples/all-clusters-app/all-clusters-common/src/energy-evse-stub.cpp", diff --git a/examples/energy-management-app/energy-management-common/include/DeviceEnergyManagementDelegateImpl.h b/examples/energy-management-app/energy-management-common/include/DeviceEnergyManagementDelegateImpl.h new file mode 100644 index 00000000000000..5ee6dbc013c319 --- /dev/null +++ b/examples/energy-management-app/energy-management-common/include/DeviceEnergyManagementDelegateImpl.h @@ -0,0 +1,81 @@ +/* + * + * Copyright (c) 2023 Project CHIP Authors + * All rights reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#pragma once + +#include "app/clusters/device-energy-management-server/device-energy-management-server.h" + +using chip::Protocols::InteractionModel::Status; + +namespace chip { +namespace app { +namespace Clusters { +namespace DeviceEnergyManagement { + +/** The application delegate. + */ +class DeviceEnergyManagementDelegate : public DeviceEnergyManagement::Delegate +{ +public: + ~DeviceEnergyManagementDelegate(); + + virtual Status PowerAdjustRequest(const int64_t power, const uint32_t duration) override; + virtual Status CancelPowerAdjustRequest() override; + virtual Status StartTimeAdjustRequest(const uint32_t requestedStartTime) override; + virtual Status PauseRequest(const uint32_t duration) override; + virtual Status ResumeRequest() override; + virtual Status + ModifyForecastRequest(const uint32_t forecastId, + const DataModel::DecodableList & slotAdjustments) override; + virtual Status RequestConstraintBasedForecast( + const DataModel::DecodableList & constraints) override; + + // ------------------------------------------------------------------ + // Get attribute methods + virtual ESATypeEnum GetESAType() override; + virtual bool GetESACanGenerate() override; + virtual ESAStateEnum GetESAState() override; + virtual int64_t GetAbsMinPower() override; + virtual int64_t GetAbsMaxPower() override; + virtual Attributes::PowerAdjustmentCapability::TypeInfo::Type GetPowerAdjustmentCapability() override; + virtual DataModel::Nullable GetForecast() override; + + // ------------------------------------------------------------------ + // Set attribute methods + virtual CHIP_ERROR SetESAType(ESATypeEnum) override; + virtual CHIP_ERROR SetESACanGenerate(bool) override; + virtual CHIP_ERROR SetESAState(ESAStateEnum) override; + virtual CHIP_ERROR SetAbsMinPower(int64_t) override; + virtual CHIP_ERROR SetAbsMaxPower(int64_t) override; + virtual CHIP_ERROR SetPowerAdjustmentCapability(Attributes::PowerAdjustmentCapability::TypeInfo::Type &) override; + virtual CHIP_ERROR SetForecast(DataModel::Nullable &) override; + +private: + ESATypeEnum mEsaType; + bool mEsaCanGenerate; + ESAStateEnum mEsaState; + int64_t mAbsMinPower; + int64_t mAbsMaxPower; + Attributes::PowerAdjustmentCapability::TypeInfo::Type mPowerAdjustmentCapability; + DataModel::Nullable mForecast; +}; + +} // namespace DeviceEnergyManagement +} // namespace Clusters +} // namespace app +} // namespace chip diff --git a/examples/energy-management-app/energy-management-common/include/DeviceEnergyManagementManager.h b/examples/energy-management-app/energy-management-common/include/DeviceEnergyManagementManager.h new file mode 100644 index 00000000000000..6d131dd4ae90fa --- /dev/null +++ b/examples/energy-management-app/energy-management-common/include/DeviceEnergyManagementManager.h @@ -0,0 +1,57 @@ +/* + * + * Copyright (c) 2023 Project CHIP Authors + * All rights reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#pragma once + +#include +#include +#include +#include + +namespace chip { +namespace app { +namespace Clusters { + +using namespace chip::app::Clusters::DeviceEnergyManagement; +class DeviceEnergyManagementManager : public Instance +{ +public: + DeviceEnergyManagementManager(EndpointId aEndpointId, DeviceEnergyManagementDelegate & aDelegate, Feature aFeature, + OptionalCommands aOptionalCmds) : + DeviceEnergyManagement::Instance(aEndpointId, aDelegate, aFeature, aOptionalCmds) + { + mDelegate = &aDelegate; + } + + // Delete copy constructor and assignment operator. + DeviceEnergyManagementManager(const DeviceEnergyManagementManager &) = delete; + DeviceEnergyManagementManager(const DeviceEnergyManagementManager &&) = delete; + DeviceEnergyManagementManager & operator=(const DeviceEnergyManagementManager &) = delete; + + CHIP_ERROR Init(); + void Shutdown(); + + DeviceEnergyManagementDelegate * GetDelegate() { return mDelegate; }; + +private: + DeviceEnergyManagementDelegate * mDelegate; +}; + +} // namespace Clusters +} // namespace app +} // namespace chip diff --git a/examples/energy-management-app/energy-management-common/src/DeviceEnergyManagementDelegateImpl.cpp b/examples/energy-management-app/energy-management-common/src/DeviceEnergyManagementDelegateImpl.cpp new file mode 100644 index 00000000000000..b7c3e0abcadb73 --- /dev/null +++ b/examples/energy-management-app/energy-management-common/src/DeviceEnergyManagementDelegateImpl.cpp @@ -0,0 +1,255 @@ +/* + * + * Copyright (c) 2023 Project CHIP Authors + * All rights reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#include "DeviceEnergyManagementDelegateImpl.h" + +#include +#include +#include + +using namespace chip; +using namespace chip::app; +using namespace chip::app::Clusters; +using namespace chip::app::Clusters::DeviceEnergyManagement; +using namespace chip::app::Clusters::DeviceEnergyManagement::Attributes; + +using chip::Optional; +using namespace chip::app; +using CostsList = DataModel::List; + +Status DeviceEnergyManagementDelegate::PowerAdjustRequest(const int64_t power, const uint32_t duration) +{ + Status status = Status::UnsupportedCommand; // Status::Success; + + // TODO: implement + mEsaState = ESAStateEnum::kPowerAdjustActive; + + // TODO: Generate a PowerAdjustStart Event, then begins to adjust its power + // When done, raise PowerAdjustEnd & ESAState set to kOnline. + + MatterReportingAttributeChangeCallback(mEndpointId, DeviceEnergyManagement::Id, ESAState::Id); + + return status; +} + +Status DeviceEnergyManagementDelegate::CancelPowerAdjustRequest() +{ + Status status = Status::UnsupportedCommand; // Status::Success; + + // TODO: implement + /* TODO: If the command is accepted, the ESA SHALL generate an PowerAdjustEnd Event. */ + mEsaState = ESAStateEnum::kOnline; + MatterReportingAttributeChangeCallback(mEndpointId, DeviceEnergyManagement::Id, ESAState::Id); + + return status; +} + +Status DeviceEnergyManagementDelegate::StartTimeAdjustRequest(const uint32_t requestedStartTime) +{ + Status status = Status::UnsupportedCommand; // Status::Success; + + // TODO: implement + DataModel::Nullable forecast = GetForecast(); + + if (!forecast.IsNull()) + { + uint32_t duration = forecast.Value().endTime - forecast.Value().startTime; // the current entire forecast duration + + /* Modify start time and end time */ + forecast.Value().startTime = requestedStartTime; + forecast.Value().endTime = requestedStartTime + duration; + + SetForecast(forecast); + } + return status; +} + +Status DeviceEnergyManagementDelegate::PauseRequest(const uint32_t duration) +{ + Status status = Status::UnsupportedCommand; // Status::Success; + // TODO: implement + return status; +} + +Status DeviceEnergyManagementDelegate::ResumeRequest() +{ + Status status = Status::UnsupportedCommand; // Status::Success; + // TODO: implement + mEsaState = ESAStateEnum::kOnline; + MatterReportingAttributeChangeCallback(mEndpointId, DeviceEnergyManagement::Id, ESAState::Id); + + return status; +} + +Status DeviceEnergyManagementDelegate::ModifyForecastRequest( + const uint32_t forecastId, const DataModel::DecodableList & slotAdjustments) +{ + Status status = Status::UnsupportedCommand; // Status::Success; + // TODO: implement + return status; +} + +Status DeviceEnergyManagementDelegate::RequestConstraintBasedForecast( + const DataModel::DecodableList & constraints) +{ + Status status = Status::UnsupportedCommand; // Status::Success; + // TODO: implement + return status; +} + +// ------------------------------------------------------------------ +// Get attribute methods +ESATypeEnum DeviceEnergyManagementDelegate::GetESAType() +{ + return mEsaType; +} + +bool DeviceEnergyManagementDelegate::GetESACanGenerate() +{ + return mEsaCanGenerate; +} + +ESAStateEnum DeviceEnergyManagementDelegate::GetESAState() +{ + return mEsaState; +} + +int64_t DeviceEnergyManagementDelegate::GetAbsMinPower() +{ + return mAbsMinPower; +} + +int64_t DeviceEnergyManagementDelegate::GetAbsMaxPower() +{ + return mAbsMaxPower; +} + +Attributes::PowerAdjustmentCapability::TypeInfo::Type DeviceEnergyManagementDelegate::GetPowerAdjustmentCapability() +{ + return mPowerAdjustmentCapability; +} + +DataModel::Nullable DeviceEnergyManagementDelegate::GetForecast() +{ + return mForecast; +} + +// ------------------------------------------------------------------ +// Set attribute methods + +CHIP_ERROR DeviceEnergyManagementDelegate::SetESAType(ESATypeEnum newValue) +{ + ESATypeEnum oldValue = mEsaType; + + if (newValue >= ESATypeEnum::kUnknownEnumValue) + { + return CHIP_IM_GLOBAL_STATUS(ConstraintError); + } + + mEsaType = newValue; + if (oldValue != newValue) + { + ChipLogDetail(AppServer, "mEsaType updated to %d", static_cast(mEsaType)); + MatterReportingAttributeChangeCallback(mEndpointId, DeviceEnergyManagement::Id, ESAType::Id); + } + + return CHIP_NO_ERROR; +} + +CHIP_ERROR DeviceEnergyManagementDelegate::SetESACanGenerate(bool newValue) +{ + bool oldValue = mEsaCanGenerate; + + mEsaCanGenerate = newValue; + if (oldValue != newValue) + { + ChipLogDetail(AppServer, "mEsaCanGenerate updated to %d", static_cast(mEsaCanGenerate)); + MatterReportingAttributeChangeCallback(mEndpointId, DeviceEnergyManagement::Id, ESACanGenerate::Id); + } + + return CHIP_NO_ERROR; +} + +CHIP_ERROR DeviceEnergyManagementDelegate::SetESAState(ESAStateEnum newValue) +{ + ESAStateEnum oldValue = mEsaState; + + if (newValue >= ESAStateEnum::kUnknownEnumValue) + { + return CHIP_IM_GLOBAL_STATUS(ConstraintError); + } + + mEsaState = newValue; + if (oldValue != newValue) + { + ChipLogDetail(AppServer, "mEsaState updated to %d", static_cast(mEsaState)); + MatterReportingAttributeChangeCallback(mEndpointId, DeviceEnergyManagement::Id, ESAState::Id); + } + + return CHIP_NO_ERROR; +} + +CHIP_ERROR DeviceEnergyManagementDelegate::SetAbsMinPower(int64_t newValue) +{ + int64_t oldValue = mAbsMinPower; + + mAbsMinPower = newValue; + if (oldValue != newValue) + { + ChipLogDetail(AppServer, "mAbsMinPower updated to %d", static_cast(mAbsMinPower)); + MatterReportingAttributeChangeCallback(mEndpointId, DeviceEnergyManagement::Id, AbsMinPower::Id); + } + + return CHIP_NO_ERROR; +} + +CHIP_ERROR DeviceEnergyManagementDelegate::SetAbsMaxPower(int64_t newValue) +{ + int64_t oldValue = mAbsMaxPower; + + mAbsMaxPower = newValue; + if (oldValue != newValue) + { + ChipLogDetail(AppServer, "mAbsMaxPower updated to %d", static_cast(mAbsMaxPower)); + MatterReportingAttributeChangeCallback(mEndpointId, DeviceEnergyManagement::Id, AbsMaxPower::Id); + } + + return CHIP_NO_ERROR; +} + +CHIP_ERROR +DeviceEnergyManagementDelegate::SetPowerAdjustmentCapability( + Attributes::PowerAdjustmentCapability::TypeInfo::Type & powerAdjustmentCapability) +{ + // TODO copy the value + + MatterReportingAttributeChangeCallback(mEndpointId, DeviceEnergyManagement::Id, PowerAdjustmentCapability::Id); + return CHIP_NO_ERROR; +} + +CHIP_ERROR DeviceEnergyManagementDelegate::SetForecast(DataModel::Nullable & forecast) +{ + mForecast = forecast; + mForecast.Value().forecastId++; + + // TODO update the member variable structure + + MatterReportingAttributeChangeCallback(mEndpointId, DeviceEnergyManagement::Id, Forecast::Id); + + return CHIP_NO_ERROR; +} diff --git a/examples/energy-management-app/energy-management-common/src/DeviceEnergyManagementManager.cpp b/examples/energy-management-app/energy-management-common/src/DeviceEnergyManagementManager.cpp new file mode 100644 index 00000000000000..c31e0624e4c743 --- /dev/null +++ b/examples/energy-management-app/energy-management-common/src/DeviceEnergyManagementManager.cpp @@ -0,0 +1,33 @@ +/* + * + * Copyright (c) 2023 Project CHIP Authors + * All rights reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#include + +using namespace chip::app; +using namespace chip::app::Clusters; +using namespace chip::app::Clusters::DeviceEnergyManagement; + +CHIP_ERROR DeviceEnergyManagementManager::Init() +{ + return Instance::Init(); +} + +void DeviceEnergyManagementManager::Shutdown() +{ + Instance::Shutdown(); +} diff --git a/src/app/clusters/device-energy-management-server/device-energy-management-server.cpp b/src/app/clusters/device-energy-management-server/device-energy-management-server.cpp index 3ea05edb698bd4..8d11afdddff042 100644 --- a/src/app/clusters/device-energy-management-server/device-energy-management-server.cpp +++ b/src/app/clusters/device-energy-management-server/device-energy-management-server.cpp @@ -53,6 +53,11 @@ bool Instance::HasFeature(Feature aFeature) const return mFeature.Has(aFeature); } +bool Instance::SupportsOptCmd(OptionalCommands aOptionalCmds) const +{ + return mOptionalCmds.Has(aOptionalCmds); +} + // AttributeAccessInterface CHIP_ERROR Instance::Read(const ConcreteReadAttributePath & aPath, AttributeValueEncoder & aEncoder) { From 148330477bef64c0b7fd541564ada85ad3223305 Mon Sep 17 00:00:00 2001 From: James Harrow Date: Tue, 19 Dec 2023 21:20:52 +0000 Subject: [PATCH 027/114] Compiles and links --- .../include/DeviceEnergyManagementDelegateImpl.h | 10 ++++++---- .../src/device-energy-management-stub.cpp | 1 + 2 files changed, 7 insertions(+), 4 deletions(-) diff --git a/examples/all-clusters-app/all-clusters-common/include/DeviceEnergyManagementDelegateImpl.h b/examples/all-clusters-app/all-clusters-common/include/DeviceEnergyManagementDelegateImpl.h index 5ee6dbc013c319..8da4d055024371 100644 --- a/examples/all-clusters-app/all-clusters-common/include/DeviceEnergyManagementDelegateImpl.h +++ b/examples/all-clusters-app/all-clusters-common/include/DeviceEnergyManagementDelegateImpl.h @@ -20,20 +20,22 @@ #include "app/clusters/device-energy-management-server/device-energy-management-server.h" -using chip::Protocols::InteractionModel::Status; +#include +#include +#include +using chip::Protocols::InteractionModel::Status; namespace chip { namespace app { namespace Clusters { namespace DeviceEnergyManagement { -/** The application delegate. +/** + * The application delegate. */ class DeviceEnergyManagementDelegate : public DeviceEnergyManagement::Delegate { public: - ~DeviceEnergyManagementDelegate(); - virtual Status PowerAdjustRequest(const int64_t power, const uint32_t duration) override; virtual Status CancelPowerAdjustRequest() override; virtual Status StartTimeAdjustRequest(const uint32_t requestedStartTime) override; diff --git a/examples/all-clusters-app/all-clusters-common/src/device-energy-management-stub.cpp b/examples/all-clusters-app/all-clusters-common/src/device-energy-management-stub.cpp index 2f73613fbabbe5..87758953441827 100644 --- a/examples/all-clusters-app/all-clusters-common/src/device-energy-management-stub.cpp +++ b/examples/all-clusters-app/all-clusters-common/src/device-energy-management-stub.cpp @@ -19,6 +19,7 @@ #include using namespace chip; +using namespace chip::app; using namespace chip::app::Clusters; using namespace chip::app::Clusters::DeviceEnergyManagement; From be9d4836a4a9edf9a5e31b4122cedae75b35c1a0 Mon Sep 17 00:00:00 2001 From: James Harrow Date: Tue, 19 Dec 2023 21:44:31 +0000 Subject: [PATCH 028/114] Sync file in energy-management-app --- .../include/DeviceEnergyManagementDelegateImpl.h | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/examples/energy-management-app/energy-management-common/include/DeviceEnergyManagementDelegateImpl.h b/examples/energy-management-app/energy-management-common/include/DeviceEnergyManagementDelegateImpl.h index 5ee6dbc013c319..8da4d055024371 100644 --- a/examples/energy-management-app/energy-management-common/include/DeviceEnergyManagementDelegateImpl.h +++ b/examples/energy-management-app/energy-management-common/include/DeviceEnergyManagementDelegateImpl.h @@ -20,20 +20,22 @@ #include "app/clusters/device-energy-management-server/device-energy-management-server.h" -using chip::Protocols::InteractionModel::Status; +#include +#include +#include +using chip::Protocols::InteractionModel::Status; namespace chip { namespace app { namespace Clusters { namespace DeviceEnergyManagement { -/** The application delegate. +/** + * The application delegate. */ class DeviceEnergyManagementDelegate : public DeviceEnergyManagement::Delegate { public: - ~DeviceEnergyManagementDelegate(); - virtual Status PowerAdjustRequest(const int64_t power, const uint32_t duration) override; virtual Status CancelPowerAdjustRequest() override; virtual Status StartTimeAdjustRequest(const uint32_t requestedStartTime) override; From 1d7acdfc3922063395b3eaee2abbf8304d14867d Mon Sep 17 00:00:00 2001 From: James Harrow Date: Tue, 19 Dec 2023 22:42:23 +0000 Subject: [PATCH 029/114] Updated DEM to support SetPowerAdjustmentCapability and SetForecast methods. --- .../DeviceEnergyManagementDelegateImpl.h | 4 +- .../DeviceEnergyManagementDelegateImpl.cpp | 64 ++++++++++++++++--- .../DeviceEnergyManagementDelegateImpl.h | 4 +- .../DeviceEnergyManagementDelegateImpl.cpp | 64 ++++++++++++++++--- .../device-energy-management-server.h | 29 +++++---- 5 files changed, 129 insertions(+), 36 deletions(-) diff --git a/examples/all-clusters-app/all-clusters-common/include/DeviceEnergyManagementDelegateImpl.h b/examples/all-clusters-app/all-clusters-common/include/DeviceEnergyManagementDelegateImpl.h index 8da4d055024371..464a683510b3d7 100644 --- a/examples/all-clusters-app/all-clusters-common/include/DeviceEnergyManagementDelegateImpl.h +++ b/examples/all-clusters-app/all-clusters-common/include/DeviceEnergyManagementDelegateImpl.h @@ -64,8 +64,8 @@ class DeviceEnergyManagementDelegate : public DeviceEnergyManagement::Delegate virtual CHIP_ERROR SetESAState(ESAStateEnum) override; virtual CHIP_ERROR SetAbsMinPower(int64_t) override; virtual CHIP_ERROR SetAbsMaxPower(int64_t) override; - virtual CHIP_ERROR SetPowerAdjustmentCapability(Attributes::PowerAdjustmentCapability::TypeInfo::Type &) override; - virtual CHIP_ERROR SetForecast(DataModel::Nullable &) override; + virtual CHIP_ERROR SetPowerAdjustmentCapability(Attributes::PowerAdjustmentCapability::TypeInfo::Type) override; + virtual CHIP_ERROR SetForecast(DataModel::Nullable) override; private: ESATypeEnum mEsaType; diff --git a/examples/all-clusters-app/all-clusters-common/src/DeviceEnergyManagementDelegateImpl.cpp b/examples/all-clusters-app/all-clusters-common/src/DeviceEnergyManagementDelegateImpl.cpp index b7c3e0abcadb73..4ca8fa77a061e0 100644 --- a/examples/all-clusters-app/all-clusters-common/src/DeviceEnergyManagementDelegateImpl.cpp +++ b/examples/all-clusters-app/all-clusters-common/src/DeviceEnergyManagementDelegateImpl.cpp @@ -139,7 +139,7 @@ int64_t DeviceEnergyManagementDelegate::GetAbsMaxPower() return mAbsMaxPower; } -Attributes::PowerAdjustmentCapability::TypeInfo::Type DeviceEnergyManagementDelegate::GetPowerAdjustmentCapability() +PowerAdjustmentCapability::TypeInfo::Type DeviceEnergyManagementDelegate::GetPowerAdjustmentCapability() { return mPowerAdjustmentCapability; } @@ -233,21 +233,67 @@ CHIP_ERROR DeviceEnergyManagementDelegate::SetAbsMaxPower(int64_t newValue) } CHIP_ERROR -DeviceEnergyManagementDelegate::SetPowerAdjustmentCapability( - Attributes::PowerAdjustmentCapability::TypeInfo::Type & powerAdjustmentCapability) +DeviceEnergyManagementDelegate::SetPowerAdjustmentCapability(PowerAdjustmentCapability::TypeInfo::Type powerAdjustmentCapability) { - // TODO copy the value + if (powerAdjustmentCapability.IsNull()) + { + mPowerAdjustmentCapability.SetNull(); + ChipLogDetail(AppServer, "null src - %s", __FUNCTION__); + } + else + { + auto src = powerAdjustmentCapability.Value(); + auto target = mPowerAdjustmentCapability.Value(); + auto size = src.size(); + + if (size > 8) + { + return CHIP_ERROR_BAD_REQUEST; + } + + target.reduce_size(0); + + for (size_t i = 0; i < size; i++) + { + const_cast(target[i]) = src[i]; + } + } MatterReportingAttributeChangeCallback(mEndpointId, DeviceEnergyManagement::Id, PowerAdjustmentCapability::Id); return CHIP_NO_ERROR; } -CHIP_ERROR DeviceEnergyManagementDelegate::SetForecast(DataModel::Nullable & forecast) +CHIP_ERROR DeviceEnergyManagementDelegate::SetForecast(DataModel::Nullable forecast) { - mForecast = forecast; - mForecast.Value().forecastId++; - - // TODO update the member variable structure + if (forecast.IsNull()) + { + mForecast.SetNull(); + ChipLogDetail(AppServer, "null src - %s", __FUNCTION__); + } + else + { + auto src = forecast.Value(); + auto target = mForecast.Value(); + + target.forecastId++; + target.activeSlotNumber = src.activeSlotNumber; + target.startTime = src.startTime; + target.endTime = src.endTime; + target.earliestStartTime = src.earliestStartTime; + target.latestEndTime = src.latestEndTime; + target.isPauseable = src.isPauseable; + + auto slots = src.slots; + auto size = slots.size(); + target.slots.reduce_size(0); // clear them + ChipLogDetail(AppServer, "src.slots.size() %d - %s", (int) size, __FUNCTION__); + + for (size_t i = 0; i < size; i++) + { + const_cast(target.slots[i]) = + slots[i]; // TODO: test if this works for optional/nullable stuff + } + } MatterReportingAttributeChangeCallback(mEndpointId, DeviceEnergyManagement::Id, Forecast::Id); diff --git a/examples/energy-management-app/energy-management-common/include/DeviceEnergyManagementDelegateImpl.h b/examples/energy-management-app/energy-management-common/include/DeviceEnergyManagementDelegateImpl.h index 8da4d055024371..464a683510b3d7 100644 --- a/examples/energy-management-app/energy-management-common/include/DeviceEnergyManagementDelegateImpl.h +++ b/examples/energy-management-app/energy-management-common/include/DeviceEnergyManagementDelegateImpl.h @@ -64,8 +64,8 @@ class DeviceEnergyManagementDelegate : public DeviceEnergyManagement::Delegate virtual CHIP_ERROR SetESAState(ESAStateEnum) override; virtual CHIP_ERROR SetAbsMinPower(int64_t) override; virtual CHIP_ERROR SetAbsMaxPower(int64_t) override; - virtual CHIP_ERROR SetPowerAdjustmentCapability(Attributes::PowerAdjustmentCapability::TypeInfo::Type &) override; - virtual CHIP_ERROR SetForecast(DataModel::Nullable &) override; + virtual CHIP_ERROR SetPowerAdjustmentCapability(Attributes::PowerAdjustmentCapability::TypeInfo::Type) override; + virtual CHIP_ERROR SetForecast(DataModel::Nullable) override; private: ESATypeEnum mEsaType; diff --git a/examples/energy-management-app/energy-management-common/src/DeviceEnergyManagementDelegateImpl.cpp b/examples/energy-management-app/energy-management-common/src/DeviceEnergyManagementDelegateImpl.cpp index b7c3e0abcadb73..4ca8fa77a061e0 100644 --- a/examples/energy-management-app/energy-management-common/src/DeviceEnergyManagementDelegateImpl.cpp +++ b/examples/energy-management-app/energy-management-common/src/DeviceEnergyManagementDelegateImpl.cpp @@ -139,7 +139,7 @@ int64_t DeviceEnergyManagementDelegate::GetAbsMaxPower() return mAbsMaxPower; } -Attributes::PowerAdjustmentCapability::TypeInfo::Type DeviceEnergyManagementDelegate::GetPowerAdjustmentCapability() +PowerAdjustmentCapability::TypeInfo::Type DeviceEnergyManagementDelegate::GetPowerAdjustmentCapability() { return mPowerAdjustmentCapability; } @@ -233,21 +233,67 @@ CHIP_ERROR DeviceEnergyManagementDelegate::SetAbsMaxPower(int64_t newValue) } CHIP_ERROR -DeviceEnergyManagementDelegate::SetPowerAdjustmentCapability( - Attributes::PowerAdjustmentCapability::TypeInfo::Type & powerAdjustmentCapability) +DeviceEnergyManagementDelegate::SetPowerAdjustmentCapability(PowerAdjustmentCapability::TypeInfo::Type powerAdjustmentCapability) { - // TODO copy the value + if (powerAdjustmentCapability.IsNull()) + { + mPowerAdjustmentCapability.SetNull(); + ChipLogDetail(AppServer, "null src - %s", __FUNCTION__); + } + else + { + auto src = powerAdjustmentCapability.Value(); + auto target = mPowerAdjustmentCapability.Value(); + auto size = src.size(); + + if (size > 8) + { + return CHIP_ERROR_BAD_REQUEST; + } + + target.reduce_size(0); + + for (size_t i = 0; i < size; i++) + { + const_cast(target[i]) = src[i]; + } + } MatterReportingAttributeChangeCallback(mEndpointId, DeviceEnergyManagement::Id, PowerAdjustmentCapability::Id); return CHIP_NO_ERROR; } -CHIP_ERROR DeviceEnergyManagementDelegate::SetForecast(DataModel::Nullable & forecast) +CHIP_ERROR DeviceEnergyManagementDelegate::SetForecast(DataModel::Nullable forecast) { - mForecast = forecast; - mForecast.Value().forecastId++; - - // TODO update the member variable structure + if (forecast.IsNull()) + { + mForecast.SetNull(); + ChipLogDetail(AppServer, "null src - %s", __FUNCTION__); + } + else + { + auto src = forecast.Value(); + auto target = mForecast.Value(); + + target.forecastId++; + target.activeSlotNumber = src.activeSlotNumber; + target.startTime = src.startTime; + target.endTime = src.endTime; + target.earliestStartTime = src.earliestStartTime; + target.latestEndTime = src.latestEndTime; + target.isPauseable = src.isPauseable; + + auto slots = src.slots; + auto size = slots.size(); + target.slots.reduce_size(0); // clear them + ChipLogDetail(AppServer, "src.slots.size() %d - %s", (int) size, __FUNCTION__); + + for (size_t i = 0; i < size; i++) + { + const_cast(target.slots[i]) = + slots[i]; // TODO: test if this works for optional/nullable stuff + } + } MatterReportingAttributeChangeCallback(mEndpointId, DeviceEnergyManagement::Id, Forecast::Id); diff --git a/src/app/clusters/device-energy-management-server/device-energy-management-server.h b/src/app/clusters/device-energy-management-server/device-energy-management-server.h index d1964488f9097e..2694119f281a72 100644 --- a/src/app/clusters/device-energy-management-server/device-energy-management-server.h +++ b/src/app/clusters/device-energy-management-server/device-energy-management-server.h @@ -28,6 +28,7 @@ #include #include +using namespace chip::app::Clusters::DeviceEnergyManagement::Attributes; namespace chip { namespace app { namespace Clusters { @@ -135,23 +136,23 @@ class Delegate // ------------------------------------------------------------------ // Get attribute methods - virtual ESATypeEnum GetESAType() = 0; - virtual bool GetESACanGenerate() = 0; - virtual ESAStateEnum GetESAState() = 0; - virtual int64_t GetAbsMinPower() = 0; - virtual int64_t GetAbsMaxPower() = 0; - virtual Attributes::PowerAdjustmentCapability::TypeInfo::Type GetPowerAdjustmentCapability() = 0; - virtual DataModel::Nullable GetForecast() = 0; + virtual ESATypeEnum GetESAType() = 0; + virtual bool GetESACanGenerate() = 0; + virtual ESAStateEnum GetESAState() = 0; + virtual int64_t GetAbsMinPower() = 0; + virtual int64_t GetAbsMaxPower() = 0; + virtual PowerAdjustmentCapability::TypeInfo::Type GetPowerAdjustmentCapability() = 0; + virtual DataModel::Nullable GetForecast() = 0; // ------------------------------------------------------------------ // Set attribute methods - virtual CHIP_ERROR SetESAType(ESATypeEnum) = 0; - virtual CHIP_ERROR SetESACanGenerate(bool) = 0; - virtual CHIP_ERROR SetESAState(ESAStateEnum) = 0; - virtual CHIP_ERROR SetAbsMinPower(int64_t) = 0; - virtual CHIP_ERROR SetAbsMaxPower(int64_t) = 0; - virtual CHIP_ERROR SetPowerAdjustmentCapability(Attributes::PowerAdjustmentCapability::TypeInfo::Type &) = 0; - virtual CHIP_ERROR SetForecast(DataModel::Nullable &) = 0; + virtual CHIP_ERROR SetESAType(ESATypeEnum) = 0; + virtual CHIP_ERROR SetESACanGenerate(bool) = 0; + virtual CHIP_ERROR SetESAState(ESAStateEnum) = 0; + virtual CHIP_ERROR SetAbsMinPower(int64_t) = 0; + virtual CHIP_ERROR SetAbsMaxPower(int64_t) = 0; + virtual CHIP_ERROR SetPowerAdjustmentCapability(PowerAdjustmentCapability::TypeInfo::Type) = 0; + virtual CHIP_ERROR SetForecast(DataModel::Nullable) = 0; protected: EndpointId mEndpointId = 0; From 21cdca6a9f7e7bf1464202a1be650376e9e04afb Mon Sep 17 00:00:00 2001 From: James Harrow Date: Wed, 20 Dec 2023 00:30:01 +0000 Subject: [PATCH 030/114] Updated based on review comments. Changed Epoch to be Matter 2000 based epochs. --- .../DeviceEnergyManagementDelegateImpl.cpp | 22 +++--- .../DeviceEnergyManagementDelegateImpl.cpp | 22 +++--- .../device-energy-management-server.cpp | 77 +++++++++++-------- .../device-energy-management-server.h | 38 +++++---- 4 files changed, 86 insertions(+), 73 deletions(-) diff --git a/examples/all-clusters-app/all-clusters-common/src/DeviceEnergyManagementDelegateImpl.cpp b/examples/all-clusters-app/all-clusters-common/src/DeviceEnergyManagementDelegateImpl.cpp index 4ca8fa77a061e0..d707ba48b54754 100644 --- a/examples/all-clusters-app/all-clusters-common/src/DeviceEnergyManagementDelegateImpl.cpp +++ b/examples/all-clusters-app/all-clusters-common/src/DeviceEnergyManagementDelegateImpl.cpp @@ -61,22 +61,22 @@ Status DeviceEnergyManagementDelegate::CancelPowerAdjustRequest() Status DeviceEnergyManagementDelegate::StartTimeAdjustRequest(const uint32_t requestedStartTime) { - Status status = Status::UnsupportedCommand; // Status::Success; - - // TODO: implement DataModel::Nullable forecast = GetForecast(); - if (!forecast.IsNull()) + if (forecast.IsNull()) { - uint32_t duration = forecast.Value().endTime - forecast.Value().startTime; // the current entire forecast duration + return Status::Failure; + } - /* Modify start time and end time */ - forecast.Value().startTime = requestedStartTime; - forecast.Value().endTime = requestedStartTime + duration; + uint32_t duration = forecast.Value().endTime - forecast.Value().startTime; // the current entire forecast duration - SetForecast(forecast); - } - return status; + /* Modify start time and end time */ + forecast.Value().startTime = requestedStartTime; + forecast.Value().endTime = requestedStartTime + duration; + + SetForecast(forecast); // This will increment forecast ID + + return Status::Success; } Status DeviceEnergyManagementDelegate::PauseRequest(const uint32_t duration) diff --git a/examples/energy-management-app/energy-management-common/src/DeviceEnergyManagementDelegateImpl.cpp b/examples/energy-management-app/energy-management-common/src/DeviceEnergyManagementDelegateImpl.cpp index 4ca8fa77a061e0..d707ba48b54754 100644 --- a/examples/energy-management-app/energy-management-common/src/DeviceEnergyManagementDelegateImpl.cpp +++ b/examples/energy-management-app/energy-management-common/src/DeviceEnergyManagementDelegateImpl.cpp @@ -61,22 +61,22 @@ Status DeviceEnergyManagementDelegate::CancelPowerAdjustRequest() Status DeviceEnergyManagementDelegate::StartTimeAdjustRequest(const uint32_t requestedStartTime) { - Status status = Status::UnsupportedCommand; // Status::Success; - - // TODO: implement DataModel::Nullable forecast = GetForecast(); - if (!forecast.IsNull()) + if (forecast.IsNull()) { - uint32_t duration = forecast.Value().endTime - forecast.Value().startTime; // the current entire forecast duration + return Status::Failure; + } - /* Modify start time and end time */ - forecast.Value().startTime = requestedStartTime; - forecast.Value().endTime = requestedStartTime + duration; + uint32_t duration = forecast.Value().endTime - forecast.Value().startTime; // the current entire forecast duration - SetForecast(forecast); - } - return status; + /* Modify start time and end time */ + forecast.Value().startTime = requestedStartTime; + forecast.Value().endTime = requestedStartTime + duration; + + SetForecast(forecast); // This will increment forecast ID + + return Status::Success; } Status DeviceEnergyManagementDelegate::PauseRequest(const uint32_t duration) diff --git a/src/app/clusters/device-energy-management-server/device-energy-management-server.cpp b/src/app/clusters/device-energy-management-server/device-energy-management-server.cpp index 8d11afdddff042..bf05364fa67b71 100644 --- a/src/app/clusters/device-energy-management-server/device-energy-management-server.cpp +++ b/src/app/clusters/device-energy-management-server/device-energy-management-server.cpp @@ -238,7 +238,8 @@ void Instance::HandlePowerAdjustRequest(HandlerContext & ctx, const Commands::Po bool validArgs = false; Status status = Status::Success; - auto powerAdjustmentCapability = mDelegate.GetPowerAdjustmentCapability(); + PowerAdjustmentCapability::TypeInfo::Type powerAdjustmentCapability; + powerAdjustmentCapability = mDelegate.GetPowerAdjustmentCapability(); if (powerAdjustmentCapability.IsNull()) { @@ -268,7 +269,6 @@ void Instance::HandlePowerAdjustRequest(HandlerContext & ctx, const Commands::Po ChipLogProgress(Zcl, "DEM: %s Good PowerAdjustRequest() args.", __FUNCTION__); - /* Call the delegate to do the power adjustment */ status = mDelegate.PowerAdjustRequest(power, durationSec); ctx.mCommandHandler.AddStatus(ctx.mRequestPath, status); if (status != Status::Success) @@ -293,7 +293,6 @@ void Instance::HandleCancelPowerAdjustRequest(HandlerContext & ctx, return; } - /* Call the delegate to cancel the power adjustment */ status = mDelegate.CancelPowerAdjustRequest(); ctx.mCommandHandler.AddStatus(ctx.mRequestPath, status); if (status != Status::Success) @@ -335,7 +334,7 @@ void Instance::HandleStartTimeAdjustRequest(HandlerContext & ctx, * LatestEndTime, then the command SHALL be rejected with CONSTRAINT_ERROR; * otherwise the command SHALL be rejected with FAILURE */ - /* earliestStartTime is optional based on the FA (ForecastAdjust) feature AND can be nullable */ + /* earliestStartTime is optional based on the FA (ForecastAdjust) feature AND is nullable */ if (forecast.Value().earliestStartTime.HasValue() || forecast.Value().latestEndTime.HasValue()) { /* These Should not be NULL since this command requires FA feature and these are mandatory for that */ @@ -344,20 +343,28 @@ void Instance::HandleStartTimeAdjustRequest(HandlerContext & ctx, return; } - chip::System::Clock::Milliseconds64 cTMs; - auto chipError = chip::System::SystemClock().GetClock_RealTimeMS(cTMs); - if (chipError != CHIP_NO_ERROR) - { - ChipLogError(Zcl, "DEM: Unable to get current time - error=%d (%s)]", chipError.AsInteger(), chipError.AsString()); - ctx.mCommandHandler.AddStatus(ctx.mRequestPath, Status::Failure); - return; - } - uint32_t epochNow = std::chrono::duration_cast(cTMs).count(); - if (forecast.Value().earliestStartTime.Value().IsNull()) { + chip::System::Clock::Milliseconds64 cTMs; + CHIP_ERROR chipError = chip::System::SystemClock().GetClock_RealTimeMS(cTMs); + if (chipError != CHIP_NO_ERROR) + { + ChipLogError(Zcl, "DEM: Unable to get current time - error=%d (%s)]", chipError.AsInteger(), chipError.AsString()); + ctx.mCommandHandler.AddStatus(ctx.mRequestPath, Status::Failure); + return; + } + + auto unixEpoch = std::chrono::duration_cast(cTMs).count(); + uint32_t chipEpoch = 0; + if (!chip::UnixEpochToChipEpochTime(unixEpoch, chipEpoch)) + { + ChipLogError(Zcl, "DEM: unable to convert Unix Epoch time to Matter Epoch Time"); + ctx.mCommandHandler.AddStatus(ctx.mRequestPath, Status::Failure); + return; + } + /* Null means - We can start immediately */ - earliestStartTime = epochNow; /* NOW */ + earliestStartTime = chipEpoch; /* NOW */ } else { @@ -368,23 +375,29 @@ void Instance::HandleStartTimeAdjustRequest(HandlerContext & ctx, duration = forecast.Value().endTime - forecast.Value().startTime; // the current entire forecast duration - if ((requestedStartTime < earliestStartTime) || ((requestedStartTime + duration) > latestEndTime)) + if (requestedStartTime < earliestStartTime) { - ChipLogError(Zcl, "DEM: %s - Bad requestedStartTime %d.", __FUNCTION__, requestedStartTime); + ChipLogError(Zcl, "DEM: %s - Bad requestedStartTime %d, earlier than earliestStartTime %d.", __FUNCTION__, + requestedStartTime, earliestStartTime); ctx.mCommandHandler.AddStatus(ctx.mRequestPath, Status::ConstraintError); return; } - else + + if ((requestedStartTime + duration) > latestEndTime) { - ChipLogProgress(Zcl, "DEM: %s - Good requestedStartTime %d.", __FUNCTION__, requestedStartTime); + ChipLogError(Zcl, "DEM: %s - Bad requestedStartTime + duration %d, later than latestEndTime %d.", __FUNCTION__, + requestedStartTime + duration, latestEndTime); + ctx.mCommandHandler.AddStatus(ctx.mRequestPath, Status::ConstraintError); + return; + } - status = mDelegate.StartTimeAdjustRequest(requestedStartTime); - ctx.mCommandHandler.AddStatus(ctx.mRequestPath, status); - if (status != Status::Success) - { - ChipLogError(Zcl, "DEM: %s - StartTimeAdjustRequest(%d) FAILURE", __FUNCTION__, requestedStartTime); - return; - } + ChipLogProgress(Zcl, "DEM: %s - Good requestedStartTime %d.", __FUNCTION__, requestedStartTime); + status = mDelegate.StartTimeAdjustRequest(requestedStartTime); + ctx.mCommandHandler.AddStatus(ctx.mRequestPath, status); + if (status != Status::Success) + { + ChipLogError(Zcl, "DEM: %s - StartTimeAdjustRequest(%d) FAILURE", __FUNCTION__, requestedStartTime); + return; } return; @@ -434,7 +447,7 @@ void Instance::HandlePauseRequest(HandlerContext & ctx, const Commands::PauseReq if (!forecast.Value().slots[activeSlotNumber].slotIsPauseable) { - ChipLogError(Zcl, "DEM: %s - activeSlotNumber %d is NOT pausible.", __FUNCTION__, activeSlotNumber); + ChipLogError(Zcl, "DEM: %s - activeSlotNumber %d is NOT pauseable.", __FUNCTION__, activeSlotNumber); ctx.mCommandHandler.AddStatus(ctx.mRequestPath, Status::ConstraintError); return; } @@ -455,7 +468,6 @@ void Instance::HandlePauseRequest(HandlerContext & ctx, const Commands::PauseReq return; } - /* Finally - we can call the delegate to ask for a pause */ status = mDelegate.PauseRequest(duration); ctx.mCommandHandler.AddStatus(ctx.mRequestPath, Status::Failure); if (status != Status::Success) @@ -469,8 +481,7 @@ void Instance::HandlePauseRequest(HandlerContext & ctx, const Commands::PauseReq void Instance::HandleResumeRequest(HandlerContext & ctx, const Commands::ResumeRequest::DecodableType & commandData) { - Status status = Status::Success; - + Status status = Status::Success; DataModel::Nullable forecast = mDelegate.GetForecast(); if (ESAStateEnum::kPaused != mDelegate.GetESAState()) @@ -480,7 +491,6 @@ void Instance::HandleResumeRequest(HandlerContext & ctx, const Commands::ResumeR return; } - /* Call the delegate to resume */ status = mDelegate.ResumeRequest(); ctx.mCommandHandler.AddStatus(ctx.mRequestPath, Status::Failure); if (status != Status::Success) @@ -496,6 +506,7 @@ void Instance::HandleModifyForecastRequest(HandlerContext & ctx, const Commands: { Status status = Status::Success; uint32_t forecastId = commandData.forecastId; + DataModel::Nullable forecast; if (ESAStateEnum::kUserOptOut == mDelegate.GetESAState()) { @@ -504,7 +515,7 @@ void Instance::HandleModifyForecastRequest(HandlerContext & ctx, const Commands: return; } - auto forecast = mDelegate.GetForecast(); // DataModel::Nullable + forecast = mDelegate.GetForecast(); if (forecast.IsNull()) { ChipLogError(Zcl, "DEM: %s - Forecast is Null", __FUNCTION__); @@ -512,7 +523,6 @@ void Instance::HandleModifyForecastRequest(HandlerContext & ctx, const Commands: return; } - /* Call the delegate to potentially update the forecast */ DataModel::DecodableList slotAdjustments = commandData.slotAdjustments; status = mDelegate.ModifyForecastRequest(forecastId, slotAdjustments); if (status != Status::Success) @@ -535,7 +545,6 @@ void Instance::HandleRequestConstraintBasedForecast(HandlerContext & ctx, return; } - /* delegate requested to generate a new forecast */ status = mDelegate.RequestConstraintBasedForecast(commandData.constraints); if (status != Status::Success) { diff --git a/src/app/clusters/device-energy-management-server/device-energy-management-server.h b/src/app/clusters/device-energy-management-server/device-energy-management-server.h index 2694119f281a72..b0725ca6685180 100644 --- a/src/app/clusters/device-energy-management-server/device-energy-management-server.h +++ b/src/app/clusters/device-energy-management-server/device-energy-management-server.h @@ -36,7 +36,9 @@ namespace DeviceEnergyManagement { using chip::Protocols::InteractionModel::Status; -/** @brief Defines methods for implementing application-specific logic for this Cluster. +/** + * @brief Defines methods for implementing application-specific logic for this Cluster. + * */ class Delegate { @@ -49,8 +51,7 @@ class Delegate * @brief Delegate should implement a handler to begin to adjust client power * consumption/generation to the level requested. * - * @param power Milli-Watts the ESA SHALL use during the adjustment period. Positive values indicate the direction of current - * flow -towards- a load. + * @param power Milli-Watts the ESA SHALL use during the adjustment period. * @param duration The duration that the ESA SHALL maintain the requested power for. * @return Success if the adjustment is accepted; otherwise the command SHALL be rejected with appropriate error. */ @@ -81,32 +82,34 @@ class Delegate virtual Status StartTimeAdjustRequest(const uint32_t requestedStartTime) = 0; /** - * @brief Delegate implementation: - * If the ESA supports FA and either the SlotIsPauseable field is true in the ActiveSlotNumber index in the - * Slots list, or the IsPausable field is true in the Forecast attribute structure, and the ESAState is not - * UserOptOut then the ESA SHALL pause its current operation. + * @brief Delegate handler for PauseRequest command + * + * If the ESA supports FA and the SlotIsPauseable field is true in the ActiveSlotNumber + * index in the Slots list, and the ESAState is not UserOptOut then the ESA SHALL allow its current + * operation to be Paused. + * * During this state the ESA SHALL not consume or produce significant power (other than required to keep its * basic control system operational). - * The ESA SHALL also generate a Paused Event and the ESAState SHALL be restored to Paused. * - * @param duration Duration that the ESA SHALL be paused for. SHALL be between MinPauseDuration & MaxPauseDuration for current - * slot. - * @return Success if the ESA is paused, otherwise returns other IM_Statuses. + * @param duration Duration that the ESA SHALL be paused for. + * @return Success if the ESA is paused, otherwise returns other IM_Status. */ virtual Status PauseRequest(const uint32_t duration) = 0; /** - * @brief Delegate implementation: + * @brief Delegate handler for ResumeRequest command + * * If the ESA supports FA and it is currently Paused then the ESA SHALL resume its operation. * The ESA SHALL also generate a Resumed Event and the ESAState SHALL be updated accordingly to * reflect its current state. * - * @return Success if the ESA is resumed, otherwise returns other IM_Statuss. + * @return Success if the ESA is resumed, otherwise returns other IM_Status. */ virtual Status ResumeRequest() = 0; /** - * @brief Delegate should implement: + * @brief Delegate handler for ModifyForecastRequest + * * If the ESA supports FA, and the ESAState is not UserOptOut it SHALL attempt to adjust its power forecast. * This allows a one or more modifications in a single command by sending a list of modifications (one for each 'slot'). * Attempts to modify slots which have already past, SHALL result in the entire command being rejected. @@ -116,20 +119,21 @@ class Delegate * @param forecastId Indicates the ESA ForecastId that is to be modified. * @param slotAdjustments List of adjustments to be applied to the ESA, corresponding to the expected ESA forecastId. * @return Success if the entire list of SlotAdjustmentStruct are accepted, otherwise the command - * SHALL be rejected returning other IM_Statuss. + * SHALL be rejected returning other IM_Status. */ virtual Status ModifyForecastRequest(const uint32_t forecastId, const DataModel::DecodableList & slotAdjustments) = 0; /** - * @brief Delegate should implement: + * @brief Delegate handler for RequestConstraintBasedForecast + * * The ESA SHALL inspect the requested power limits to ensure that there are no overlapping elements. The ESA * manufacturer may also reject the request if it could cause the user’s preferences to be breached (e.g. may * cause the home to be too hot or too cold, or a battery to be insufficiently charged). * If the ESA can meet the requested power limits, it SHALL regenerate a new Power Forecast with a new ForecastId. * * @param constraints Sequence of turn up/down power requests that the ESA is being asked to constrain its operation within. - * @return Success if successfull, otherwise the command SHALL be rejected returning other IM_Statuss. + * @return Success if successful, otherwise the command SHALL be rejected returning other IM_Status. */ virtual Status RequestConstraintBasedForecast(const DataModel::DecodableList & constraints) = 0; From 21300701ff6a062aa94bf03fef8e1fa4ef1ffdb9 Mon Sep 17 00:00:00 2001 From: James Harrow Date: Wed, 20 Dec 2023 18:25:54 +0000 Subject: [PATCH 031/114] Turned on commands in DEM. Added DEM cluster server to energy-management-app. --- .../all-clusters-app.matter | 8 + .../all-clusters-common/all-clusters-app.zap | 73 ++++- .../energy-management-app.matter | 207 ++++++++++++ .../energy-management-app.zap | 307 ++++++++++++++++++ 4 files changed, 587 insertions(+), 8 deletions(-) diff --git a/examples/all-clusters-app/all-clusters-common/all-clusters-app.matter b/examples/all-clusters-app/all-clusters-common/all-clusters-app.matter index 7607c5539c6c45..624de7a93a51b8 100644 --- a/examples/all-clusters-app/all-clusters-common/all-clusters-app.matter +++ b/examples/all-clusters-app/all-clusters-common/all-clusters-app.matter @@ -7519,6 +7519,14 @@ endpoint 1 { callback attribute attributeList; ram attribute featureMap default = 0; ram attribute clusterRevision default = 2; + + handle command PowerAdjustRequest; + handle command CancelPowerAdjustRequest; + handle command StartTimeAdjustRequest; + handle command PauseRequest; + handle command ResumeRequest; + handle command ModifyForecastRequest; + handle command RequestConstraintBasedForecast; } server cluster EnergyEvse { diff --git a/examples/all-clusters-app/all-clusters-common/all-clusters-app.zap b/examples/all-clusters-app/all-clusters-common/all-clusters-app.zap index 741c7491c5b707..e07bd514d324df 100644 --- a/examples/all-clusters-app/all-clusters-common/all-clusters-app.zap +++ b/examples/all-clusters-app/all-clusters-common/all-clusters-app.zap @@ -11737,6 +11737,64 @@ "side": "server", "enabled": 1, "apiMaturity": "provisional", + "commands": [ + { + "name": "PowerAdjustRequest", + "code": 0, + "mfgCode": null, + "source": "client", + "isIncoming": 1, + "isEnabled": 1 + }, + { + "name": "CancelPowerAdjustRequest", + "code": 1, + "mfgCode": null, + "source": "client", + "isIncoming": 1, + "isEnabled": 1 + }, + { + "name": "StartTimeAdjustRequest", + "code": 2, + "mfgCode": null, + "source": "client", + "isIncoming": 1, + "isEnabled": 1 + }, + { + "name": "PauseRequest", + "code": 3, + "mfgCode": null, + "source": "client", + "isIncoming": 1, + "isEnabled": 1 + }, + { + "name": "ResumeRequest", + "code": 4, + "mfgCode": null, + "source": "client", + "isIncoming": 1, + "isEnabled": 1 + }, + { + "name": "ModifyForecastRequest", + "code": 5, + "mfgCode": null, + "source": "client", + "isIncoming": 1, + "isEnabled": 1 + }, + { + "name": "RequestConstraintBasedForecast", + "code": 6, + "mfgCode": null, + "source": "client", + "isIncoming": 1, + "isEnabled": 1 + } + ], "attributes": [ { "name": "ESAType", @@ -11828,7 +11886,7 @@ "storageOption": "External", "singleton": 0, "bounded": 0, - "defaultValue": "", + "defaultValue": null, "reportable": 1, "minInterval": 1, "maxInterval": 65534, @@ -11844,7 +11902,7 @@ "storageOption": "External", "singleton": 0, "bounded": 0, - "defaultValue": "", + "defaultValue": null, "reportable": 1, "minInterval": 1, "maxInterval": 65534, @@ -11860,7 +11918,7 @@ "storageOption": "External", "singleton": 0, "bounded": 0, - "defaultValue": "", + "defaultValue": null, "reportable": 1, "minInterval": 1, "maxInterval": 65534, @@ -11876,7 +11934,7 @@ "storageOption": "External", "singleton": 0, "bounded": 0, - "defaultValue": "", + "defaultValue": null, "reportable": 1, "minInterval": 1, "maxInterval": 65534, @@ -11892,7 +11950,7 @@ "storageOption": "External", "singleton": 0, "bounded": 0, - "defaultValue": "", + "defaultValue": null, "reportable": 1, "minInterval": 1, "maxInterval": 65534, @@ -11908,7 +11966,7 @@ "storageOption": "External", "singleton": 0, "bounded": 0, - "defaultValue": "", + "defaultValue": null, "reportable": 1, "minInterval": 1, "maxInterval": 65534, @@ -12549,8 +12607,7 @@ "maxInterval": 65534, "reportableChange": 0 } - ], - "events": [] + ] }, { "name": "Window Covering", diff --git a/examples/energy-management-app/energy-management-common/energy-management-app.matter b/examples/energy-management-app/energy-management-common/energy-management-app.matter index 0452ec58d3eef8..3e841739756f22 100644 --- a/examples/energy-management-app/energy-management-common/energy-management-app.matter +++ b/examples/energy-management-app/energy-management-common/energy-management-app.matter @@ -900,6 +900,185 @@ cluster GroupKeyManagement = 63 { fabric command access(invoke: administer) KeySetReadAllIndices(): KeySetReadAllIndicesResponse = 4; } +/** This cluster allows a client to manage the power draw of a device. An example of such a client could be an Energy Management System (EMS) which controls an Energy Smart Appliance (ESA). */ +provisional cluster DeviceEnergyManagement = 152 { + revision 1; // NOTE: Default/not specifically set + + enum CauseEnum : enum8 { + kNormalCompletion = 0; + kOffline = 1; + kFault = 2; + kUserOptOut = 3; + } + + enum CostTypeEnum : enum8 { + kFinancial = 0; + kGHGEmissions = 1; + kComfort = 2; + kTemperature = 3; + } + + enum ESAStateEnum : enum8 { + kOffline = 0; + kOnline = 1; + kFault = 2; + kUserOptOut = 3; + kPowerAdjustActive = 4; + kPaused = 5; + } + + enum ESATypeEnum : enum8 { + kEVSE = 0; + kSpaceHeating = 1; + kWaterHeating = 2; + kSpaceCooling = 3; + kSpaceHeatingCooling = 4; + kBatteryStorage = 5; + kSolarPV = 6; + kFridgeFreezer = 7; + kWashingMachine = 8; + kDishwasher = 9; + kCooking = 10; + kHomeWaterPump = 11; + kIrrigationWaterPump = 12; + kPoolPump = 13; + kOther = 255; + } + + bitmap Feature : bitmap32 { + kPowerAdjustment = 0x1; + kPowerForecastReporting = 0x2; + kStateForecastReporting = 0x4; + kForecastAdjustment = 0x8; + } + + struct CostStruct { + CostTypeEnum costType = 0; + int32s value = 1; + int8u decimalPoints = 2; + optional int16u currency = 3; + } + + struct SlotStruct { + elapsed_s minDuration = 0; + elapsed_s maxDuration = 1; + elapsed_s defaultDuration = 2; + elapsed_s elapsedSlotTime = 3; + elapsed_s remainingSlotTime = 4; + boolean slotIsPauseable = 5; + elapsed_s minPauseDuration = 6; + elapsed_s maxPauseDuration = 7; + optional int16u manufacturerESAState = 8; + optional power_mw nominalPower = 9; + optional power_mw minPower = 10; + optional power_mw maxPower = 11; + optional energy_mwh nominalEnergy = 12; + optional CostStruct costs[] = 13; + optional power_mw minPowerAdjustment = 14; + optional power_mw maxPowerAdjustment = 15; + optional elapsed_s minDurationAdjustment = 16; + optional elapsed_s maxDurationAdjustment = 17; + } + + struct ForecastStruct { + int16u forecastId = 0; + nullable int16u activeSlotNumber = 1; + epoch_s startTime = 2; + epoch_s endTime = 3; + optional nullable epoch_s earliestStartTime = 4; + optional epoch_s latestEndTime = 5; + boolean isPauseable = 6; + SlotStruct slots[] = 7; + } + + struct ConstraintsStruct { + epoch_s startTime = 0; + elapsed_s duration = 1; + optional power_mw nominalPower = 2; + optional energy_mwh maximumEnergy = 3; + optional int8s loadControl = 4; + } + + struct PowerAdjustStruct { + power_mw minPower = 0; + power_mw maxPower = 1; + elapsed_s minDuration = 2; + elapsed_s maxDuration = 3; + } + + struct SlotAdjustmentStruct { + int8u slotIndex = 0; + power_mw nominalPower = 1; + elapsed_s duration = 2; + } + + info event PowerAdjustStart = 0 { + } + + info event PowerAdjustEnd = 1 { + CauseEnum cause = 0; + elapsed_s duration = 1; + energy_mwh energyUse = 2; + } + + info event Paused = 2 { + } + + info event Resumed = 3 { + } + + readonly attribute ESATypeEnum ESAType = 0; + readonly attribute boolean ESACanGenerate = 1; + readonly attribute ESAStateEnum ESAState = 2; + readonly attribute power_mw absMinPower = 3; + readonly attribute power_mw absMaxPower = 4; + readonly attribute optional nullable PowerAdjustStruct powerAdjustmentCapability[] = 5; + readonly attribute optional nullable ForecastStruct forecast = 6; + readonly attribute command_id generatedCommandList[] = 65528; + readonly attribute command_id acceptedCommandList[] = 65529; + readonly attribute event_id eventList[] = 65530; + readonly attribute attrib_id attributeList[] = 65531; + readonly attribute bitmap32 featureMap = 65532; + readonly attribute int16u clusterRevision = 65533; + + request struct PowerAdjustRequestRequest { + power_mw power = 0; + elapsed_s duration = 1; + } + + request struct StartTimeAdjustRequestRequest { + epoch_s requestedStartTime = 0; + } + + request struct PauseRequestRequest { + elapsed_s duration = 0; + } + + request struct ModifyForecastRequestRequest { + int32u forecastId = 0; + SlotAdjustmentStruct slotAdjustments[] = 1; + } + + request struct RequestConstraintBasedForecastRequest { + ConstraintsStruct constraints[] = 0; + } + + /** Allows a client to request an adjustment in the power consumption of an ESA for a specified duration. */ + command PowerAdjustRequest(PowerAdjustRequestRequest): DefaultSuccess = 0; + /** Allows a client to cancel an ongoing PowerAdjustmentRequest operation. */ + command CancelPowerAdjustRequest(): DefaultSuccess = 1; + /** Allows a client to adjust the start time of a Forecast sequence that has not yet started operation (i.e. where the current Forecast StartTime is in the future). */ + command StartTimeAdjustRequest(StartTimeAdjustRequestRequest): DefaultSuccess = 2; + /** Allows a client to temporarily pause an operation and reduce the ESAs energy demand. */ + command PauseRequest(PauseRequestRequest): DefaultSuccess = 3; + /** Allows a client to cancel the PauseRequest command and enable earlier resumption of operation. */ + command ResumeRequest(): DefaultSuccess = 4; + /** Allows a client to modify a Forecast within the limits allowed by the ESA. */ + command ModifyForecastRequest(ModifyForecastRequestRequest): DefaultSuccess = 5; + /** Allows a client to ask the ESA to recompute its Forecast based on power and time constraints. */ + command RequestConstraintBasedForecast(RequestConstraintBasedForecastRequest): DefaultSuccess = 6; +} + /** 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 cluster EnergyEvse = 153 { revision 1; // NOTE: Default/not specifically set @@ -1290,6 +1469,34 @@ endpoint 1 { callback attribute clusterRevision; } + server cluster DeviceEnergyManagement { + emits event PowerAdjustStart; + emits event PowerAdjustEnd; + emits event Paused; + emits event Resumed; + callback attribute ESAType default = 0; + callback attribute ESACanGenerate default = 0; + callback attribute ESAState default = 0; + callback attribute absMinPower default = 0; + callback attribute absMaxPower default = 0; + callback attribute powerAdjustmentCapability; + callback attribute forecast; + callback attribute generatedCommandList; + callback attribute acceptedCommandList; + callback attribute eventList; + callback attribute attributeList; + ram attribute featureMap default = 0; + ram attribute clusterRevision default = 2; + + handle command PowerAdjustRequest; + handle command CancelPowerAdjustRequest; + handle command StartTimeAdjustRequest; + handle command PauseRequest; + handle command ResumeRequest; + handle command ModifyForecastRequest; + handle command RequestConstraintBasedForecast; + } + server cluster EnergyEvse { emits event EVConnected; emits event EVNotDetected; diff --git a/examples/energy-management-app/energy-management-common/energy-management-app.zap b/examples/energy-management-app/energy-management-common/energy-management-app.zap index 55d62101227dab..b7d2271cea5b8b 100644 --- a/examples/energy-management-app/energy-management-common/energy-management-app.zap +++ b/examples/energy-management-app/energy-management-common/energy-management-app.zap @@ -2517,6 +2517,313 @@ } ] }, + { + "name": "Device Energy Management", + "code": 152, + "mfgCode": null, + "define": "DEVICE_ENERGY_MANAGEMENT_CLUSTER", + "side": "server", + "enabled": 1, + "apiMaturity": "provisional", + "commands": [ + { + "name": "PowerAdjustRequest", + "code": 0, + "mfgCode": null, + "source": "client", + "isIncoming": 1, + "isEnabled": 1 + }, + { + "name": "CancelPowerAdjustRequest", + "code": 1, + "mfgCode": null, + "source": "client", + "isIncoming": 1, + "isEnabled": 1 + }, + { + "name": "StartTimeAdjustRequest", + "code": 2, + "mfgCode": null, + "source": "client", + "isIncoming": 1, + "isEnabled": 1 + }, + { + "name": "PauseRequest", + "code": 3, + "mfgCode": null, + "source": "client", + "isIncoming": 1, + "isEnabled": 1 + }, + { + "name": "ResumeRequest", + "code": 4, + "mfgCode": null, + "source": "client", + "isIncoming": 1, + "isEnabled": 1 + }, + { + "name": "ModifyForecastRequest", + "code": 5, + "mfgCode": null, + "source": "client", + "isIncoming": 1, + "isEnabled": 1 + }, + { + "name": "RequestConstraintBasedForecast", + "code": 6, + "mfgCode": null, + "source": "client", + "isIncoming": 1, + "isEnabled": 1 + } + ], + "attributes": [ + { + "name": "ESAType", + "code": 0, + "mfgCode": null, + "side": "server", + "type": "ESATypeEnum", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": "0", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "ESACanGenerate", + "code": 1, + "mfgCode": null, + "side": "server", + "type": "boolean", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": "0", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "ESAState", + "code": 2, + "mfgCode": null, + "side": "server", + "type": "ESAStateEnum", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": "0", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "AbsMinPower", + "code": 3, + "mfgCode": null, + "side": "server", + "type": "power_mw", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": "0", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "AbsMaxPower", + "code": 4, + "mfgCode": null, + "side": "server", + "type": "power_mw", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": "0", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "PowerAdjustmentCapability", + "code": 5, + "mfgCode": null, + "side": "server", + "type": "array", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": "", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "Forecast", + "code": 6, + "mfgCode": null, + "side": "server", + "type": "ForecastStruct", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": "", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "GeneratedCommandList", + "code": 65528, + "mfgCode": null, + "side": "server", + "type": "array", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": "", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "AcceptedCommandList", + "code": 65529, + "mfgCode": null, + "side": "server", + "type": "array", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": "", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "EventList", + "code": 65530, + "mfgCode": null, + "side": "server", + "type": "array", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": "", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "AttributeList", + "code": 65531, + "mfgCode": null, + "side": "server", + "type": "array", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": "", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "FeatureMap", + "code": 65532, + "mfgCode": null, + "side": "server", + "type": "bitmap32", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "0", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "ClusterRevision", + "code": 65533, + "mfgCode": null, + "side": "server", + "type": "int16u", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "2", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + } + ], + "events": [ + { + "name": "PowerAdjustStart", + "code": 0, + "mfgCode": null, + "side": "server", + "included": 1 + }, + { + "name": "PowerAdjustEnd", + "code": 1, + "mfgCode": null, + "side": "server", + "included": 1 + }, + { + "name": "Paused", + "code": 2, + "mfgCode": null, + "side": "server", + "included": 1 + }, + { + "name": "Resumed", + "code": 3, + "mfgCode": null, + "side": "server", + "included": 1 + } + ] + }, { "name": "Energy EVSE", "code": 153, From b66fd0e1641ae9a8fad9b2e32e8b33761479d6d5 Mon Sep 17 00:00:00 2001 From: James Harrow Date: Wed, 20 Dec 2023 18:26:52 +0000 Subject: [PATCH 032/114] Added more comments to Delegate to describe expected behaviour. --- .../DeviceEnergyManagementDelegateImpl.cpp | 111 ++++++++++++++++-- .../DeviceEnergyManagementDelegateImpl.cpp | 111 ++++++++++++++++-- 2 files changed, 208 insertions(+), 14 deletions(-) diff --git a/examples/all-clusters-app/all-clusters-common/src/DeviceEnergyManagementDelegateImpl.cpp b/examples/all-clusters-app/all-clusters-common/src/DeviceEnergyManagementDelegateImpl.cpp index d707ba48b54754..74ad9e9e23f47a 100644 --- a/examples/all-clusters-app/all-clusters-common/src/DeviceEnergyManagementDelegateImpl.cpp +++ b/examples/all-clusters-app/all-clusters-common/src/DeviceEnergyManagementDelegateImpl.cpp @@ -32,6 +32,23 @@ using chip::Optional; using namespace chip::app; using CostsList = DataModel::List; +/** + * @brief Delegate handler for PowerAdjustRequest + * + * Note: checking of the validity of the PowerAdjustRequest has been done by the lower layer + * + * This function needs to notify the appliance that it should apply a new power setting. + * It should: + * 1) notify the appliance - if the appliance hardware cannot be adjusted, then return Failure + * 2) start a timer (or restart the existing PowerAdjust timer) for duration seconds + * 3) generate a PowerAdjustStart event (if there is not an existing PowerAdjustRequest running) + * 4) if appropriate, update the forecast with the new expected end time + * + * and when the timer expires: + * 5) notify the appliance's that it can resume its intended power setting (or go idle) + * 6) generate a PowerAdjustEnd event with cause NormalCompletion + * 7) if necessary, update the forecast with new expected end time + */ Status DeviceEnergyManagementDelegate::PowerAdjustRequest(const int64_t power, const uint32_t duration) { Status status = Status::UnsupportedCommand; // Status::Success; @@ -46,7 +63,18 @@ Status DeviceEnergyManagementDelegate::PowerAdjustRequest(const int64_t power, c return status; } +/** + * @brief Delegate handler for CancelPowerAdjustRequest + * + * Note: checking of the validity of the CancelPowerAdjustRequest has been done by the lower layer + * + * This function needs to notify the appliance that it should resume its intended power setting (or go idle). + * It should: + * 1) notify the appliance's that it can resume its intended power setting (or go idle) + * 2) generate a PowerAdjustEnd event with cause code Cancelled + * 3) if necessary, update the forecast with new expected end time + */ Status DeviceEnergyManagementDelegate::CancelPowerAdjustRequest() { Status status = Status::UnsupportedCommand; // Status::Success; @@ -59,6 +87,17 @@ Status DeviceEnergyManagementDelegate::CancelPowerAdjustRequest() return status; } +/** + * @brief Delegate handler for StartTimeAdjustRequest + * + * Note: checking of the validity of the StartTimeAdjustRequest has been done by the lower layer + * + * This function needs to notify the appliance that the forecast has been updated by a client. + * + * It should: + * 1) update the forecast attribute with the revised start time + * 2) send a callback notification to the appliance so it can refresh its internal schedule + */ Status DeviceEnergyManagementDelegate::StartTimeAdjustRequest(const uint32_t requestedStartTime) { DataModel::Nullable forecast = GetForecast(); @@ -76,39 +115,97 @@ Status DeviceEnergyManagementDelegate::StartTimeAdjustRequest(const uint32_t req SetForecast(forecast); // This will increment forecast ID + // TODO: callback to the appliance to notify it of a new start time + return Status::Success; } - +/** + * @brief Delegate handler for Pause Request + * + * Note: checking of the validity of the Pause Request has been done by the lower layer + * + * This function needs to notify the appliance that it should now pause. + * It should: + * 1) pause the appliance - if the appliance hardware cannot be paused, then return Failure + * 2) start a timer for duration seconds + * 3) generate a Paused event + * 4) update the forecast with the new expected end time + * + * and when the timer expires: + * 5) restore the appliance's operational state + * 6) generate a Resumed event + * 7) if necessary, update the forecast with new expected end time + */ Status DeviceEnergyManagementDelegate::PauseRequest(const uint32_t duration) { Status status = Status::UnsupportedCommand; // Status::Success; - // TODO: implement + // TODO: implement the behaviour above return status; } +/** + * @brief Delegate handler for ResumeRequest + * + * Note: checking of the validity of the ResumeRequest has been done by the lower layer + * + * This function needs to notify the appliance that it should now resume operation + * + * It should: + * 1) restore the appliance's operational state + * 2) generate a Resumed event + * 3) update the forecast with new expected end time (given that the pause duration was shorter than originally requested) + * + */ Status DeviceEnergyManagementDelegate::ResumeRequest() { Status status = Status::UnsupportedCommand; // Status::Success; - // TODO: implement - mEsaState = ESAStateEnum::kOnline; - MatterReportingAttributeChangeCallback(mEndpointId, DeviceEnergyManagement::Id, ESAState::Id); + + // TODO: implement the behaviour above + SetESAState(ESAStateEnum::kOnline); return status; } +/** + * @brief Delegate handler for ModifyForecastRequest + * + * Note: Only basic checking of the validity of the ModifyForecastRequest has been + * done by the lower layer. This is a more complex use-case and requires higher-level + * work by the delegate. + * + * It should: + * 1) determine if the new forecast adjustments are acceptable to the appliance + * - if not return Failure. For example, if it may cause the home to be too hot + * or too cold, or a battery to be insufficiently charged + * 2) if the slot adjustments are acceptable, then update the forecast + * 3) notify the appliance to follow the revised schedule + */ Status DeviceEnergyManagementDelegate::ModifyForecastRequest( const uint32_t forecastId, const DataModel::DecodableList & slotAdjustments) { Status status = Status::UnsupportedCommand; // Status::Success; - // TODO: implement + + // TODO: implement the behaviour above return status; } +/** + * @brief Delegate handler for RequestConstraintBasedForecast + * + * Note: Only basic checking of the validity of the RequestConstraintBasedForecast has been + * done by the lower layer. This is a more complex use-case and requires higher-level + * work by the delegate. + * + * It should: + * 1) perform a higher level optimization (e.g. using tariff information, and user preferences) + * 2) if a solution can be found, then update the forecast, else return Failure + * 3) notify the appliance to follow the revised schedule + */ Status DeviceEnergyManagementDelegate::RequestConstraintBasedForecast( const DataModel::DecodableList & constraints) { Status status = Status::UnsupportedCommand; // Status::Success; - // TODO: implement + // TODO: implement the behaviour above return status; } diff --git a/examples/energy-management-app/energy-management-common/src/DeviceEnergyManagementDelegateImpl.cpp b/examples/energy-management-app/energy-management-common/src/DeviceEnergyManagementDelegateImpl.cpp index d707ba48b54754..74ad9e9e23f47a 100644 --- a/examples/energy-management-app/energy-management-common/src/DeviceEnergyManagementDelegateImpl.cpp +++ b/examples/energy-management-app/energy-management-common/src/DeviceEnergyManagementDelegateImpl.cpp @@ -32,6 +32,23 @@ using chip::Optional; using namespace chip::app; using CostsList = DataModel::List; +/** + * @brief Delegate handler for PowerAdjustRequest + * + * Note: checking of the validity of the PowerAdjustRequest has been done by the lower layer + * + * This function needs to notify the appliance that it should apply a new power setting. + * It should: + * 1) notify the appliance - if the appliance hardware cannot be adjusted, then return Failure + * 2) start a timer (or restart the existing PowerAdjust timer) for duration seconds + * 3) generate a PowerAdjustStart event (if there is not an existing PowerAdjustRequest running) + * 4) if appropriate, update the forecast with the new expected end time + * + * and when the timer expires: + * 5) notify the appliance's that it can resume its intended power setting (or go idle) + * 6) generate a PowerAdjustEnd event with cause NormalCompletion + * 7) if necessary, update the forecast with new expected end time + */ Status DeviceEnergyManagementDelegate::PowerAdjustRequest(const int64_t power, const uint32_t duration) { Status status = Status::UnsupportedCommand; // Status::Success; @@ -46,7 +63,18 @@ Status DeviceEnergyManagementDelegate::PowerAdjustRequest(const int64_t power, c return status; } +/** + * @brief Delegate handler for CancelPowerAdjustRequest + * + * Note: checking of the validity of the CancelPowerAdjustRequest has been done by the lower layer + * + * This function needs to notify the appliance that it should resume its intended power setting (or go idle). + * It should: + * 1) notify the appliance's that it can resume its intended power setting (or go idle) + * 2) generate a PowerAdjustEnd event with cause code Cancelled + * 3) if necessary, update the forecast with new expected end time + */ Status DeviceEnergyManagementDelegate::CancelPowerAdjustRequest() { Status status = Status::UnsupportedCommand; // Status::Success; @@ -59,6 +87,17 @@ Status DeviceEnergyManagementDelegate::CancelPowerAdjustRequest() return status; } +/** + * @brief Delegate handler for StartTimeAdjustRequest + * + * Note: checking of the validity of the StartTimeAdjustRequest has been done by the lower layer + * + * This function needs to notify the appliance that the forecast has been updated by a client. + * + * It should: + * 1) update the forecast attribute with the revised start time + * 2) send a callback notification to the appliance so it can refresh its internal schedule + */ Status DeviceEnergyManagementDelegate::StartTimeAdjustRequest(const uint32_t requestedStartTime) { DataModel::Nullable forecast = GetForecast(); @@ -76,39 +115,97 @@ Status DeviceEnergyManagementDelegate::StartTimeAdjustRequest(const uint32_t req SetForecast(forecast); // This will increment forecast ID + // TODO: callback to the appliance to notify it of a new start time + return Status::Success; } - +/** + * @brief Delegate handler for Pause Request + * + * Note: checking of the validity of the Pause Request has been done by the lower layer + * + * This function needs to notify the appliance that it should now pause. + * It should: + * 1) pause the appliance - if the appliance hardware cannot be paused, then return Failure + * 2) start a timer for duration seconds + * 3) generate a Paused event + * 4) update the forecast with the new expected end time + * + * and when the timer expires: + * 5) restore the appliance's operational state + * 6) generate a Resumed event + * 7) if necessary, update the forecast with new expected end time + */ Status DeviceEnergyManagementDelegate::PauseRequest(const uint32_t duration) { Status status = Status::UnsupportedCommand; // Status::Success; - // TODO: implement + // TODO: implement the behaviour above return status; } +/** + * @brief Delegate handler for ResumeRequest + * + * Note: checking of the validity of the ResumeRequest has been done by the lower layer + * + * This function needs to notify the appliance that it should now resume operation + * + * It should: + * 1) restore the appliance's operational state + * 2) generate a Resumed event + * 3) update the forecast with new expected end time (given that the pause duration was shorter than originally requested) + * + */ Status DeviceEnergyManagementDelegate::ResumeRequest() { Status status = Status::UnsupportedCommand; // Status::Success; - // TODO: implement - mEsaState = ESAStateEnum::kOnline; - MatterReportingAttributeChangeCallback(mEndpointId, DeviceEnergyManagement::Id, ESAState::Id); + + // TODO: implement the behaviour above + SetESAState(ESAStateEnum::kOnline); return status; } +/** + * @brief Delegate handler for ModifyForecastRequest + * + * Note: Only basic checking of the validity of the ModifyForecastRequest has been + * done by the lower layer. This is a more complex use-case and requires higher-level + * work by the delegate. + * + * It should: + * 1) determine if the new forecast adjustments are acceptable to the appliance + * - if not return Failure. For example, if it may cause the home to be too hot + * or too cold, or a battery to be insufficiently charged + * 2) if the slot adjustments are acceptable, then update the forecast + * 3) notify the appliance to follow the revised schedule + */ Status DeviceEnergyManagementDelegate::ModifyForecastRequest( const uint32_t forecastId, const DataModel::DecodableList & slotAdjustments) { Status status = Status::UnsupportedCommand; // Status::Success; - // TODO: implement + + // TODO: implement the behaviour above return status; } +/** + * @brief Delegate handler for RequestConstraintBasedForecast + * + * Note: Only basic checking of the validity of the RequestConstraintBasedForecast has been + * done by the lower layer. This is a more complex use-case and requires higher-level + * work by the delegate. + * + * It should: + * 1) perform a higher level optimization (e.g. using tariff information, and user preferences) + * 2) if a solution can be found, then update the forecast, else return Failure + * 3) notify the appliance to follow the revised schedule + */ Status DeviceEnergyManagementDelegate::RequestConstraintBasedForecast( const DataModel::DecodableList & constraints) { Status status = Status::UnsupportedCommand; // Status::Success; - // TODO: implement + // TODO: implement the behaviour above return status; } From 622424683c8bb2978e3db27121a9c5edb02b5bbc Mon Sep 17 00:00:00 2001 From: James Harrow Date: Wed, 20 Dec 2023 21:46:18 +0000 Subject: [PATCH 033/114] Updated BUILD.gn to remove duplicated files from all-clusters-common and energy-management-common --- .../DeviceEnergyManagementDelegateImpl.h | 83 -- .../include/DeviceEnergyManagementManager.h | 57 -- .../include/EVSECallbacks.h | 84 -- .../include/EnergyEvseDelegateImpl.h | 206 ----- .../include/EnergyEvseManager.h | 57 -- .../DeviceEnergyManagementDelegateImpl.cpp | 398 -------- .../src/DeviceEnergyManagementManager.cpp | 33 - .../src/EnergyEvseDelegateImpl.cpp | 847 ------------------ .../src/EnergyEvseManager.cpp | 33 - examples/all-clusters-app/linux/BUILD.gn | 14 +- 10 files changed, 8 insertions(+), 1804 deletions(-) delete mode 100644 examples/all-clusters-app/all-clusters-common/include/DeviceEnergyManagementDelegateImpl.h delete mode 100644 examples/all-clusters-app/all-clusters-common/include/DeviceEnergyManagementManager.h delete mode 100644 examples/all-clusters-app/all-clusters-common/include/EVSECallbacks.h delete mode 100644 examples/all-clusters-app/all-clusters-common/include/EnergyEvseDelegateImpl.h delete mode 100644 examples/all-clusters-app/all-clusters-common/include/EnergyEvseManager.h delete mode 100644 examples/all-clusters-app/all-clusters-common/src/DeviceEnergyManagementDelegateImpl.cpp delete mode 100644 examples/all-clusters-app/all-clusters-common/src/DeviceEnergyManagementManager.cpp delete mode 100644 examples/all-clusters-app/all-clusters-common/src/EnergyEvseDelegateImpl.cpp delete mode 100644 examples/all-clusters-app/all-clusters-common/src/EnergyEvseManager.cpp diff --git a/examples/all-clusters-app/all-clusters-common/include/DeviceEnergyManagementDelegateImpl.h b/examples/all-clusters-app/all-clusters-common/include/DeviceEnergyManagementDelegateImpl.h deleted file mode 100644 index 464a683510b3d7..00000000000000 --- a/examples/all-clusters-app/all-clusters-common/include/DeviceEnergyManagementDelegateImpl.h +++ /dev/null @@ -1,83 +0,0 @@ -/* - * - * Copyright (c) 2023 Project CHIP Authors - * All rights reserved. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -#pragma once - -#include "app/clusters/device-energy-management-server/device-energy-management-server.h" - -#include -#include -#include - -using chip::Protocols::InteractionModel::Status; -namespace chip { -namespace app { -namespace Clusters { -namespace DeviceEnergyManagement { - -/** - * The application delegate. - */ -class DeviceEnergyManagementDelegate : public DeviceEnergyManagement::Delegate -{ -public: - virtual Status PowerAdjustRequest(const int64_t power, const uint32_t duration) override; - virtual Status CancelPowerAdjustRequest() override; - virtual Status StartTimeAdjustRequest(const uint32_t requestedStartTime) override; - virtual Status PauseRequest(const uint32_t duration) override; - virtual Status ResumeRequest() override; - virtual Status - ModifyForecastRequest(const uint32_t forecastId, - const DataModel::DecodableList & slotAdjustments) override; - virtual Status RequestConstraintBasedForecast( - const DataModel::DecodableList & constraints) override; - - // ------------------------------------------------------------------ - // Get attribute methods - virtual ESATypeEnum GetESAType() override; - virtual bool GetESACanGenerate() override; - virtual ESAStateEnum GetESAState() override; - virtual int64_t GetAbsMinPower() override; - virtual int64_t GetAbsMaxPower() override; - virtual Attributes::PowerAdjustmentCapability::TypeInfo::Type GetPowerAdjustmentCapability() override; - virtual DataModel::Nullable GetForecast() override; - - // ------------------------------------------------------------------ - // Set attribute methods - virtual CHIP_ERROR SetESAType(ESATypeEnum) override; - virtual CHIP_ERROR SetESACanGenerate(bool) override; - virtual CHIP_ERROR SetESAState(ESAStateEnum) override; - virtual CHIP_ERROR SetAbsMinPower(int64_t) override; - virtual CHIP_ERROR SetAbsMaxPower(int64_t) override; - virtual CHIP_ERROR SetPowerAdjustmentCapability(Attributes::PowerAdjustmentCapability::TypeInfo::Type) override; - virtual CHIP_ERROR SetForecast(DataModel::Nullable) override; - -private: - ESATypeEnum mEsaType; - bool mEsaCanGenerate; - ESAStateEnum mEsaState; - int64_t mAbsMinPower; - int64_t mAbsMaxPower; - Attributes::PowerAdjustmentCapability::TypeInfo::Type mPowerAdjustmentCapability; - DataModel::Nullable mForecast; -}; - -} // namespace DeviceEnergyManagement -} // namespace Clusters -} // namespace app -} // namespace chip diff --git a/examples/all-clusters-app/all-clusters-common/include/DeviceEnergyManagementManager.h b/examples/all-clusters-app/all-clusters-common/include/DeviceEnergyManagementManager.h deleted file mode 100644 index 6d131dd4ae90fa..00000000000000 --- a/examples/all-clusters-app/all-clusters-common/include/DeviceEnergyManagementManager.h +++ /dev/null @@ -1,57 +0,0 @@ -/* - * - * Copyright (c) 2023 Project CHIP Authors - * All rights reserved. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -#pragma once - -#include -#include -#include -#include - -namespace chip { -namespace app { -namespace Clusters { - -using namespace chip::app::Clusters::DeviceEnergyManagement; -class DeviceEnergyManagementManager : public Instance -{ -public: - DeviceEnergyManagementManager(EndpointId aEndpointId, DeviceEnergyManagementDelegate & aDelegate, Feature aFeature, - OptionalCommands aOptionalCmds) : - DeviceEnergyManagement::Instance(aEndpointId, aDelegate, aFeature, aOptionalCmds) - { - mDelegate = &aDelegate; - } - - // Delete copy constructor and assignment operator. - DeviceEnergyManagementManager(const DeviceEnergyManagementManager &) = delete; - DeviceEnergyManagementManager(const DeviceEnergyManagementManager &&) = delete; - DeviceEnergyManagementManager & operator=(const DeviceEnergyManagementManager &) = delete; - - CHIP_ERROR Init(); - void Shutdown(); - - DeviceEnergyManagementDelegate * GetDelegate() { return mDelegate; }; - -private: - DeviceEnergyManagementDelegate * mDelegate; -}; - -} // namespace Clusters -} // namespace app -} // namespace chip diff --git a/examples/all-clusters-app/all-clusters-common/include/EVSECallbacks.h b/examples/all-clusters-app/all-clusters-common/include/EVSECallbacks.h deleted file mode 100644 index 5bdac2f8e853d6..00000000000000 --- a/examples/all-clusters-app/all-clusters-common/include/EVSECallbacks.h +++ /dev/null @@ -1,84 +0,0 @@ -/* - * - * Copyright (c) 2023 Project CHIP Authors - * All rights reserved. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -#pragma once - -namespace chip { -namespace app { -namespace Clusters { - -using namespace chip::app::Clusters::EnergyEvse; - -/* This callbacks mechanism is intended to allow different delegates to - * dispatch notifications that something has changed. - * - * This is not specific to the EnergyEVSE cluster, but includes DeviceEnergyManagement - * and potential future clusters. - */ -enum EVSECallbackType -{ - /* - * The State has changed (e.g. from Disabled to Charging, or vice-versa) - */ - StateChanged, - /* - * ChargeCurrent has changed - */ - ChargeCurrentChanged, - /* - * Charging Preferences have changed - */ - ChargingPreferencesChanged, - /* - * DeviceEnergyManagement has changed - */ - DeviceEnergyManagementChanged, -}; - -struct EVSECbInfo -{ - EVSECallbackType type; - - union - { - /* for type = StateChanged */ - struct - { - StateEnum state; - SupplyStateEnum supplyState; - } StateChange; - - /* for type = ChargeCurrentChanged */ - struct - { - int64_t maximumChargeCurrent; - } ChargingCurrent; - }; -}; - -typedef void (*EVSECallbackFunc)(const EVSECbInfo * cb, intptr_t arg); - -struct EVSECallbackWrapper -{ - EVSECallbackFunc handler; - intptr_t arg; -}; - -} // namespace Clusters -} // namespace app -} // namespace chip diff --git a/examples/all-clusters-app/all-clusters-common/include/EnergyEvseDelegateImpl.h b/examples/all-clusters-app/all-clusters-common/include/EnergyEvseDelegateImpl.h deleted file mode 100644 index f3c003d081fc6e..00000000000000 --- a/examples/all-clusters-app/all-clusters-common/include/EnergyEvseDelegateImpl.h +++ /dev/null @@ -1,206 +0,0 @@ -/* - * - * Copyright (c) 2023 Project CHIP Authors - * All rights reserved. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -#pragma once - -#include "app/clusters/energy-evse-server/energy-evse-server.h" -#include - -#include -#include -#include - -using chip::Protocols::InteractionModel::Status; -namespace chip { -namespace app { -namespace Clusters { -namespace EnergyEvse { - -/** - * The application delegate. - */ - -class EnergyEvseDelegate : public EnergyEvse::Delegate -{ -public: - ~EnergyEvseDelegate(); - - /** - * @brief Called when EVSE cluster receives Disable command - */ - Status Disable() override; - - /** - * @brief Called when EVSE cluster receives EnableCharging command - * - * @param chargingEnabledUntil - * @param minimumChargeCurrent (in mA) - * @param maximumChargeCurrent (in mA) - */ - Status EnableCharging(const DataModel::Nullable & chargingEnabledUntil, const int64_t & minimumChargeCurrent, - const int64_t & maximumChargeCurrent) override; - - /** - * @brief Called when EVSE cluster receives EnableDischarging command - * - * @param dischargingEnabledUntil - * @param maximumChargeCurrent (in mA) - */ - Status EnableDischarging(const DataModel::Nullable & dischargingEnabledUntil, - const int64_t & maximumDischargeCurrent) override; - - /** - * @brief Called when EVSE cluster receives StartDiagnostics command - */ - Status StartDiagnostics() override; - - /** - * @brief Called by EVSE Hardware to register a single callback handler - */ - Status HwRegisterEvseCallbackHandler(EVSECallbackFunc handler, intptr_t arg); - - // ----------------------------------------------------------------- - // Internal API to allow an EVSE to change its internal state etc - Status HwSetMaxHardwareCurrentLimit(int64_t currentmA); - Status HwSetCircuitCapacity(int64_t currentmA); - Status HwSetCableAssemblyLimit(int64_t currentmA); - Status HwSetState(StateEnum state); - Status HwSetFault(FaultStateEnum fault); - Status HwSetRFID(ByteSpan uid); - Status HwSetVehicleID(const CharSpan & vehID); - - // ------------------------------------------------------------------ - // Get attribute methods - StateEnum GetState() override; - CHIP_ERROR SetState(StateEnum); - - SupplyStateEnum GetSupplyState() override; - CHIP_ERROR SetSupplyState(SupplyStateEnum); - - FaultStateEnum GetFaultState() override; - CHIP_ERROR SetFaultState(FaultStateEnum); - - DataModel::Nullable GetChargingEnabledUntil() override; - CHIP_ERROR SetChargingEnabledUntil(uint32_t); - - DataModel::Nullable GetDischargingEnabledUntil() override; - CHIP_ERROR SetDischargingEnabledUntil(uint32_t); - - int64_t GetCircuitCapacity() override; - CHIP_ERROR SetCircuitCapacity(int64_t); - - int64_t GetMinimumChargeCurrent() override; - CHIP_ERROR SetMinimumChargeCurrent(int64_t); - - int64_t GetMaximumChargeCurrent() override; - CHIP_ERROR SetMaximumChargeCurrent(int64_t); - - int64_t GetMaximumDischargeCurrent() override; - CHIP_ERROR SetMaximumDischargeCurrent(int64_t); - - int64_t GetUserMaximumChargeCurrent() override; - CHIP_ERROR SetUserMaximumChargeCurrent(int64_t) override; - - uint32_t GetRandomizationDelayWindow() override; - CHIP_ERROR SetRandomizationDelayWindow(uint32_t) override; - - /* PREF attributes */ - uint8_t GetNumberOfWeeklyTargets() override; - uint8_t GetNumberOfDailyTargets() override; - DataModel::Nullable GetNextChargeStartTime() override; - DataModel::Nullable GetNextChargeTargetTime() override; - DataModel::Nullable GetNextChargeRequiredEnergy() override; - DataModel::Nullable GetNextChargeTargetSoC() override; - - DataModel::Nullable GetApproximateEVEfficiency() override; - CHIP_ERROR SetApproximateEVEfficiency(uint16_t) override; - - /* SOC attributes */ - DataModel::Nullable GetStateOfCharge() override; - DataModel::Nullable GetBatteryCapacity() override; - /* PNC attributes*/ - DataModel::Nullable GetVehicleID() override; - /* Session SESS attributes */ - DataModel::Nullable GetSessionID() override; - DataModel::Nullable GetSessionDuration() override; - DataModel::Nullable GetSessionEnergyCharged() override; - DataModel::Nullable GetSessionEnergyDischarged() override; - -private: - /* Constants */ - static constexpr int DEFAULT_MIN_CHARGE_CURRENT = 6000; /* 6A */ - static constexpr int DEFAULT_USER_MAXIMUM_CHARGE_CURRENT = kMaximumChargeCurrent; /* 80A */ - static constexpr int DEFAULT_RANDOMIZATION_DELAY_WINDOW = 600; /* 600s */ - static constexpr int kMaxVehicleIDBufSize = 32; - - /* private variables for controlling the hardware - these are not attributes */ - int64_t mMaxHardwareCurrentLimit = 0; /* Hardware current limit in mA */ - int64_t mCableAssemblyCurrentLimit = 0; /* Cable limit detected when cable is plugged in, in mA */ - int64_t mMaximumChargingCurrentLimitFromCommand = 0; /* Value of current maximum limit when charging enabled */ - int64_t mActualChargingCurrentLimit = 0; - StateEnum mHwState = StateEnum::kNotPluggedIn; /* Hardware state */ - - /* Callback related */ - EVSECallbackWrapper mCallbacks = { .handler = nullptr, .arg = 0 }; /* Wrapper to allow callbacks to be registered */ - Status NotifyApplicationCurrentLimitChange(int64_t maximumChargeCurrent); - Status NotifyApplicationStateChange(); - - /** - * @brief Helper function to work out the charge limit based on conditions and settings - */ - Status ComputeMaxChargeCurrentLimit(); - - /* Attributes */ - StateEnum mState = StateEnum::kNotPluggedIn; - SupplyStateEnum mSupplyState = SupplyStateEnum::kDisabled; - FaultStateEnum mFaultState = FaultStateEnum::kNoError; - DataModel::Nullable mChargingEnabledUntil; // TODO Default to 0 to indicate disabled - DataModel::Nullable mDischargingEnabledUntil; // TODO Default to 0 to indicate disabled - int64_t mCircuitCapacity = 0; - int64_t mMinimumChargeCurrent = DEFAULT_MIN_CHARGE_CURRENT; - int64_t mMaximumChargeCurrent = 0; - int64_t mMaximumDischargeCurrent = 0; - int64_t mUserMaximumChargeCurrent = DEFAULT_USER_MAXIMUM_CHARGE_CURRENT; // TODO update spec - uint32_t mRandomizationDelayWindow = DEFAULT_RANDOMIZATION_DELAY_WINDOW; - /* PREF attributes */ - uint8_t mNumberOfWeeklyTargets = 0; - uint8_t mNumberOfDailyTargets = 1; - DataModel::Nullable mNextChargeStartTime; - DataModel::Nullable mNextChargeTargetTime; - DataModel::Nullable mNextChargeRequiredEnergy; - DataModel::Nullable mNextChargeTargetSoC; - DataModel::Nullable mApproximateEVEfficiency; - - /* SOC attributes */ - DataModel::Nullable mStateOfCharge; - DataModel::Nullable mBatteryCapacity; - - /* PNC attributes*/ - DataModel::Nullable mVehicleID; - - /* Session SESS attributes */ - DataModel::Nullable mSessionID; - DataModel::Nullable mSessionDuration; - DataModel::Nullable mSessionEnergyCharged; - DataModel::Nullable mSessionEnergyDischarged; -}; - -} // namespace EnergyEvse -} // namespace Clusters -} // namespace app -} // namespace chip diff --git a/examples/all-clusters-app/all-clusters-common/include/EnergyEvseManager.h b/examples/all-clusters-app/all-clusters-common/include/EnergyEvseManager.h deleted file mode 100644 index 9875c397990ef2..00000000000000 --- a/examples/all-clusters-app/all-clusters-common/include/EnergyEvseManager.h +++ /dev/null @@ -1,57 +0,0 @@ -/* - * - * Copyright (c) 2023 Project CHIP Authors - * All rights reserved. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -#pragma once - -#include -#include -#include -#include - -namespace chip { -namespace app { -namespace Clusters { - -using namespace chip::app::Clusters::EnergyEvse; -class EnergyEvseManager : public Instance -{ -public: - EnergyEvseManager(EndpointId aEndpointId, EnergyEvseDelegate & aDelegate, Feature aFeature, OptionalAttributes aOptionalAttrs, - OptionalCommands aOptionalCmds) : - EnergyEvse::Instance(aEndpointId, aDelegate, aFeature, aOptionalAttrs, aOptionalCmds) - { - mDelegate = &aDelegate; - } - - // Delete copy constructor and assignment operator. - EnergyEvseManager(const EnergyEvseManager &) = delete; - EnergyEvseManager(const EnergyEvseManager &&) = delete; - EnergyEvseManager & operator=(const EnergyEvseManager &) = delete; - - CHIP_ERROR Init(); - void Shutdown(); - - EnergyEvseDelegate * GetDelegate() { return mDelegate; }; - -private: - EnergyEvseDelegate * mDelegate; -}; - -} // namespace Clusters -} // namespace app -} // namespace chip diff --git a/examples/all-clusters-app/all-clusters-common/src/DeviceEnergyManagementDelegateImpl.cpp b/examples/all-clusters-app/all-clusters-common/src/DeviceEnergyManagementDelegateImpl.cpp deleted file mode 100644 index 74ad9e9e23f47a..00000000000000 --- a/examples/all-clusters-app/all-clusters-common/src/DeviceEnergyManagementDelegateImpl.cpp +++ /dev/null @@ -1,398 +0,0 @@ -/* - * - * Copyright (c) 2023 Project CHIP Authors - * All rights reserved. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -#include "DeviceEnergyManagementDelegateImpl.h" - -#include -#include -#include - -using namespace chip; -using namespace chip::app; -using namespace chip::app::Clusters; -using namespace chip::app::Clusters::DeviceEnergyManagement; -using namespace chip::app::Clusters::DeviceEnergyManagement::Attributes; - -using chip::Optional; -using namespace chip::app; -using CostsList = DataModel::List; - -/** - * @brief Delegate handler for PowerAdjustRequest - * - * Note: checking of the validity of the PowerAdjustRequest has been done by the lower layer - * - * This function needs to notify the appliance that it should apply a new power setting. - * It should: - * 1) notify the appliance - if the appliance hardware cannot be adjusted, then return Failure - * 2) start a timer (or restart the existing PowerAdjust timer) for duration seconds - * 3) generate a PowerAdjustStart event (if there is not an existing PowerAdjustRequest running) - * 4) if appropriate, update the forecast with the new expected end time - * - * and when the timer expires: - * 5) notify the appliance's that it can resume its intended power setting (or go idle) - * 6) generate a PowerAdjustEnd event with cause NormalCompletion - * 7) if necessary, update the forecast with new expected end time - */ -Status DeviceEnergyManagementDelegate::PowerAdjustRequest(const int64_t power, const uint32_t duration) -{ - Status status = Status::UnsupportedCommand; // Status::Success; - - // TODO: implement - mEsaState = ESAStateEnum::kPowerAdjustActive; - - // TODO: Generate a PowerAdjustStart Event, then begins to adjust its power - // When done, raise PowerAdjustEnd & ESAState set to kOnline. - - MatterReportingAttributeChangeCallback(mEndpointId, DeviceEnergyManagement::Id, ESAState::Id); - - return status; -} -/** - * @brief Delegate handler for CancelPowerAdjustRequest - * - * Note: checking of the validity of the CancelPowerAdjustRequest has been done by the lower layer - * - * This function needs to notify the appliance that it should resume its intended power setting (or go idle). - - * It should: - * 1) notify the appliance's that it can resume its intended power setting (or go idle) - * 2) generate a PowerAdjustEnd event with cause code Cancelled - * 3) if necessary, update the forecast with new expected end time - */ -Status DeviceEnergyManagementDelegate::CancelPowerAdjustRequest() -{ - Status status = Status::UnsupportedCommand; // Status::Success; - - // TODO: implement - /* TODO: If the command is accepted, the ESA SHALL generate an PowerAdjustEnd Event. */ - mEsaState = ESAStateEnum::kOnline; - MatterReportingAttributeChangeCallback(mEndpointId, DeviceEnergyManagement::Id, ESAState::Id); - - return status; -} - -/** - * @brief Delegate handler for StartTimeAdjustRequest - * - * Note: checking of the validity of the StartTimeAdjustRequest has been done by the lower layer - * - * This function needs to notify the appliance that the forecast has been updated by a client. - * - * It should: - * 1) update the forecast attribute with the revised start time - * 2) send a callback notification to the appliance so it can refresh its internal schedule - */ -Status DeviceEnergyManagementDelegate::StartTimeAdjustRequest(const uint32_t requestedStartTime) -{ - DataModel::Nullable forecast = GetForecast(); - - if (forecast.IsNull()) - { - return Status::Failure; - } - - uint32_t duration = forecast.Value().endTime - forecast.Value().startTime; // the current entire forecast duration - - /* Modify start time and end time */ - forecast.Value().startTime = requestedStartTime; - forecast.Value().endTime = requestedStartTime + duration; - - SetForecast(forecast); // This will increment forecast ID - - // TODO: callback to the appliance to notify it of a new start time - - return Status::Success; -} -/** - * @brief Delegate handler for Pause Request - * - * Note: checking of the validity of the Pause Request has been done by the lower layer - * - * This function needs to notify the appliance that it should now pause. - * It should: - * 1) pause the appliance - if the appliance hardware cannot be paused, then return Failure - * 2) start a timer for duration seconds - * 3) generate a Paused event - * 4) update the forecast with the new expected end time - * - * and when the timer expires: - * 5) restore the appliance's operational state - * 6) generate a Resumed event - * 7) if necessary, update the forecast with new expected end time - */ -Status DeviceEnergyManagementDelegate::PauseRequest(const uint32_t duration) -{ - Status status = Status::UnsupportedCommand; // Status::Success; - // TODO: implement the behaviour above - return status; -} - -/** - * @brief Delegate handler for ResumeRequest - * - * Note: checking of the validity of the ResumeRequest has been done by the lower layer - * - * This function needs to notify the appliance that it should now resume operation - * - * It should: - * 1) restore the appliance's operational state - * 2) generate a Resumed event - * 3) update the forecast with new expected end time (given that the pause duration was shorter than originally requested) - * - */ -Status DeviceEnergyManagementDelegate::ResumeRequest() -{ - Status status = Status::UnsupportedCommand; // Status::Success; - - // TODO: implement the behaviour above - SetESAState(ESAStateEnum::kOnline); - - return status; -} - -/** - * @brief Delegate handler for ModifyForecastRequest - * - * Note: Only basic checking of the validity of the ModifyForecastRequest has been - * done by the lower layer. This is a more complex use-case and requires higher-level - * work by the delegate. - * - * It should: - * 1) determine if the new forecast adjustments are acceptable to the appliance - * - if not return Failure. For example, if it may cause the home to be too hot - * or too cold, or a battery to be insufficiently charged - * 2) if the slot adjustments are acceptable, then update the forecast - * 3) notify the appliance to follow the revised schedule - */ -Status DeviceEnergyManagementDelegate::ModifyForecastRequest( - const uint32_t forecastId, const DataModel::DecodableList & slotAdjustments) -{ - Status status = Status::UnsupportedCommand; // Status::Success; - - // TODO: implement the behaviour above - return status; -} - -/** - * @brief Delegate handler for RequestConstraintBasedForecast - * - * Note: Only basic checking of the validity of the RequestConstraintBasedForecast has been - * done by the lower layer. This is a more complex use-case and requires higher-level - * work by the delegate. - * - * It should: - * 1) perform a higher level optimization (e.g. using tariff information, and user preferences) - * 2) if a solution can be found, then update the forecast, else return Failure - * 3) notify the appliance to follow the revised schedule - */ -Status DeviceEnergyManagementDelegate::RequestConstraintBasedForecast( - const DataModel::DecodableList & constraints) -{ - Status status = Status::UnsupportedCommand; // Status::Success; - // TODO: implement the behaviour above - return status; -} - -// ------------------------------------------------------------------ -// Get attribute methods -ESATypeEnum DeviceEnergyManagementDelegate::GetESAType() -{ - return mEsaType; -} - -bool DeviceEnergyManagementDelegate::GetESACanGenerate() -{ - return mEsaCanGenerate; -} - -ESAStateEnum DeviceEnergyManagementDelegate::GetESAState() -{ - return mEsaState; -} - -int64_t DeviceEnergyManagementDelegate::GetAbsMinPower() -{ - return mAbsMinPower; -} - -int64_t DeviceEnergyManagementDelegate::GetAbsMaxPower() -{ - return mAbsMaxPower; -} - -PowerAdjustmentCapability::TypeInfo::Type DeviceEnergyManagementDelegate::GetPowerAdjustmentCapability() -{ - return mPowerAdjustmentCapability; -} - -DataModel::Nullable DeviceEnergyManagementDelegate::GetForecast() -{ - return mForecast; -} - -// ------------------------------------------------------------------ -// Set attribute methods - -CHIP_ERROR DeviceEnergyManagementDelegate::SetESAType(ESATypeEnum newValue) -{ - ESATypeEnum oldValue = mEsaType; - - if (newValue >= ESATypeEnum::kUnknownEnumValue) - { - return CHIP_IM_GLOBAL_STATUS(ConstraintError); - } - - mEsaType = newValue; - if (oldValue != newValue) - { - ChipLogDetail(AppServer, "mEsaType updated to %d", static_cast(mEsaType)); - MatterReportingAttributeChangeCallback(mEndpointId, DeviceEnergyManagement::Id, ESAType::Id); - } - - return CHIP_NO_ERROR; -} - -CHIP_ERROR DeviceEnergyManagementDelegate::SetESACanGenerate(bool newValue) -{ - bool oldValue = mEsaCanGenerate; - - mEsaCanGenerate = newValue; - if (oldValue != newValue) - { - ChipLogDetail(AppServer, "mEsaCanGenerate updated to %d", static_cast(mEsaCanGenerate)); - MatterReportingAttributeChangeCallback(mEndpointId, DeviceEnergyManagement::Id, ESACanGenerate::Id); - } - - return CHIP_NO_ERROR; -} - -CHIP_ERROR DeviceEnergyManagementDelegate::SetESAState(ESAStateEnum newValue) -{ - ESAStateEnum oldValue = mEsaState; - - if (newValue >= ESAStateEnum::kUnknownEnumValue) - { - return CHIP_IM_GLOBAL_STATUS(ConstraintError); - } - - mEsaState = newValue; - if (oldValue != newValue) - { - ChipLogDetail(AppServer, "mEsaState updated to %d", static_cast(mEsaState)); - MatterReportingAttributeChangeCallback(mEndpointId, DeviceEnergyManagement::Id, ESAState::Id); - } - - return CHIP_NO_ERROR; -} - -CHIP_ERROR DeviceEnergyManagementDelegate::SetAbsMinPower(int64_t newValue) -{ - int64_t oldValue = mAbsMinPower; - - mAbsMinPower = newValue; - if (oldValue != newValue) - { - ChipLogDetail(AppServer, "mAbsMinPower updated to %d", static_cast(mAbsMinPower)); - MatterReportingAttributeChangeCallback(mEndpointId, DeviceEnergyManagement::Id, AbsMinPower::Id); - } - - return CHIP_NO_ERROR; -} - -CHIP_ERROR DeviceEnergyManagementDelegate::SetAbsMaxPower(int64_t newValue) -{ - int64_t oldValue = mAbsMaxPower; - - mAbsMaxPower = newValue; - if (oldValue != newValue) - { - ChipLogDetail(AppServer, "mAbsMaxPower updated to %d", static_cast(mAbsMaxPower)); - MatterReportingAttributeChangeCallback(mEndpointId, DeviceEnergyManagement::Id, AbsMaxPower::Id); - } - - return CHIP_NO_ERROR; -} - -CHIP_ERROR -DeviceEnergyManagementDelegate::SetPowerAdjustmentCapability(PowerAdjustmentCapability::TypeInfo::Type powerAdjustmentCapability) -{ - if (powerAdjustmentCapability.IsNull()) - { - mPowerAdjustmentCapability.SetNull(); - ChipLogDetail(AppServer, "null src - %s", __FUNCTION__); - } - else - { - auto src = powerAdjustmentCapability.Value(); - auto target = mPowerAdjustmentCapability.Value(); - auto size = src.size(); - - if (size > 8) - { - return CHIP_ERROR_BAD_REQUEST; - } - - target.reduce_size(0); - - for (size_t i = 0; i < size; i++) - { - const_cast(target[i]) = src[i]; - } - } - - MatterReportingAttributeChangeCallback(mEndpointId, DeviceEnergyManagement::Id, PowerAdjustmentCapability::Id); - return CHIP_NO_ERROR; -} - -CHIP_ERROR DeviceEnergyManagementDelegate::SetForecast(DataModel::Nullable forecast) -{ - if (forecast.IsNull()) - { - mForecast.SetNull(); - ChipLogDetail(AppServer, "null src - %s", __FUNCTION__); - } - else - { - auto src = forecast.Value(); - auto target = mForecast.Value(); - - target.forecastId++; - target.activeSlotNumber = src.activeSlotNumber; - target.startTime = src.startTime; - target.endTime = src.endTime; - target.earliestStartTime = src.earliestStartTime; - target.latestEndTime = src.latestEndTime; - target.isPauseable = src.isPauseable; - - auto slots = src.slots; - auto size = slots.size(); - target.slots.reduce_size(0); // clear them - ChipLogDetail(AppServer, "src.slots.size() %d - %s", (int) size, __FUNCTION__); - - for (size_t i = 0; i < size; i++) - { - const_cast(target.slots[i]) = - slots[i]; // TODO: test if this works for optional/nullable stuff - } - } - - MatterReportingAttributeChangeCallback(mEndpointId, DeviceEnergyManagement::Id, Forecast::Id); - - return CHIP_NO_ERROR; -} diff --git a/examples/all-clusters-app/all-clusters-common/src/DeviceEnergyManagementManager.cpp b/examples/all-clusters-app/all-clusters-common/src/DeviceEnergyManagementManager.cpp deleted file mode 100644 index c31e0624e4c743..00000000000000 --- a/examples/all-clusters-app/all-clusters-common/src/DeviceEnergyManagementManager.cpp +++ /dev/null @@ -1,33 +0,0 @@ -/* - * - * Copyright (c) 2023 Project CHIP Authors - * All rights reserved. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -#include - -using namespace chip::app; -using namespace chip::app::Clusters; -using namespace chip::app::Clusters::DeviceEnergyManagement; - -CHIP_ERROR DeviceEnergyManagementManager::Init() -{ - return Instance::Init(); -} - -void DeviceEnergyManagementManager::Shutdown() -{ - Instance::Shutdown(); -} diff --git a/examples/all-clusters-app/all-clusters-common/src/EnergyEvseDelegateImpl.cpp b/examples/all-clusters-app/all-clusters-common/src/EnergyEvseDelegateImpl.cpp deleted file mode 100644 index 4cc83eaaf8a835..00000000000000 --- a/examples/all-clusters-app/all-clusters-common/src/EnergyEvseDelegateImpl.cpp +++ /dev/null @@ -1,847 +0,0 @@ -/* - * - * Copyright (c) 2023 Project CHIP Authors - * All rights reserved. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -#include -#include -#include -#include - -using namespace chip; -using namespace chip::app; -using namespace chip::app::DataModel; -using namespace chip::app::Clusters; -using namespace chip::app::Clusters::EnergyEvse; -using namespace chip::app::Clusters::EnergyEvse::Attributes; - -using chip::app::LogEvent; -using chip::Protocols::InteractionModel::Status; - -EnergyEvseDelegate::~EnergyEvseDelegate() -{ - // TODO Fix this as part of issue #30993 refactoring - if (!mVehicleID.IsNull()) - { - ChipLogDetail(AppServer, "Freeing VehicleID"); - delete[] mVehicleID.Value().data(); - } -} - -/** - * @brief Called when EVSE cluster receives Disable command - */ -Status EnergyEvseDelegate::Disable() -{ - ChipLogProgress(AppServer, "EnergyEvseDelegate::Disable()"); - - /* Update State */ - switch (mHwState) - { - case StateEnum::kNotPluggedIn: - SetState(StateEnum::kNotPluggedIn); - break; - - case StateEnum::kPluggedInNoDemand: - SetState(StateEnum::kPluggedInNoDemand); - break; - - case StateEnum::kPluggedInDemand: - SetState(StateEnum::kPluggedInDemand); - break; - - default: - ChipLogError(AppServer, "Unexpected EVSE hardware state"); - SetState(StateEnum::kFault); - break; - } - - /* update SupplyState */ - SetSupplyState(SupplyStateEnum::kDisabled); - - /* update ChargingEnabledUntil & DischargingEnabledUntil to show 0 */ - SetChargingEnabledUntil(0); - SetDischargingEnabledUntil(0); - - /* update MinimumChargeCurrent & MaximumChargeCurrent to 0 */ - SetMinimumChargeCurrent(0); - SetMaximumChargeCurrent(0); - - /* update MaximumDischargeCurrent to 0 */ - SetMaximumDischargeCurrent(0); - - NotifyApplicationStateChange(); - // TODO: Generate events - - return Status::Success; -} - -/** - * @brief Called when EVSE cluster receives EnableCharging command - * - * @param chargingEnabledUntil (can be null to indefinite charging) - * @param minimumChargeCurrent (in mA) - * @param maximumChargeCurrent (in mA) - */ -Status EnergyEvseDelegate::EnableCharging(const DataModel::Nullable & chargingEnabledUntil, - const int64_t & minimumChargeCurrent, const int64_t & maximumChargeCurrent) -{ - ChipLogProgress(AppServer, "EnergyEvseDelegate::EnableCharging()"); - - if (maximumChargeCurrent < kMinimumChargeCurrent || maximumChargeCurrent > kMaximumChargeCurrent) - { - ChipLogError(AppServer, "Maximum Current outside limits"); - return Status::ConstraintError; - } - - if (minimumChargeCurrent < kMinimumChargeCurrent || minimumChargeCurrent > kMaximumChargeCurrent) - { - ChipLogError(AppServer, "Maximum Current outside limits"); - return Status::ConstraintError; - } - - if (minimumChargeCurrent > maximumChargeCurrent) - { - ChipLogError(AppServer, "Minium Current > Maximum Current!"); - return Status::ConstraintError; - } - - if (chargingEnabledUntil.IsNull()) - { - /* Charging enabled indefinitely */ - ChipLogError(AppServer, "Charging enabled indefinitely"); - } - else - { - /* check chargingEnabledUntil is in the future */ - ChipLogError(AppServer, "Charging enabled until: %lu", static_cast(chargingEnabledUntil.Value())); - // TODO - // if (checkChargingEnabled) - } - - /* Check current state isn't already enabled */ - - /* If charging is already enabled, check that the parameters may have - changed, these may override an existing charging command */ - switch (mHwState) - { - case StateEnum::kNotPluggedIn: - // TODO handle errors here - SetState(StateEnum::kNotPluggedIn); - break; - - case StateEnum::kPluggedInNoDemand: - // TODO handle errors here - // TODO REFACTOR per Andrei's comment in PR30857 - can we collapse this switch statement? - SetState(StateEnum::kPluggedInNoDemand); - break; - - case StateEnum::kPluggedInDemand: - /* If the EVSE is asking for demand then enable charging */ - SetState(StateEnum::kPluggedInCharging); - break; - - default: - ChipLogError(AppServer, "Unexpected EVSE hardware state"); - SetState(StateEnum::kFault); - break; - } - - /* update SupplyState to say that charging is now enabled */ - SetSupplyState(SupplyStateEnum::kChargingEnabled); - - /* If it looks ok, store the min & max charging current */ - mMaximumChargingCurrentLimitFromCommand = maximumChargeCurrent; - SetMinimumChargeCurrent(minimumChargeCurrent); - // TODO persist these to KVS - - // TODO: Generate events - - NotifyApplicationStateChange(); - - return this->ComputeMaxChargeCurrentLimit(); -} - -/** - * @brief Called when EVSE cluster receives EnableDischarging command - * - * @param dischargingEnabledUntil (can be null to indefinite discharging) - * @param maximumChargeCurrent (in mA) - */ -Status EnergyEvseDelegate::EnableDischarging(const DataModel::Nullable & dischargingEnabledUntil, - const int64_t & maximumDischargeCurrent) -{ - ChipLogProgress(AppServer, "EnergyEvseDelegate::EnableDischarging() called."); - - /* update SupplyState */ - SetSupplyState(SupplyStateEnum::kDischargingEnabled); - - // TODO: Generate events - - NotifyApplicationStateChange(); - - return Status::Success; -} - -/** - * @brief Called when EVSE cluster receives StartDiagnostics command - */ -Status EnergyEvseDelegate::StartDiagnostics() -{ - /* For EVSE manufacturers to customize */ - ChipLogProgress(AppServer, "EnergyEvseDelegate::StartDiagnostics()"); - - /* update SupplyState to indicate we are now in Diagnostics mode */ - SetSupplyState(SupplyStateEnum::kDisabledDiagnostics); - - // TODO: Generate events - - // TODO: Notify Application to implement Diagnostics - - NotifyApplicationStateChange(); - - return Status::Success; -} - -/* --------------------------------------------------------------------------- - * EVSE Hardware interface below - */ - -/** - * @brief Called by EVSE Hardware to register a callback handler mechanism - * - * This is normally called at start-up. - * - * @param EVSECallbackFunct - function pointer to call - * @param intptr_t - optional context to provide back to callback handler - */ -Status EnergyEvseDelegate::HwRegisterEvseCallbackHandler(EVSECallbackFunc handler, intptr_t arg) -{ - if (mCallbacks.handler != nullptr) - { - ChipLogError(AppServer, "Callback handler already initialized"); - return Status::Failure; - } - mCallbacks.handler = handler; - mCallbacks.arg = arg; - - return Status::Success; -} - -/** - * @brief Called by EVSE Hardware to notify the delegate of the maximum - * current limit supported by the hardware. - * - * This is normally called at start-up. - * - * @param currentmA - Maximum current limit supported by the hardware - */ -Status EnergyEvseDelegate::HwSetMaxHardwareCurrentLimit(int64_t currentmA) -{ - if (currentmA < kMinimumChargeCurrent || currentmA > kMaximumChargeCurrent) - { - return Status::ConstraintError; - } - - /* there is no attribute to store this so store in private variable */ - mMaxHardwareCurrentLimit = currentmA; - - return this->ComputeMaxChargeCurrentLimit(); -} - -/** - * @brief Called by EVSE Hardware to notify the delegate of maximum electrician - * set current limit. - * - * This is normally called at start-up when reading from DIP-switch - * settings. - * - * @param currentmA - Maximum current limit specified by electrician - */ -Status EnergyEvseDelegate::HwSetCircuitCapacity(int64_t currentmA) -{ - if (currentmA < kMinimumChargeCurrent || currentmA > kMaximumChargeCurrent) - { - return Status::ConstraintError; - } - - mCircuitCapacity = currentmA; - MatterReportingAttributeChangeCallback(mEndpointId, EnergyEvse::Id, CircuitCapacity::Id); - - return this->ComputeMaxChargeCurrentLimit(); -} - -/** - * @brief Called by EVSE Hardware to notify the delegate of the cable assembly - * current limit. - * - * This is normally called when the EV is plugged into the EVSE and the - * PP voltage is measured by the EVSE. A pull-up resistor in the cable - * causes a voltage drop. Different current limits can be indicated - * using different resistors, which results in different voltages - * measured by the EVSE. - * - * @param currentmA - Maximum current limit detected from Cable assembly - */ -Status EnergyEvseDelegate::HwSetCableAssemblyLimit(int64_t currentmA) -{ - if (currentmA < kMinimumChargeCurrent || currentmA > kMaximumChargeCurrent) - { - return Status::ConstraintError; - } - - /* there is no attribute to store this so store in private variable */ - mCableAssemblyCurrentLimit = currentmA; - - return this->ComputeMaxChargeCurrentLimit(); -} - -/** - * @brief Called by EVSE Hardware to indicate if EV is detected - * - * The only allowed states that the EVSE hardware can set are: - * kNotPluggedIn - * kPluggedInNoDemand - * kPluggedInDemand - * - * @param StateEnum - the state of the EV being plugged in and asking for demand etc - */ -Status EnergyEvseDelegate::HwSetState(StateEnum state) -{ - switch (state) - { - case StateEnum::kNotPluggedIn: - // TODO - work out logic here - mHwState = state; - break; - case StateEnum::kPluggedInNoDemand: - // TODO - work out logic here - mHwState = state; - break; - case StateEnum::kPluggedInDemand: - // TODO - work out logic here - mHwState = state; - break; - - default: - /* All other states should be managed by the Delegate */ - // TODO (assert?) - break; - } - - return Status::Success; -} - -/** - * @brief Called by EVSE Hardware to indicate a fault - * - * @param FaultStateEnum - the fault condition detected - */ -Status EnergyEvseDelegate::HwSetFault(FaultStateEnum fault) -{ - ChipLogProgress(AppServer, "EnergyEvseDelegate::Fault()"); - - if (fault == FaultStateEnum::kNoError) - { - /* Update State to previous state */ - // TODO: need to work out the logic here! - - /* Update SupplyState to previous state */ - } - else - { - /* Update State & SupplyState */ - SetState(StateEnum::kFault); - SetSupplyState(SupplyStateEnum::kDisabledError); - } - - /* Update FaultState */ - SetFaultState(fault); - - // TODO: Generate events - - return Status::Success; -} - -/** - * @brief Called by EVSE Hardware to Send a RFID event - * - * @param ByteSpan RFID tag value (max 10 octets) - */ -Status EnergyEvseDelegate::HwSetRFID(ByteSpan uid) -{ - Events::Rfid::Type event{ .uid = uid }; - EventNumber eventNumber; - CHIP_ERROR error = LogEvent(event, mEndpointId, eventNumber); - if (CHIP_NO_ERROR != error) - { - ChipLogError(Zcl, "[Notify] Unable to send notify event: %s [endpointId=%d]", error.AsString(), mEndpointId); - return Status::Failure; - } - - return Status::Success; -} - -/** - * @brief Called by EVSE Hardware to share the VehicleID - * - * This routine will make a copy of the string so the callee doesn't - * have to hold onto it forever. - * - * @param CharSpan containing up to 32 chars. - */ -Status EnergyEvseDelegate::HwSetVehicleID(const CharSpan & newValue) -{ - // TODO this code to be refactored - See Issue #30993 - if (!mVehicleID.IsNull() && newValue.data_equal(mVehicleID.Value())) - { - return Status::Success; - } - - /* create a copy of the string so the callee doesn't have to keep it */ - char * destinationBuffer = new char[kMaxVehicleIDBufSize]; - - MutableCharSpan destinationString(destinationBuffer, kMaxVehicleIDBufSize); - CHIP_ERROR err = CopyCharSpanToMutableCharSpan(newValue, destinationString); - if (err != CHIP_NO_ERROR) - { - ChipLogError(AppServer, "HwSetVehicleID - could not copy vehicleID"); - delete[] destinationBuffer; - return Status::Failure; - } - - if (!mVehicleID.IsNull()) - { - delete[] mVehicleID.Value().data(); - } - - mVehicleID = MakeNullable(static_cast(destinationString)); - - ChipLogDetail(AppServer, "VehicleID updated %.*s", static_cast(mVehicleID.Value().size()), mVehicleID.Value().data()); - MatterReportingAttributeChangeCallback(mEndpointId, EnergyEvse::Id, VehicleID::Id); - - return Status::Success; -} - -/* --------------------------------------------------------------------------- - * Functions below are private helper functions internal to the delegate - */ - -/** - * @brief Called to compute the safe charging current limit - * - * mActualChargingCurrentLimit is the minimum of: - * - MaxHardwareCurrentLimit (of the hardware) - * - CircuitCapacity (set by the electrician - less than the hardware) - * - CableAssemblyLimit (detected when the cable is inserted) - * - MaximumChargeCurrent (from charging command) - * - UserMaximumChargeCurrent (could dynamically change) - * - */ -Status EnergyEvseDelegate::ComputeMaxChargeCurrentLimit() -{ - int64_t oldValue; - - oldValue = mActualChargingCurrentLimit; - mActualChargingCurrentLimit = mMaxHardwareCurrentLimit; - mActualChargingCurrentLimit = min(mActualChargingCurrentLimit, mCircuitCapacity); - mActualChargingCurrentLimit = min(mActualChargingCurrentLimit, mCableAssemblyCurrentLimit); - mActualChargingCurrentLimit = min(mActualChargingCurrentLimit, mMaximumChargingCurrentLimitFromCommand); - mActualChargingCurrentLimit = min(mActualChargingCurrentLimit, mUserMaximumChargeCurrent); - - /* Set the actual max charging current attribute */ - mMaximumChargeCurrent = mActualChargingCurrentLimit; - - if (oldValue != mMaximumChargeCurrent) - { - ChipLogDetail(AppServer, "MaximumChargeCurrent updated to %ld", static_cast(mMaximumChargeCurrent)); - MatterReportingAttributeChangeCallback(mEndpointId, EnergyEvse::Id, MaximumChargeCurrent::Id); - - /* Call the EV Charger hardware current limit callback */ - NotifyApplicationCurrentLimitChange(mMaximumChargeCurrent); - } - return Status::Success; -} - -Status EnergyEvseDelegate::NotifyApplicationCurrentLimitChange(int64_t maximumChargeCurrent) -{ - EVSECbInfo cbInfo; - - cbInfo.type = EVSECallbackType::ChargeCurrentChanged; - cbInfo.ChargingCurrent.maximumChargeCurrent = maximumChargeCurrent; - - if (mCallbacks.handler != nullptr) - { - mCallbacks.handler(&cbInfo, mCallbacks.arg); - } - - return Status::Success; -} - -Status EnergyEvseDelegate::NotifyApplicationStateChange() -{ - EVSECbInfo cbInfo; - - cbInfo.type = EVSECallbackType::StateChanged; - cbInfo.StateChange.state = mState; - cbInfo.StateChange.supplyState = mSupplyState; - - if (mCallbacks.handler != nullptr) - { - mCallbacks.handler(&cbInfo, mCallbacks.arg); - } - - return Status::Success; -} - -/** - * Attribute methods - */ -/* State */ -StateEnum EnergyEvseDelegate::GetState() -{ - return mState; -} - -CHIP_ERROR EnergyEvseDelegate::SetState(StateEnum newValue) -{ - StateEnum oldValue = mState; - if (newValue >= StateEnum::kUnknownEnumValue) - { - return CHIP_IM_GLOBAL_STATUS(ConstraintError); - } - - mState = newValue; - if (oldValue != mState) - { - ChipLogDetail(AppServer, "State updated to %d", static_cast(mState)); - MatterReportingAttributeChangeCallback(mEndpointId, EnergyEvse::Id, State::Id); - } - - return CHIP_NO_ERROR; -} - -/* SupplyState */ -SupplyStateEnum EnergyEvseDelegate::GetSupplyState() -{ - return mSupplyState; -} - -CHIP_ERROR EnergyEvseDelegate::SetSupplyState(SupplyStateEnum newValue) -{ - SupplyStateEnum oldValue = mSupplyState; - - if (newValue >= SupplyStateEnum::kUnknownEnumValue) - { - return CHIP_IM_GLOBAL_STATUS(ConstraintError); - } - - mSupplyState = newValue; - if (oldValue != mSupplyState) - { - ChipLogDetail(AppServer, "SupplyState updated to %d", static_cast(mSupplyState)); - MatterReportingAttributeChangeCallback(mEndpointId, EnergyEvse::Id, SupplyState::Id); - } - return CHIP_NO_ERROR; -} - -/* FaultState */ -FaultStateEnum EnergyEvseDelegate::GetFaultState() -{ - return mFaultState; -} - -CHIP_ERROR EnergyEvseDelegate::SetFaultState(FaultStateEnum newValue) -{ - FaultStateEnum oldValue = mFaultState; - - if (newValue >= FaultStateEnum::kUnknownEnumValue) - { - return CHIP_IM_GLOBAL_STATUS(ConstraintError); - } - - mFaultState = newValue; - if (oldValue != mFaultState) - { - ChipLogDetail(AppServer, "FaultState updated to %d", static_cast(mFaultState)); - MatterReportingAttributeChangeCallback(mEndpointId, EnergyEvse::Id, FaultState::Id); - } - return CHIP_NO_ERROR; -} - -/* ChargingEnabledUntil */ -DataModel::Nullable EnergyEvseDelegate::GetChargingEnabledUntil() -{ - return mChargingEnabledUntil; -} - -CHIP_ERROR EnergyEvseDelegate::SetChargingEnabledUntil(uint32_t newValue) -{ - DataModel::Nullable oldValue = mChargingEnabledUntil; - - mChargingEnabledUntil = MakeNullable(newValue); - if ((oldValue.IsNull()) || (oldValue.Value() != newValue)) - { - ChipLogDetail(AppServer, "ChargingEnabledUntil updated to %lu", - static_cast(mChargingEnabledUntil.Value())); - MatterReportingAttributeChangeCallback(mEndpointId, EnergyEvse::Id, ChargingEnabledUntil::Id); - } - return CHIP_NO_ERROR; -} - -/* DischargingEnabledUntil */ -DataModel::Nullable EnergyEvseDelegate::GetDischargingEnabledUntil() -{ - return mDischargingEnabledUntil; -} - -CHIP_ERROR EnergyEvseDelegate::SetDischargingEnabledUntil(uint32_t newValue) -{ - DataModel::Nullable oldValue = mDischargingEnabledUntil; - - mDischargingEnabledUntil = MakeNullable(newValue); - if ((oldValue.IsNull()) || (oldValue.Value() != newValue)) - { - ChipLogDetail(AppServer, "DischargingEnabledUntil updated to %lu", - static_cast(mDischargingEnabledUntil.Value())); - MatterReportingAttributeChangeCallback(mEndpointId, EnergyEvse::Id, DischargingEnabledUntil::Id); - } - return CHIP_NO_ERROR; -} - -/* CircuitCapacity */ -int64_t EnergyEvseDelegate::GetCircuitCapacity() -{ - return mCircuitCapacity; -} - -CHIP_ERROR EnergyEvseDelegate::SetCircuitCapacity(int64_t newValue) -{ - int64_t oldValue = mCircuitCapacity; - - if (newValue >= kMaximumChargeCurrent) - { - return CHIP_IM_GLOBAL_STATUS(ConstraintError); - } - - mCircuitCapacity = newValue; - if (oldValue != mCircuitCapacity) - { - ChipLogDetail(AppServer, "CircuitCapacity updated to %ld", static_cast(mCircuitCapacity)); - MatterReportingAttributeChangeCallback(mEndpointId, EnergyEvse::Id, CircuitCapacity::Id); - } - return CHIP_NO_ERROR; -} - -/* MinimumChargeCurrent */ -int64_t EnergyEvseDelegate::GetMinimumChargeCurrent() -{ - return mMinimumChargeCurrent; -} - -CHIP_ERROR EnergyEvseDelegate::SetMinimumChargeCurrent(int64_t newValue) -{ - int64_t oldValue = mMinimumChargeCurrent; - - if (newValue >= kMaximumChargeCurrent) - { - return CHIP_IM_GLOBAL_STATUS(ConstraintError); - } - - mMinimumChargeCurrent = newValue; - if (oldValue != mMinimumChargeCurrent) - { - ChipLogDetail(AppServer, "MinimumChargeCurrent updated to %ld", static_cast(mMinimumChargeCurrent)); - MatterReportingAttributeChangeCallback(mEndpointId, EnergyEvse::Id, MinimumChargeCurrent::Id); - } - return CHIP_NO_ERROR; -} - -/* MaximumChargeCurrent */ -int64_t EnergyEvseDelegate::GetMaximumChargeCurrent() -{ - return mMaximumChargeCurrent; -} - -CHIP_ERROR EnergyEvseDelegate::SetMaximumChargeCurrent(int64_t newValue) -{ - int64_t oldValue = mMaximumChargeCurrent; - - if (newValue >= kMaximumChargeCurrent) - { - return CHIP_IM_GLOBAL_STATUS(ConstraintError); - } - - mMaximumChargeCurrent = newValue; - if (oldValue != mMaximumChargeCurrent) - { - ChipLogDetail(AppServer, "MaximumChargeCurrent updated to %ld", static_cast(mMaximumChargeCurrent)); - MatterReportingAttributeChangeCallback(mEndpointId, EnergyEvse::Id, MaximumChargeCurrent::Id); - } - return CHIP_NO_ERROR; -} - -/* MaximumDischargeCurrent */ -int64_t EnergyEvseDelegate::GetMaximumDischargeCurrent() -{ - return mMaximumDischargeCurrent; -} - -CHIP_ERROR EnergyEvseDelegate::SetMaximumDischargeCurrent(int64_t newValue) -{ - int64_t oldValue = mMaximumDischargeCurrent; - - if (newValue >= kMaximumChargeCurrent) - { - return CHIP_IM_GLOBAL_STATUS(ConstraintError); - } - - mMaximumDischargeCurrent = newValue; - if (oldValue != mMaximumDischargeCurrent) - { - ChipLogDetail(AppServer, "MaximumDischargeCurrent updated to %ld", static_cast(mMaximumDischargeCurrent)); - MatterReportingAttributeChangeCallback(mEndpointId, EnergyEvse::Id, MaximumDischargeCurrent::Id); - } - return CHIP_NO_ERROR; -} - -/* UserMaximumChargeCurrent */ -int64_t EnergyEvseDelegate::GetUserMaximumChargeCurrent() -{ - return mUserMaximumChargeCurrent; -} - -CHIP_ERROR EnergyEvseDelegate::SetUserMaximumChargeCurrent(int64_t newValue) -{ - if ((newValue < 0) || (newValue > kMaximumChargeCurrent)) - { - return CHIP_IM_GLOBAL_STATUS(ConstraintError); - } - - int64_t oldValue = mUserMaximumChargeCurrent; - mUserMaximumChargeCurrent = newValue; - if (oldValue != newValue) - { - ChipLogDetail(AppServer, "UserMaximumChargeCurrent updated to %ld", static_cast(mUserMaximumChargeCurrent)); - MatterReportingAttributeChangeCallback(mEndpointId, EnergyEvse::Id, UserMaximumChargeCurrent::Id); - } - - return CHIP_NO_ERROR; -} - -/* RandomizationDelayWindow */ -uint32_t EnergyEvseDelegate::GetRandomizationDelayWindow() -{ - return mRandomizationDelayWindow; -} - -CHIP_ERROR EnergyEvseDelegate::SetRandomizationDelayWindow(uint32_t newValue) -{ - uint32_t oldValue = mRandomizationDelayWindow; - if (newValue > kMaxRandomizationDelayWindow) - { - return CHIP_IM_GLOBAL_STATUS(ConstraintError); - } - - mRandomizationDelayWindow = newValue; - if (oldValue != newValue) - { - ChipLogDetail(AppServer, "RandomizationDelayWindow updated to %lu", - static_cast(mRandomizationDelayWindow)); - MatterReportingAttributeChangeCallback(mEndpointId, EnergyEvse::Id, RandomizationDelayWindow::Id); - } - return CHIP_NO_ERROR; -} - -/* PREF attributes */ -uint8_t EnergyEvseDelegate::GetNumberOfWeeklyTargets() -{ - return mNumberOfWeeklyTargets; -} -uint8_t EnergyEvseDelegate::GetNumberOfDailyTargets() -{ - return mNumberOfDailyTargets; -} -DataModel::Nullable EnergyEvseDelegate::GetNextChargeStartTime() -{ - return mNextChargeStartTime; -} -DataModel::Nullable EnergyEvseDelegate::GetNextChargeTargetTime() -{ - return mNextChargeTargetTime; -} -DataModel::Nullable EnergyEvseDelegate::GetNextChargeRequiredEnergy() -{ - return mNextChargeRequiredEnergy; -} -DataModel::Nullable EnergyEvseDelegate::GetNextChargeTargetSoC() -{ - return mNextChargeTargetSoC; -} - -/* ApproximateEVEfficiency */ -DataModel::Nullable EnergyEvseDelegate::GetApproximateEVEfficiency() -{ - return mApproximateEVEfficiency; -} - -CHIP_ERROR EnergyEvseDelegate::SetApproximateEVEfficiency(uint16_t newValue) -{ - DataModel::Nullable oldValue = mApproximateEVEfficiency; - - mApproximateEVEfficiency = MakeNullable(newValue); - if ((oldValue.IsNull()) || (oldValue.Value() != newValue)) - { - ChipLogDetail(AppServer, "ApproximateEVEfficiency updated to %d", mApproximateEVEfficiency.Value()); - MatterReportingAttributeChangeCallback(mEndpointId, EnergyEvse::Id, ApproximateEVEfficiency::Id); - } - - return CHIP_NO_ERROR; -} - -/* SOC attributes */ -DataModel::Nullable EnergyEvseDelegate::GetStateOfCharge() -{ - return mStateOfCharge; -} -DataModel::Nullable EnergyEvseDelegate::GetBatteryCapacity() -{ - return mBatteryCapacity; -} - -/* PNC attributes*/ -DataModel::Nullable EnergyEvseDelegate::GetVehicleID() -{ - return mVehicleID; -} - -/* Session SESS attributes */ -DataModel::Nullable EnergyEvseDelegate::GetSessionID() -{ - return mSessionID; -} -DataModel::Nullable EnergyEvseDelegate::GetSessionDuration() -{ - return mSessionDuration; -} -DataModel::Nullable EnergyEvseDelegate::GetSessionEnergyCharged() -{ - return mSessionEnergyCharged; -} -DataModel::Nullable EnergyEvseDelegate::GetSessionEnergyDischarged() -{ - return mSessionEnergyDischarged; -} diff --git a/examples/all-clusters-app/all-clusters-common/src/EnergyEvseManager.cpp b/examples/all-clusters-app/all-clusters-common/src/EnergyEvseManager.cpp deleted file mode 100644 index 0d84d8856212e0..00000000000000 --- a/examples/all-clusters-app/all-clusters-common/src/EnergyEvseManager.cpp +++ /dev/null @@ -1,33 +0,0 @@ -/* - * - * Copyright (c) 2023 Project CHIP Authors - * All rights reserved. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -#include - -using namespace chip::app; -using namespace chip::app::Clusters; -using namespace chip::app::Clusters::EnergyEvse; - -CHIP_ERROR EnergyEvseManager::Init() -{ - return Instance::Init(); -} - -void EnergyEvseManager::Shutdown() -{ - Instance::Shutdown(); -} diff --git a/examples/all-clusters-app/linux/BUILD.gn b/examples/all-clusters-app/linux/BUILD.gn index b3117fd74cf8a6..9442436f793e1f 100644 --- a/examples/all-clusters-app/linux/BUILD.gn +++ b/examples/all-clusters-app/linux/BUILD.gn @@ -21,10 +21,10 @@ import("${chip_root}/src/platform/device.gni") source_set("chip-all-clusters-common") { sources = [ - "${chip_root}/examples/all-clusters-app/all-clusters-common/src/DeviceEnergyManagementDelegateImpl.cpp", - "${chip_root}/examples/all-clusters-app/all-clusters-common/src/DeviceEnergyManagementManager.cpp", - "${chip_root}/examples/all-clusters-app/all-clusters-common/src/EnergyEvseDelegateImpl.cpp", - "${chip_root}/examples/all-clusters-app/all-clusters-common/src/EnergyEvseManager.cpp", + "${chip_root}/examples/energy-management-app/energy-management-common/src/DeviceEnergyManagementDelegateImpl.cpp", + "${chip_root}/examples/energy-management-app/energy-management-common/src/DeviceEnergyManagementManager.cpp", + "${chip_root}/examples/energy-management-app/energy-management-common/src/EnergyEvseDelegateImpl.cpp", + "${chip_root}/examples/energy-management-app/energy-management-common/src/EnergyEvseManager.cpp", "${chip_root}/examples/all-clusters-app/all-clusters-common/src/air-quality-instance.cpp", "${chip_root}/examples/all-clusters-app/all-clusters-common/src/binding-handler.cpp", "${chip_root}/examples/all-clusters-app/all-clusters-common/src/bridged-actions-stub.cpp", @@ -60,8 +60,10 @@ source_set("chip-all-clusters-common") { "${chip_root}/third_party/jsoncpp", ] - include_dirs = - [ "${chip_root}/examples/all-clusters-app/all-clusters-common/include" ] + include_dirs = [ + "${chip_root}/examples/all-clusters-app/all-clusters-common/include", + "${chip_root}/examples/energy-management-app/energy-management-common/include" + ] cflags = [ "-Wconversion" ] From e4e299ed096b192991380179b31e3220006c4dc1 Mon Sep 17 00:00:00 2001 From: James Harrow Date: Wed, 20 Dec 2023 21:56:57 +0000 Subject: [PATCH 034/114] Aim to fix compile issues on other platforms due to logging of %d --- .../device-energy-management-server.cpp | 21 +++++++++++-------- 1 file changed, 12 insertions(+), 9 deletions(-) diff --git a/src/app/clusters/device-energy-management-server/device-energy-management-server.cpp b/src/app/clusters/device-energy-management-server/device-energy-management-server.cpp index bf05364fa67b71..1d656c2e366fee 100644 --- a/src/app/clusters/device-energy-management-server/device-energy-management-server.cpp +++ b/src/app/clusters/device-energy-management-server/device-energy-management-server.cpp @@ -349,7 +349,8 @@ void Instance::HandleStartTimeAdjustRequest(HandlerContext & ctx, CHIP_ERROR chipError = chip::System::SystemClock().GetClock_RealTimeMS(cTMs); if (chipError != CHIP_NO_ERROR) { - ChipLogError(Zcl, "DEM: Unable to get current time - error=%d (%s)]", chipError.AsInteger(), chipError.AsString()); + ChipLogError(Zcl, "DEM: Unable to get current time - error=%ld (%s)]", + static_cast(chipError.AsInteger()), chipError.AsString()); ctx.mCommandHandler.AddStatus(ctx.mRequestPath, Status::Failure); return; } @@ -377,26 +378,28 @@ void Instance::HandleStartTimeAdjustRequest(HandlerContext & ctx, if (requestedStartTime < earliestStartTime) { - ChipLogError(Zcl, "DEM: %s - Bad requestedStartTime %d, earlier than earliestStartTime %d.", __FUNCTION__, - requestedStartTime, earliestStartTime); + ChipLogError(Zcl, "DEM: %s - Bad requestedStartTime %ld, earlier than earliestStartTime %ld.", __FUNCTION__, + static_cast(requestedStartTime), static_cast(earliestStartTime)); ctx.mCommandHandler.AddStatus(ctx.mRequestPath, Status::ConstraintError); return; } if ((requestedStartTime + duration) > latestEndTime) { - ChipLogError(Zcl, "DEM: %s - Bad requestedStartTime + duration %d, later than latestEndTime %d.", __FUNCTION__, - requestedStartTime + duration, latestEndTime); + ChipLogError(Zcl, "DEM: %s - Bad requestedStartTime + duration %ld, later than latestEndTime %ld.", __FUNCTION__, + static_cast(requestedStartTime + duration), static_cast(latestEndTime)); ctx.mCommandHandler.AddStatus(ctx.mRequestPath, Status::ConstraintError); return; } - ChipLogProgress(Zcl, "DEM: %s - Good requestedStartTime %d.", __FUNCTION__, requestedStartTime); + ChipLogProgress(Zcl, "DEM: %s - Good requestedStartTime %ld.", __FUNCTION__, + static_cast(requestedStartTime)); status = mDelegate.StartTimeAdjustRequest(requestedStartTime); ctx.mCommandHandler.AddStatus(ctx.mRequestPath, status); if (status != Status::Success) { - ChipLogError(Zcl, "DEM: %s - StartTimeAdjustRequest(%d) FAILURE", __FUNCTION__, requestedStartTime); + ChipLogError(Zcl, "DEM: %s - StartTimeAdjustRequest(%ld) FAILURE", __FUNCTION__, + static_cast(requestedStartTime)); return; } @@ -455,7 +458,7 @@ void Instance::HandlePauseRequest(HandlerContext & ctx, const Commands::PauseReq if ((duration < forecast.Value().slots[activeSlotNumber].minPauseDuration) && (duration > forecast.Value().slots[activeSlotNumber].maxPauseDuration)) { - ChipLogError(Zcl, "DEM: %s - out of range pause duration %d", __FUNCTION__, duration); + ChipLogError(Zcl, "DEM: %s - out of range pause duration %ld", __FUNCTION__, static_cast(duration)); ctx.mCommandHandler.AddStatus(ctx.mRequestPath, Status::ConstraintError); return; } @@ -472,7 +475,7 @@ void Instance::HandlePauseRequest(HandlerContext & ctx, const Commands::PauseReq ctx.mCommandHandler.AddStatus(ctx.mRequestPath, Status::Failure); if (status != Status::Success) { - ChipLogError(Zcl, "DEM: %s - mDelegate.PauseRequest(%d) FAILURE", __FUNCTION__, duration); + ChipLogError(Zcl, "DEM: %s - mDelegate.PauseRequest(%ld) FAILURE", __FUNCTION__, static_cast(duration)); return; } From 6c00dcd413d524ebdce475907126e1981c5edbd1 Mon Sep 17 00:00:00 2001 From: "Restyled.io" Date: Wed, 20 Dec 2023 21:58:00 +0000 Subject: [PATCH 035/114] Restyled by gn --- examples/all-clusters-app/linux/BUILD.gn | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/examples/all-clusters-app/linux/BUILD.gn b/examples/all-clusters-app/linux/BUILD.gn index 9442436f793e1f..63eeb1d836c93a 100644 --- a/examples/all-clusters-app/linux/BUILD.gn +++ b/examples/all-clusters-app/linux/BUILD.gn @@ -21,10 +21,6 @@ import("${chip_root}/src/platform/device.gni") source_set("chip-all-clusters-common") { sources = [ - "${chip_root}/examples/energy-management-app/energy-management-common/src/DeviceEnergyManagementDelegateImpl.cpp", - "${chip_root}/examples/energy-management-app/energy-management-common/src/DeviceEnergyManagementManager.cpp", - "${chip_root}/examples/energy-management-app/energy-management-common/src/EnergyEvseDelegateImpl.cpp", - "${chip_root}/examples/energy-management-app/energy-management-common/src/EnergyEvseManager.cpp", "${chip_root}/examples/all-clusters-app/all-clusters-common/src/air-quality-instance.cpp", "${chip_root}/examples/all-clusters-app/all-clusters-common/src/binding-handler.cpp", "${chip_root}/examples/all-clusters-app/all-clusters-common/src/bridged-actions-stub.cpp", @@ -44,6 +40,10 @@ source_set("chip-all-clusters-common") { "${chip_root}/examples/all-clusters-app/all-clusters-common/src/static-supported-modes-manager.cpp", "${chip_root}/examples/all-clusters-app/all-clusters-common/src/static-supported-temperature-levels.cpp", "${chip_root}/examples/all-clusters-app/all-clusters-common/src/tcc-mode.cpp", + "${chip_root}/examples/energy-management-app/energy-management-common/src/DeviceEnergyManagementDelegateImpl.cpp", + "${chip_root}/examples/energy-management-app/energy-management-common/src/DeviceEnergyManagementManager.cpp", + "${chip_root}/examples/energy-management-app/energy-management-common/src/EnergyEvseDelegateImpl.cpp", + "${chip_root}/examples/energy-management-app/energy-management-common/src/EnergyEvseManager.cpp", "AllClustersCommandDelegate.cpp", "AppOptions.cpp", "WindowCoveringManager.cpp", @@ -62,7 +62,7 @@ source_set("chip-all-clusters-common") { include_dirs = [ "${chip_root}/examples/all-clusters-app/all-clusters-common/include", - "${chip_root}/examples/energy-management-app/energy-management-common/include" + "${chip_root}/examples/energy-management-app/energy-management-common/include", ] cflags = [ "-Wconversion" ] From 9232e5ec84b38dc644c157ddb03bb2776a0b0af8 Mon Sep 17 00:00:00 2001 From: James Harrow Date: Wed, 20 Dec 2023 22:27:50 +0000 Subject: [PATCH 036/114] Updated build files to remove duplicate copies from all-clusters-common to energy-management-common --- examples/all-clusters-app/ameba/chip_main.cmake | 9 +++++++-- examples/all-clusters-app/asr/BUILD.gn | 8 ++++++-- examples/all-clusters-app/cc13x2x7_26x2x7/BUILD.gn | 8 ++++++-- examples/all-clusters-app/cc13x4_26x4/BUILD.gn | 8 ++++++-- examples/all-clusters-app/infineon/psoc6/BUILD.gn | 8 ++++++-- examples/all-clusters-app/nxp/mw320/BUILD.gn | 8 ++++++-- examples/all-clusters-app/tizen/BUILD.gn | 13 +++++++++---- examples/energy-management-app/linux/BUILD.gn | 2 ++ examples/shell/shell_common/BUILD.gn | 13 +++++++++---- 9 files changed, 57 insertions(+), 20 deletions(-) diff --git a/examples/all-clusters-app/ameba/chip_main.cmake b/examples/all-clusters-app/ameba/chip_main.cmake index f3c6a54854c475..cc30f3706f9c67 100755 --- a/examples/all-clusters-app/ameba/chip_main.cmake +++ b/examples/all-clusters-app/ameba/chip_main.cmake @@ -156,8 +156,7 @@ list( ${chip_dir}/examples/all-clusters-app/all-clusters-common/src/bridged-actions-stub.cpp ${chip_dir}/examples/all-clusters-app/all-clusters-common/src/air-quality-instance.cpp ${chip_dir}/examples/all-clusters-app/all-clusters-common/src/concentration-measurement-instances.cpp - ${chip_dir}/examples/all-clusters-app/all-clusters-common/src/EnergyEvseDelegateImpl.cpp - ${chip_dir}/examples/all-clusters-app/all-clusters-common/src/EnergyEvseManager.cpp + ${chip_dir}/examples/all-clusters-app/all-clusters-common/src/device-energy-management-stub.cpp ${chip_dir}/examples/all-clusters-app/all-clusters-common/src/energy-evse-stub.cpp ${chip_dir}/examples/all-clusters-app/all-clusters-common/src/fan-stub.cpp ${chip_dir}/examples/all-clusters-app/all-clusters-common/src/laundry-washer-controls-delegate-impl.cpp @@ -176,6 +175,11 @@ list( ${chip_dir}/examples/all-clusters-app/ameba/main/ManualOperationCommand.cpp ${chip_dir}/examples/all-clusters-app/ameba/main/SmokeCOAlarmManager.cpp + ${chip_dir}/examples/energy-management-app/energy-management-common/src/DeviceEnergyManagementDelegateImpl.cpp + ${chip_dir}/examples/energy-management-app/energy-management-common/src/DeviceEnergyManagementManager.cpp + ${chip_dir}/examples/energy-management-app/energy-management-common/src/EnergyEvseDelegateImpl.cpp + ${chip_dir}/examples/energy-management-app/energy-management-common/src/EnergyEvseManager.cpp + ${chip_dir}/examples/platform/ameba/route_hook/ameba_route_hook.c ${chip_dir}/examples/platform/ameba/route_hook/ameba_route_table.c @@ -220,6 +224,7 @@ target_include_directories( ${chip_dir}/zzz_generated/app-common ${chip_dir}/examples/all-clusters-app/all-clusters-common ${chip_dir}/examples/all-clusters-app/all-clusters-common/include + ${chip_dir}/examples/energy-management-app/energy-management-common/include ${chip_dir}/examples/all-clusters-app/ameba/main/include ${chip_dir}/examples/platform/ameba ${chip_dir}/examples/platform/ameba/route_hook diff --git a/examples/all-clusters-app/asr/BUILD.gn b/examples/all-clusters-app/asr/BUILD.gn index 75c4a3171cfd4a..defdc9dccd64bf 100755 --- a/examples/all-clusters-app/asr/BUILD.gn +++ b/examples/all-clusters-app/asr/BUILD.gn @@ -71,17 +71,20 @@ asr_executable("clusters_app") { output_name = "chip-asr-clusters-example.out" sources = [ - "${chip_root}/examples/all-clusters-app/all-clusters-common/src/EnergyEvseDelegateImpl.cpp", - "${chip_root}/examples/all-clusters-app/all-clusters-common/src/EnergyEvseManager.cpp", "${chip_root}/examples/all-clusters-app/all-clusters-common/src/air-quality-instance.cpp", "${chip_root}/examples/all-clusters-app/all-clusters-common/src/bridged-actions-stub.cpp", "${chip_root}/examples/all-clusters-app/all-clusters-common/src/concentration-measurement-instances.cpp", + "${chip_root}/examples/all-clusters-app/all-clusters-common/src/device-energy-management-stub.cpp", "${chip_root}/examples/all-clusters-app/all-clusters-common/src/energy-evse-stub.cpp", "${chip_root}/examples/all-clusters-app/all-clusters-common/src/fan-stub.cpp", "${chip_root}/examples/all-clusters-app/all-clusters-common/src/resource-monitoring-delegates.cpp", "${chip_root}/examples/all-clusters-app/all-clusters-common/src/smco-stub.cpp", "${chip_root}/examples/all-clusters-app/all-clusters-common/src/static-supported-modes-manager.cpp", "${chip_root}/examples/all-clusters-app/all-clusters-common/src/static-supported-temperature-levels.cpp", + "${chip_root}/examples/energy-management-app/energy-management-common/src/DeviceEnergyManagementDelegateImpl.cpp", + "${chip_root}/examples/energy-management-app/energy-management-common/src/DeviceEnergyManagementManager.cpp", + "${chip_root}/examples/energy-management-app/energy-management-common/src/EnergyEvseDelegateImpl.cpp", + "${chip_root}/examples/energy-management-app/energy-management-common/src/EnergyEvseManager.cpp", "${examples_plat_dir}/ButtonHandler.cpp", "${examples_plat_dir}/CHIPDeviceManager.cpp", "${examples_plat_dir}/LEDWidget.cpp", @@ -111,6 +114,7 @@ asr_executable("clusters_app") { "${examples_plat_dir}", "${asr_project_dir}/include", "${chip_root}/examples/all-clusters-app/all-clusters-common/include", + "${chip_root}/examples/energy-management-app/energy-management-common/include", "${chip_root}/src", "${chip_root}/src/lib", "${chip_root}/src/lib/support", diff --git a/examples/all-clusters-app/cc13x2x7_26x2x7/BUILD.gn b/examples/all-clusters-app/cc13x2x7_26x2x7/BUILD.gn index ad07e2c7a0da32..d1f56667f5f453 100644 --- a/examples/all-clusters-app/cc13x2x7_26x2x7/BUILD.gn +++ b/examples/all-clusters-app/cc13x2x7_26x2x7/BUILD.gn @@ -75,18 +75,21 @@ ti_simplelink_executable("all-clusters-app") { output_name = "chip-${ti_simplelink_board}-all-clusters-example.out" sources = [ - "${chip_root}/examples/all-clusters-app/all-clusters-common/src/EnergyEvseDelegateImpl.cpp", - "${chip_root}/examples/all-clusters-app/all-clusters-common/src/EnergyEvseManager.cpp", "${chip_root}/examples/all-clusters-app/all-clusters-common/src/air-quality-instance.cpp", "${chip_root}/examples/all-clusters-app/all-clusters-common/src/binding-handler.cpp", "${chip_root}/examples/all-clusters-app/all-clusters-common/src/bridged-actions-stub.cpp", "${chip_root}/examples/all-clusters-app/all-clusters-common/src/concentration-measurement-instances.cpp", + "${chip_root}/examples/all-clusters-app/all-clusters-common/src/device-energy-management-stub.cpp", "${chip_root}/examples/all-clusters-app/all-clusters-common/src/energy-evse-stub.cpp", "${chip_root}/examples/all-clusters-app/all-clusters-common/src/fan-stub.cpp", "${chip_root}/examples/all-clusters-app/all-clusters-common/src/resource-monitoring-delegates.cpp", "${chip_root}/examples/all-clusters-app/all-clusters-common/src/smco-stub.cpp", "${chip_root}/examples/all-clusters-app/all-clusters-common/src/static-supported-modes-manager.cpp", "${chip_root}/examples/all-clusters-app/all-clusters-common/src/static-supported-temperature-levels.cpp", + "${chip_root}/examples/energy-management-app/energy-management-common/src/DeviceEnergyManagementDelegateImpl.cpp", + "${chip_root}/examples/energy-management-app/energy-management-common/src/DeviceEnergyManagementManager.cpp", + "${chip_root}/examples/energy-management-app/energy-management-common/src/EnergyEvseDelegateImpl.cpp", + "${chip_root}/examples/energy-management-app/energy-management-common/src/EnergyEvseManager.cpp", "${chip_root}/examples/providers/DeviceInfoProviderImpl.cpp", "${project_dir}/main/AppTask.cpp", "${project_dir}/main/ClusterManager.cpp", @@ -112,6 +115,7 @@ ti_simplelink_executable("all-clusters-app") { "${project_dir}", "${project_dir}/main", "${chip_root}/examples/all-clusters-app/all-clusters-common/include", + "${chip_root}/examples/energy-management-app/energy-management-common/include", "${chip_root}/examples/providers/", ] diff --git a/examples/all-clusters-app/cc13x4_26x4/BUILD.gn b/examples/all-clusters-app/cc13x4_26x4/BUILD.gn index c35afae97aabba..9efcf90d520501 100644 --- a/examples/all-clusters-app/cc13x4_26x4/BUILD.gn +++ b/examples/all-clusters-app/cc13x4_26x4/BUILD.gn @@ -78,18 +78,21 @@ ti_simplelink_executable("all-clusters-app") { output_name = "chip-${ti_simplelink_board}-all-clusters-example.out" sources = [ - "${chip_root}/examples/all-clusters-app/all-clusters-common/src/EnergyEvseDelegateImpl.cpp", - "${chip_root}/examples/all-clusters-app/all-clusters-common/src/EnergyEvseManager.cpp", "${chip_root}/examples/all-clusters-app/all-clusters-common/src/air-quality-instance.cpp", "${chip_root}/examples/all-clusters-app/all-clusters-common/src/binding-handler.cpp", "${chip_root}/examples/all-clusters-app/all-clusters-common/src/bridged-actions-stub.cpp", "${chip_root}/examples/all-clusters-app/all-clusters-common/src/concentration-measurement-instances.cpp", + "${chip_root}/examples/all-clusters-app/all-clusters-common/src/device-energy-management-stub.cpp", "${chip_root}/examples/all-clusters-app/all-clusters-common/src/energy-evse-stub.cpp", "${chip_root}/examples/all-clusters-app/all-clusters-common/src/fan-stub.cpp", "${chip_root}/examples/all-clusters-app/all-clusters-common/src/resource-monitoring-delegates.cpp", "${chip_root}/examples/all-clusters-app/all-clusters-common/src/smco-stub.cpp", "${chip_root}/examples/all-clusters-app/all-clusters-common/src/static-supported-modes-manager.cpp", "${chip_root}/examples/all-clusters-app/all-clusters-common/src/static-supported-temperature-levels.cpp", + "${chip_root}/examples/energy-management-app/energy-management-common/src/DeviceEnergyManagementDelegateImpl.cpp", + "${chip_root}/examples/energy-management-app/energy-management-common/src/DeviceEnergyManagementManager.cpp", + "${chip_root}/examples/energy-management-app/energy-management-common/src/EnergyEvseDelegateImpl.cpp", + "${chip_root}/examples/energy-management-app/energy-management-common/src/EnergyEvseManager.cpp", "${chip_root}/examples/providers/DeviceInfoProviderImpl.cpp", "${project_dir}/main/AppTask.cpp", "${project_dir}/main/ClusterManager.cpp", @@ -116,6 +119,7 @@ ti_simplelink_executable("all-clusters-app") { "${project_dir}", "${project_dir}/main", "${chip_root}/examples/all-clusters-app/all-clusters-common/include", + "${chip_root}/examples/energy-management-app/energy-management-common/include", "${chip_root}/examples/providers/", ] diff --git a/examples/all-clusters-app/infineon/psoc6/BUILD.gn b/examples/all-clusters-app/infineon/psoc6/BUILD.gn index b99dc84405e841..69b0786d24bde4 100644 --- a/examples/all-clusters-app/infineon/psoc6/BUILD.gn +++ b/examples/all-clusters-app/infineon/psoc6/BUILD.gn @@ -107,17 +107,20 @@ psoc6_executable("clusters_app") { output_name = "chip-psoc6-clusters-example.out" sources = [ - "${chip_root}/examples/all-clusters-app/all-clusters-common/src/EnergyEvseDelegateImpl.cpp", - "${chip_root}/examples/all-clusters-app/all-clusters-common/src/EnergyEvseManager.cpp", "${chip_root}/examples/all-clusters-app/all-clusters-common/src/air-quality-instance.cpp", "${chip_root}/examples/all-clusters-app/all-clusters-common/src/bridged-actions-stub.cpp", "${chip_root}/examples/all-clusters-app/all-clusters-common/src/concentration-measurement-instances.cpp", + "${chip_root}/examples/all-clusters-app/all-clusters-common/src/device-energy-management-stub.cpp", "${chip_root}/examples/all-clusters-app/all-clusters-common/src/energy-evse-stub.cpp", "${chip_root}/examples/all-clusters-app/all-clusters-common/src/fan-stub.cpp", "${chip_root}/examples/all-clusters-app/all-clusters-common/src/resource-monitoring-delegates.cpp", "${chip_root}/examples/all-clusters-app/all-clusters-common/src/smco-stub.cpp", "${chip_root}/examples/all-clusters-app/all-clusters-common/src/static-supported-modes-manager.cpp", "${chip_root}/examples/all-clusters-app/all-clusters-common/src/static-supported-temperature-levels.cpp", + "${chip_root}/examples/energy-management-app/energy-management-common/src/DeviceEnergyManagementDelegateImpl.cpp", + "${chip_root}/examples/energy-management-app/energy-management-common/src/DeviceEnergyManagementManager.cpp", + "${chip_root}/examples/energy-management-app/energy-management-common/src/EnergyEvseDelegateImpl.cpp", + "${chip_root}/examples/energy-management-app/energy-management-common/src/EnergyEvseManager.cpp", "${examples_plat_dir}/LEDWidget.cpp", "${examples_plat_dir}/init_psoc6Platform.cpp", "src/AppTask.cpp", @@ -141,6 +144,7 @@ psoc6_executable("clusters_app") { "${examples_plat_dir}", "${psoc6_project_dir}/include", "${chip_root}/examples/all-clusters-app/all-clusters-common/include", + "${chip_root}/examples/energy-management-app/energy-management-common/include", ] defines = [] diff --git a/examples/all-clusters-app/nxp/mw320/BUILD.gn b/examples/all-clusters-app/nxp/mw320/BUILD.gn index ab7be5a04d64c1..ece2c443fb3681 100644 --- a/examples/all-clusters-app/nxp/mw320/BUILD.gn +++ b/examples/all-clusters-app/nxp/mw320/BUILD.gn @@ -71,20 +71,24 @@ mw320_executable("shell_mw320") { "${chip_root}/src", "${chip_root}/src/app/util", "${chip_root}/examples/all-clusters-app/all-clusters-common/include", + "${chip_root}/examples/energy-management-app/energy-management-common/include", "${chip_root}/examples/all-clusters-app/nxp/mw320/include", ] sources = [ - "${chip_root}/examples/all-clusters-app/all-clusters-common/src/EnergyEvseDelegateImpl.cpp", - "${chip_root}/examples/all-clusters-app/all-clusters-common/src/EnergyEvseManager.cpp", "${chip_root}/examples/all-clusters-app/all-clusters-common/src/air-quality-instance.cpp", "${chip_root}/examples/all-clusters-app/all-clusters-common/src/bridged-actions-stub.cpp", "${chip_root}/examples/all-clusters-app/all-clusters-common/src/concentration-measurement-instances.cpp", + "${chip_root}/examples/all-clusters-app/all-clusters-common/src/device-energy-management-stub.cpp", "${chip_root}/examples/all-clusters-app/all-clusters-common/src/energy-evse-stub.cpp", "${chip_root}/examples/all-clusters-app/all-clusters-common/src/fan-stub.cpp", "${chip_root}/examples/all-clusters-app/all-clusters-common/src/resource-monitoring-delegates.cpp", "${chip_root}/examples/all-clusters-app/all-clusters-common/src/smco-stub.cpp", "${chip_root}/examples/all-clusters-app/all-clusters-common/src/static-supported-modes-manager.cpp", "${chip_root}/examples/all-clusters-app/all-clusters-common/src/static-supported-temperature-levels.cpp", + "${chip_root}/examples/energy-management-app/energy-management-common/src/DeviceEnergyManagementDelegateImpl.cpp", + "${chip_root}/examples/energy-management-app/energy-management-common/src/DeviceEnergyManagementManager.cpp", + "${chip_root}/examples/energy-management-app/energy-management-common/src/EnergyEvseDelegateImpl.cpp", + "${chip_root}/examples/energy-management-app/energy-management-common/src/EnergyEvseManager.cpp", "${chip_root}/src/lib/shell/streamer_mw320.cpp", "binding-handler.cpp", "include/CHIPProjectConfig.h", diff --git a/examples/all-clusters-app/tizen/BUILD.gn b/examples/all-clusters-app/tizen/BUILD.gn index 6960ec6aa6d516..db0d69d8eb92d4 100644 --- a/examples/all-clusters-app/tizen/BUILD.gn +++ b/examples/all-clusters-app/tizen/BUILD.gn @@ -23,18 +23,21 @@ assert(chip_build_tools) source_set("chip-all-clusters-common") { sources = [ - "${chip_root}/examples/all-clusters-app/all-clusters-common/src/EnergyEvseDelegateImpl.cpp", - "${chip_root}/examples/all-clusters-app/all-clusters-common/src/EnergyEvseManager.cpp", "${chip_root}/examples/all-clusters-app/all-clusters-common/src/air-quality-instance.cpp", "${chip_root}/examples/all-clusters-app/all-clusters-common/src/binding-handler.cpp", "${chip_root}/examples/all-clusters-app/all-clusters-common/src/bridged-actions-stub.cpp", "${chip_root}/examples/all-clusters-app/all-clusters-common/src/concentration-measurement-instances.cpp", + "${chip_root}/examples/all-clusters-app/all-clusters-common/src/device-energy-management-stub.cpp", "${chip_root}/examples/all-clusters-app/all-clusters-common/src/energy-evse-stub.cpp", "${chip_root}/examples/all-clusters-app/all-clusters-common/src/fan-stub.cpp", "${chip_root}/examples/all-clusters-app/all-clusters-common/src/resource-monitoring-delegates.cpp", "${chip_root}/examples/all-clusters-app/all-clusters-common/src/smco-stub.cpp", "${chip_root}/examples/all-clusters-app/all-clusters-common/src/static-supported-modes-manager.cpp", "${chip_root}/examples/all-clusters-app/all-clusters-common/src/static-supported-temperature-levels.cpp", + "${chip_root}/examples/energy-management-app/energy-management-common/src/DeviceEnergyManagementDelegateImpl.cpp", + "${chip_root}/examples/energy-management-app/energy-management-common/src/DeviceEnergyManagementManager.cpp", + "${chip_root}/examples/energy-management-app/energy-management-common/src/EnergyEvseDelegateImpl.cpp", + "${chip_root}/examples/energy-management-app/energy-management-common/src/EnergyEvseManager.cpp", ] deps = [ @@ -43,8 +46,10 @@ source_set("chip-all-clusters-common") { "${chip_root}/src/lib/shell:shell_core", ] - include_dirs = - [ "${chip_root}/examples/all-clusters-app/all-clusters-common/include" ] + include_dirs = [ + "${chip_root}/examples/all-clusters-app/all-clusters-common/include", + "${chip_root}/examples/energy-management-app/energy-management-common/include", + ] } executable("chip-all-clusters-app") { diff --git a/examples/energy-management-app/linux/BUILD.gn b/examples/energy-management-app/linux/BUILD.gn index 8597caabfc35b9..bcc8045edbf00e 100644 --- a/examples/energy-management-app/linux/BUILD.gn +++ b/examples/energy-management-app/linux/BUILD.gn @@ -36,6 +36,8 @@ config("includes") { executable("chip-energy-management-app") { sources = [ + "${chip_root}/examples/energy-management-app/energy-management-common/src/DeviceEnergyManagementDelegateImpl.cpp", + "${chip_root}/examples/energy-management-app/energy-management-common/src/DeviceEnergyManagementManager.cpp", "${chip_root}/examples/energy-management-app/energy-management-common/src/EVSEManufacturerImpl.cpp", "${chip_root}/examples/energy-management-app/energy-management-common/src/EnergyEvseDelegateImpl.cpp", "${chip_root}/examples/energy-management-app/energy-management-common/src/EnergyEvseManager.cpp", diff --git a/examples/shell/shell_common/BUILD.gn b/examples/shell/shell_common/BUILD.gn index b870628717d8e5..35dceff96796c3 100644 --- a/examples/shell/shell_common/BUILD.gn +++ b/examples/shell/shell_common/BUILD.gn @@ -64,17 +64,22 @@ static_library("shell_common") { import("${chip_root}/src/app/chip_data_model.gni") sources += [ - "${chip_root}/examples/all-clusters-app/all-clusters-common/src/EnergyEvseDelegateImpl.cpp", - "${chip_root}/examples/all-clusters-app/all-clusters-common/src/EnergyEvseManager.cpp", "${chip_root}/examples/all-clusters-app/all-clusters-common/src/bridged-actions-stub.cpp", + "${chip_root}/examples/all-clusters-app/all-clusters-common/src/device-energy-management-stub.cpp", "${chip_root}/examples/all-clusters-app/all-clusters-common/src/energy-evse-stub.cpp", "${chip_root}/examples/all-clusters-app/all-clusters-common/src/smco-stub.cpp", "${chip_root}/examples/all-clusters-app/all-clusters-common/src/static-supported-modes-manager.cpp", "${chip_root}/examples/all-clusters-app/all-clusters-common/src/static-supported-temperature-levels.cpp", + "${chip_root}/examples/energy-management-app/energy-management-common/src/DeviceEnergyManagementDelegateImpl.cpp", + "${chip_root}/examples/energy-management-app/energy-management-common/src/DeviceEnergyManagementManager.cpp", + "${chip_root}/examples/energy-management-app/energy-management-common/src/EnergyEvseDelegateImpl.cpp", + "${chip_root}/examples/energy-management-app/energy-management-common/src/EnergyEvseManager.cpp", ] - include_dirs = - [ "${chip_root}/examples/all-clusters-app/all-clusters-common/include" ] + include_dirs = [ + "${chip_root}/examples/all-clusters-app/all-clusters-common/include", + "${chip_root}/examples/energy-management-app/energy-management-common/include", + ] public_deps += [ "${chip_root}/examples/all-clusters-app/all-clusters-common" ] From a5267e384d8b92f668f44d9086c05cdebf50d134 Mon Sep 17 00:00:00 2001 From: James Harrow Date: Wed, 20 Dec 2023 22:54:11 +0000 Subject: [PATCH 037/114] Fixed ESP32 include path --- examples/all-clusters-app/esp32/main/CMakeLists.txt | 1 + 1 file changed, 1 insertion(+) diff --git a/examples/all-clusters-app/esp32/main/CMakeLists.txt b/examples/all-clusters-app/esp32/main/CMakeLists.txt index 5680634c786678..e8851aa5a4d3d5 100644 --- a/examples/all-clusters-app/esp32/main/CMakeLists.txt +++ b/examples/all-clusters-app/esp32/main/CMakeLists.txt @@ -18,6 +18,7 @@ # The list of src and include dirs must be in sync with that in all-clusters-app/esp32/main/component.mk set(PRIV_INCLUDE_DIRS_LIST "${CMAKE_SOURCE_DIR}/third_party/connectedhomeip/examples/all-clusters-app/all-clusters-common/include" + "${CMAKE_SOURCE_DIR}/third_party/connectedhomeip/examples/energy-management-app/energy-management-common/include" "${CMAKE_CURRENT_LIST_DIR}/include" "${CMAKE_SOURCE_DIR}/third_party/connectedhomeip/examples/providers" "${CMAKE_SOURCE_DIR}/third_party/connectedhomeip/examples/platform/esp32" From 363f79c19ef2cdd1eaf9f0257dbd97769243e58b Mon Sep 17 00:00:00 2001 From: James Harrow Date: Wed, 20 Dec 2023 23:43:47 +0000 Subject: [PATCH 038/114] Added DEM into energy-management-app - refactored main.cpp. --- .../src/EVSEManufacturerImpl.cpp | 10 +- examples/energy-management-app/linux/main.cpp | 202 +++++++++++++----- 2 files changed, 156 insertions(+), 56 deletions(-) diff --git a/examples/energy-management-app/energy-management-common/src/EVSEManufacturerImpl.cpp b/examples/energy-management-app/energy-management-common/src/EVSEManufacturerImpl.cpp index 8daf1781103831..f0b412729e2620 100644 --- a/examples/energy-management-app/energy-management-common/src/EVSEManufacturerImpl.cpp +++ b/examples/energy-management-app/energy-management-common/src/EVSEManufacturerImpl.cpp @@ -23,15 +23,15 @@ using namespace chip::app; using namespace chip::app::Clusters; using namespace chip::app::Clusters::EnergyEvse; -CHIP_ERROR EVSEManufacturer::Init(EnergyEvseManager * aInstance) +CHIP_ERROR EVSEManufacturer::Init(EnergyEvseManager * evseInstance, DeviceEnergyManagementManager * demInstance) { /* Manufacturers should modify this to do any custom initialisation */ /* Register callbacks */ - EnergyEvseDelegate * dg = aInstance->GetDelegate(); + EnergyEvseDelegate * dg = evseInstance->GetDelegate(); if (dg == nullptr) { - ChipLogError(AppServer, "Delegate is not initialized"); + ChipLogError(AppServer, "EVSE Delegate is not initialized"); return CHIP_ERROR_UNINITIALIZED; } @@ -62,7 +62,7 @@ CHIP_ERROR EVSEManufacturer::Init(EnergyEvseManager * aInstance) return CHIP_NO_ERROR; } -CHIP_ERROR EVSEManufacturer::Shutdown(EnergyEvseManager * aInstance) +CHIP_ERROR EVSEManufacturer::Shutdown(EnergyEvseManager * evseInstance, DeviceEnergyManagementManager * demInstance) { return CHIP_NO_ERROR; @@ -88,6 +88,6 @@ void EVSEManufacturer::ApplicationCallbackHandler(const EVSECbInfo * cb, intptr_ static_cast(cb->ChargingCurrent.maximumChargeCurrent)); break; default: - ChipLogError(AppServer, "Unhandler EVSE Callback type %d", static_cast(cb->type)); + ChipLogError(AppServer, "Unhandled EVSE Callback type %d", static_cast(cb->type)); } } diff --git a/examples/energy-management-app/linux/main.cpp b/examples/energy-management-app/linux/main.cpp index dddc6f53d76b20..f494ebb20dd1de 100644 --- a/examples/energy-management-app/linux/main.cpp +++ b/examples/energy-management-app/linux/main.cpp @@ -17,6 +17,7 @@ */ #include +#include #include #include #include @@ -35,55 +36,133 @@ using namespace chip; using namespace chip::app; using namespace chip::app::Clusters; -static EnergyEvseDelegate * gDelegate = nullptr; -static EnergyEvseManager * gInstance = nullptr; -static EVSEManufacturer * gEvseManufacturer = nullptr; +static EnergyEvseDelegate * gEvseDelegate = nullptr; +static EnergyEvseManager * gEvseInstance = nullptr; +static DeviceEnergyManagementDelegate * gDEMDelegate = nullptr; +static DeviceEnergyManagementManager * gDEMInstance = nullptr; +static EVSEManufacturer * gEvseManufacturer = nullptr; -void ApplicationInit() +CHIP_ERROR DeviceEnergyManagementInit() { - CHIP_ERROR err; + if ((gDEMDelegate != nullptr) || (gDEMInstance != nullptr)) + { + ChipLogError(AppServer, "DEM Instance or Delegate already exist."); + return CHIP_ERROR_INCORRECT_STATE; + } - if ((gDelegate != nullptr) || (gInstance != nullptr) || (gEvseManufacturer != nullptr)) + gDEMDelegate = new DeviceEnergyManagementDelegate(); + if (gDEMDelegate == nullptr) { - ChipLogError(AppServer, "EVSE Instance or Delegate, EvseManufacturer already exist."); - return; + ChipLogError(AppServer, "Failed to allocate memory for DeviceEnergyManagementDelegate"); + return CHIP_ERROR_NO_MEMORY; + } + + /* Manufacturer may optionally not support all features, commands & attributes */ + gDEMInstance = new DeviceEnergyManagementManager( + EndpointId(ENERGY_EVSE_ENDPOINT), *gDEMDelegate, + BitMask( + DeviceEnergyManagement::Feature::kPowerForecastReporting, DeviceEnergyManagement::Feature::kStateForecastReporting, + DeviceEnergyManagement::Feature::kPowerAdjustment, DeviceEnergyManagement::Feature::kForecastAdjustment), + BitMask( + DeviceEnergyManagement::OptionalCommands::kSupportsModifyForecastRequest, + DeviceEnergyManagement::OptionalCommands::kSupportsRequestConstraintBasedForecast)); + + if (gDEMInstance == nullptr) + { + ChipLogError(AppServer, "Failed to allocate memory for DeviceEnergyManagementManager"); + delete gDEMDelegate; + gDEMDelegate = nullptr; + return CHIP_ERROR_NO_MEMORY; + } + + CHIP_ERROR err = gDEMInstance->Init(); /* Register Attribute & Command handlers */ + if (err != CHIP_NO_ERROR) + { + ChipLogError(AppServer, "Init failed on gDEMInstance"); + delete gDEMInstance; + delete gDEMDelegate; + gDEMInstance = nullptr; + gDEMDelegate = nullptr; + return err; + } + + return CHIP_NO_ERROR; +} + +CHIP_ERROR DeviceEnergyManagementShutdown() +{ + delete gDEMInstance; + delete gDEMDelegate; + gDEMInstance = nullptr; + gDEMDelegate = nullptr; + + return CHIP_NO_ERROR; +} + +CHIP_ERROR EnergyEvseInit() +{ + if ((gEvseDelegate != nullptr) || (gEvseInstance != nullptr)) + { + ChipLogError(AppServer, "EVSE Instance or Delegate already exist."); + return CHIP_ERROR_INCORRECT_STATE; } - gDelegate = new EnergyEvseDelegate(); - if (gDelegate == nullptr) + gEvseDelegate = new EnergyEvseDelegate(); + if (gEvseDelegate == nullptr) { ChipLogError(AppServer, "Failed to allocate memory for EnergyEvseDelegate"); - return; + return CHIP_ERROR_NO_MEMORY; } /* Manufacturer may optionally not support all features, commands & attributes */ - gInstance = - new EnergyEvseManager(EndpointId(ENERGY_EVSE_ENDPOINT), *gDelegate, - BitMask( - EnergyEvse::Feature::kChargingPreferences, EnergyEvse::Feature::kPlugAndCharge, - EnergyEvse::Feature::kRfid, EnergyEvse::Feature::kSoCReporting, EnergyEvse::Feature::kV2x), - BitMask(OptionalAttributes::kSupportsUserMaximumChargingCurrent, - OptionalAttributes::kSupportsRandomizationWindow, - OptionalAttributes::kSupportsApproximateEvEfficiency), - BitMask(OptionalCommands::kSupportsStartDiagnostics)); - - if (gInstance == nullptr) + gEvseInstance = new EnergyEvseManager( + EndpointId(ENERGY_EVSE_ENDPOINT), *gEvseDelegate, + BitMask(EnergyEvse::Feature::kChargingPreferences, EnergyEvse::Feature::kPlugAndCharge, + EnergyEvse::Feature::kRfid, EnergyEvse::Feature::kSoCReporting, + EnergyEvse::Feature::kV2x), + BitMask(EnergyEvse::OptionalAttributes::kSupportsUserMaximumChargingCurrent, + EnergyEvse::OptionalAttributes::kSupportsRandomizationWindow, + EnergyEvse::OptionalAttributes::kSupportsApproximateEvEfficiency), + BitMask(EnergyEvse::OptionalCommands::kSupportsStartDiagnostics)); + + if (gEvseInstance == nullptr) { ChipLogError(AppServer, "Failed to allocate memory for EnergyEvseManager"); - delete gDelegate; - gDelegate = nullptr; - return; + delete gEvseDelegate; + gEvseDelegate = nullptr; + return CHIP_ERROR_NO_MEMORY; } - err = gInstance->Init(); /* Register Attribute & Command handlers */ + CHIP_ERROR err = gEvseInstance->Init(); /* Register Attribute & Command handlers */ if (err != CHIP_NO_ERROR) { - ChipLogError(AppServer, "Init failed on gInstance"); - delete gInstance; - delete gDelegate; - gInstance = nullptr; - gDelegate = nullptr; - return; + ChipLogError(AppServer, "Init failed on gEvseInstance"); + delete gEvseInstance; + delete gEvseDelegate; + gEvseInstance = nullptr; + gEvseDelegate = nullptr; + return err; + } + + return CHIP_NO_ERROR; +} + +CHIP_ERROR EnergyEvseShutdown() +{ + delete gEvseInstance; + delete gEvseDelegate; + gEvseInstance = nullptr; + gEvseDelegate = nullptr; + + return CHIP_NO_ERROR; +} + +CHIP_ERROR EVSEManufacturerInit() +{ + if (gEvseManufacturer != nullptr) + { + ChipLogError(AppServer, "EvseManufacturer already exist."); + return CHIP_ERROR_INCORRECT_STATE; } /* Now create EVSEManufacturer*/ @@ -91,24 +170,47 @@ void ApplicationInit() if (gEvseManufacturer == nullptr) { ChipLogError(AppServer, "Failed to allocate memory for EvseManufacturer"); - delete gInstance; - delete gDelegate; - gInstance = nullptr; - gDelegate = nullptr; - return; + return CHIP_ERROR_NO_MEMORY; } /* Call Manufacturer specific init */ - err = gEvseManufacturer->Init(gInstance); + CHIP_ERROR err = gEvseManufacturer->Init(gEvseInstance, gDEMInstance); if (err != CHIP_NO_ERROR) { ChipLogError(AppServer, "Init failed on gEvseManufacturer"); delete gEvseManufacturer; - delete gInstance; - delete gDelegate; gEvseManufacturer = nullptr; - gInstance = nullptr; - gDelegate = nullptr; + return err; + } + + return CHIP_NO_ERROR; +} + +CHIP_ERROR EVSEManufacturerShutdown() +{ + delete gEvseManufacturer; + gEvseManufacturer = nullptr; + + return CHIP_NO_ERROR; +} + +void ApplicationInit() +{ + if (DeviceEnergyManagementInit() != CHIP_NO_ERROR) + { + return; + } + + if (EnergyEvseInit() != CHIP_NO_ERROR) + { + DeviceEnergyManagementShutdown(); + return; + } + + if (EVSEManufacturerInit() != CHIP_NO_ERROR) + { + DeviceEnergyManagementShutdown(); + EnergyEvseShutdown(); return; } } @@ -118,17 +220,15 @@ void ApplicationShutdown() ChipLogDetail(AppServer, "Energy Management App: ApplicationShutdown()"); /* Shutdown the EVSEManufacturer*/ - gEvseManufacturer->Shutdown(gInstance); + gEvseManufacturer->Shutdown(gEvseInstance, gDEMInstance); - /* Shutdown the Instance - deregister attribute & command handler */ - gInstance->Shutdown(); + /* Shutdown the Instances - deregister attribute & command handlers */ + gEvseInstance->Shutdown(); + gDEMInstance->Shutdown(); - delete gEvseManufacturer; - delete gInstance; - delete gDelegate; - gEvseManufacturer = nullptr; - gInstance = nullptr; - gDelegate = nullptr; + EVSEManufacturerShutdown(); /* Free the EVSEManufacturer */ + EnergyEvseShutdown(); /* Free the EnergyEvse */ + DeviceEnergyManagementShutdown(); /* Free the DEM */ } int main(int argc, char * argv[]) From 0db5eb03a2b73d749c25e31c6a854e59d6671c50 Mon Sep 17 00:00:00 2001 From: James Harrow Date: Wed, 20 Dec 2023 23:44:45 +0000 Subject: [PATCH 039/114] Added DEM into EVSEManufacturerImpl.h --- .../energy-management-common/include/EVSEManufacturerImpl.h | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/examples/energy-management-app/energy-management-common/include/EVSEManufacturerImpl.h b/examples/energy-management-app/energy-management-common/include/EVSEManufacturerImpl.h index 4ff45e925674aa..f47e17508513a9 100644 --- a/examples/energy-management-app/energy-management-common/include/EVSEManufacturerImpl.h +++ b/examples/energy-management-app/energy-management-common/include/EVSEManufacturerImpl.h @@ -18,6 +18,7 @@ #pragma once +#include #include using chip::Protocols::InteractionModel::Status; @@ -36,12 +37,12 @@ class EVSEManufacturer /** * @brief Called at start up to apply hardware settings */ - CHIP_ERROR Init(EnergyEvseManager * aInstance); + CHIP_ERROR Init(EnergyEvseManager * evseInstance, DeviceEnergyManagementManager * demInstance); /** * @brief Called at shutdown */ - CHIP_ERROR Shutdown(EnergyEvseManager * aInstance); + CHIP_ERROR Shutdown(EnergyEvseManager * evseInstance, DeviceEnergyManagementManager * demInstance); /** * @brief Main Callback handler from delegate to user code From 23e174aa988446046bbacea0185ffb3f62a81c6f Mon Sep 17 00:00:00 2001 From: James Harrow Date: Wed, 20 Dec 2023 23:45:35 +0000 Subject: [PATCH 040/114] Fix - avoid using global namespace in header file --- .../energy-management-common/include/EnergyEvseManager.h | 3 ++- .../device-energy-management-server.h | 3 ++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/examples/energy-management-app/energy-management-common/include/EnergyEvseManager.h b/examples/energy-management-app/energy-management-common/include/EnergyEvseManager.h index 9875c397990ef2..d2463d2fa20f97 100644 --- a/examples/energy-management-app/energy-management-common/include/EnergyEvseManager.h +++ b/examples/energy-management-app/energy-management-common/include/EnergyEvseManager.h @@ -26,8 +26,8 @@ namespace chip { namespace app { namespace Clusters { +namespace EnergyEvse { -using namespace chip::app::Clusters::EnergyEvse; class EnergyEvseManager : public Instance { public: @@ -52,6 +52,7 @@ class EnergyEvseManager : public Instance EnergyEvseDelegate * mDelegate; }; +} // namespace EnergyEvse } // namespace Clusters } // namespace app } // namespace chip diff --git a/src/app/clusters/device-energy-management-server/device-energy-management-server.h b/src/app/clusters/device-energy-management-server/device-energy-management-server.h index b0725ca6685180..457a3782fed4c5 100644 --- a/src/app/clusters/device-energy-management-server/device-energy-management-server.h +++ b/src/app/clusters/device-energy-management-server/device-energy-management-server.h @@ -28,12 +28,13 @@ #include #include -using namespace chip::app::Clusters::DeviceEnergyManagement::Attributes; namespace chip { namespace app { namespace Clusters { namespace DeviceEnergyManagement { +using namespace chip::app::Clusters::DeviceEnergyManagement::Attributes; + using chip::Protocols::InteractionModel::Status; /** From 77a33bed83773a750ce37a7e036b6b8a96ca5046 Mon Sep 17 00:00:00 2001 From: "Restyled.io" Date: Wed, 20 Dec 2023 23:46:33 +0000 Subject: [PATCH 041/114] Restyled by gn --- examples/all-clusters-app/asr/BUILD.gn | 2 +- examples/all-clusters-app/cc13x2x7_26x2x7/BUILD.gn | 2 +- examples/all-clusters-app/cc13x4_26x4/BUILD.gn | 4 ++-- examples/all-clusters-app/infineon/psoc6/BUILD.gn | 2 +- examples/all-clusters-app/nxp/mw320/BUILD.gn | 2 +- examples/all-clusters-app/tizen/BUILD.gn | 2 +- examples/energy-management-app/linux/BUILD.gn | 2 +- examples/shell/shell_common/BUILD.gn | 10 +++++----- 8 files changed, 13 insertions(+), 13 deletions(-) diff --git a/examples/all-clusters-app/asr/BUILD.gn b/examples/all-clusters-app/asr/BUILD.gn index defdc9dccd64bf..df2ac9a6b90147 100755 --- a/examples/all-clusters-app/asr/BUILD.gn +++ b/examples/all-clusters-app/asr/BUILD.gn @@ -74,7 +74,7 @@ asr_executable("clusters_app") { "${chip_root}/examples/all-clusters-app/all-clusters-common/src/air-quality-instance.cpp", "${chip_root}/examples/all-clusters-app/all-clusters-common/src/bridged-actions-stub.cpp", "${chip_root}/examples/all-clusters-app/all-clusters-common/src/concentration-measurement-instances.cpp", - "${chip_root}/examples/all-clusters-app/all-clusters-common/src/device-energy-management-stub.cpp", + "${chip_root}/examples/all-clusters-app/all-clusters-common/src/device-energy-management-stub.cpp", "${chip_root}/examples/all-clusters-app/all-clusters-common/src/energy-evse-stub.cpp", "${chip_root}/examples/all-clusters-app/all-clusters-common/src/fan-stub.cpp", "${chip_root}/examples/all-clusters-app/all-clusters-common/src/resource-monitoring-delegates.cpp", diff --git a/examples/all-clusters-app/cc13x2x7_26x2x7/BUILD.gn b/examples/all-clusters-app/cc13x2x7_26x2x7/BUILD.gn index d1f56667f5f453..502c8d097d59b9 100644 --- a/examples/all-clusters-app/cc13x2x7_26x2x7/BUILD.gn +++ b/examples/all-clusters-app/cc13x2x7_26x2x7/BUILD.gn @@ -79,7 +79,7 @@ ti_simplelink_executable("all-clusters-app") { "${chip_root}/examples/all-clusters-app/all-clusters-common/src/binding-handler.cpp", "${chip_root}/examples/all-clusters-app/all-clusters-common/src/bridged-actions-stub.cpp", "${chip_root}/examples/all-clusters-app/all-clusters-common/src/concentration-measurement-instances.cpp", - "${chip_root}/examples/all-clusters-app/all-clusters-common/src/device-energy-management-stub.cpp", + "${chip_root}/examples/all-clusters-app/all-clusters-common/src/device-energy-management-stub.cpp", "${chip_root}/examples/all-clusters-app/all-clusters-common/src/energy-evse-stub.cpp", "${chip_root}/examples/all-clusters-app/all-clusters-common/src/fan-stub.cpp", "${chip_root}/examples/all-clusters-app/all-clusters-common/src/resource-monitoring-delegates.cpp", diff --git a/examples/all-clusters-app/cc13x4_26x4/BUILD.gn b/examples/all-clusters-app/cc13x4_26x4/BUILD.gn index 9efcf90d520501..180b88572a9174 100644 --- a/examples/all-clusters-app/cc13x4_26x4/BUILD.gn +++ b/examples/all-clusters-app/cc13x4_26x4/BUILD.gn @@ -82,7 +82,7 @@ ti_simplelink_executable("all-clusters-app") { "${chip_root}/examples/all-clusters-app/all-clusters-common/src/binding-handler.cpp", "${chip_root}/examples/all-clusters-app/all-clusters-common/src/bridged-actions-stub.cpp", "${chip_root}/examples/all-clusters-app/all-clusters-common/src/concentration-measurement-instances.cpp", - "${chip_root}/examples/all-clusters-app/all-clusters-common/src/device-energy-management-stub.cpp", + "${chip_root}/examples/all-clusters-app/all-clusters-common/src/device-energy-management-stub.cpp", "${chip_root}/examples/all-clusters-app/all-clusters-common/src/energy-evse-stub.cpp", "${chip_root}/examples/all-clusters-app/all-clusters-common/src/fan-stub.cpp", "${chip_root}/examples/all-clusters-app/all-clusters-common/src/resource-monitoring-delegates.cpp", @@ -119,7 +119,7 @@ ti_simplelink_executable("all-clusters-app") { "${project_dir}", "${project_dir}/main", "${chip_root}/examples/all-clusters-app/all-clusters-common/include", - "${chip_root}/examples/energy-management-app/energy-management-common/include", + "${chip_root}/examples/energy-management-app/energy-management-common/include", "${chip_root}/examples/providers/", ] diff --git a/examples/all-clusters-app/infineon/psoc6/BUILD.gn b/examples/all-clusters-app/infineon/psoc6/BUILD.gn index 69b0786d24bde4..166db52c3a7da5 100644 --- a/examples/all-clusters-app/infineon/psoc6/BUILD.gn +++ b/examples/all-clusters-app/infineon/psoc6/BUILD.gn @@ -144,7 +144,7 @@ psoc6_executable("clusters_app") { "${examples_plat_dir}", "${psoc6_project_dir}/include", "${chip_root}/examples/all-clusters-app/all-clusters-common/include", - "${chip_root}/examples/energy-management-app/energy-management-common/include", + "${chip_root}/examples/energy-management-app/energy-management-common/include", ] defines = [] diff --git a/examples/all-clusters-app/nxp/mw320/BUILD.gn b/examples/all-clusters-app/nxp/mw320/BUILD.gn index ece2c443fb3681..b1901b6ea77ce6 100644 --- a/examples/all-clusters-app/nxp/mw320/BUILD.gn +++ b/examples/all-clusters-app/nxp/mw320/BUILD.gn @@ -78,7 +78,7 @@ mw320_executable("shell_mw320") { "${chip_root}/examples/all-clusters-app/all-clusters-common/src/air-quality-instance.cpp", "${chip_root}/examples/all-clusters-app/all-clusters-common/src/bridged-actions-stub.cpp", "${chip_root}/examples/all-clusters-app/all-clusters-common/src/concentration-measurement-instances.cpp", - "${chip_root}/examples/all-clusters-app/all-clusters-common/src/device-energy-management-stub.cpp", + "${chip_root}/examples/all-clusters-app/all-clusters-common/src/device-energy-management-stub.cpp", "${chip_root}/examples/all-clusters-app/all-clusters-common/src/energy-evse-stub.cpp", "${chip_root}/examples/all-clusters-app/all-clusters-common/src/fan-stub.cpp", "${chip_root}/examples/all-clusters-app/all-clusters-common/src/resource-monitoring-delegates.cpp", diff --git a/examples/all-clusters-app/tizen/BUILD.gn b/examples/all-clusters-app/tizen/BUILD.gn index db0d69d8eb92d4..09994a8fed1cfe 100644 --- a/examples/all-clusters-app/tizen/BUILD.gn +++ b/examples/all-clusters-app/tizen/BUILD.gn @@ -27,7 +27,7 @@ source_set("chip-all-clusters-common") { "${chip_root}/examples/all-clusters-app/all-clusters-common/src/binding-handler.cpp", "${chip_root}/examples/all-clusters-app/all-clusters-common/src/bridged-actions-stub.cpp", "${chip_root}/examples/all-clusters-app/all-clusters-common/src/concentration-measurement-instances.cpp", - "${chip_root}/examples/all-clusters-app/all-clusters-common/src/device-energy-management-stub.cpp", + "${chip_root}/examples/all-clusters-app/all-clusters-common/src/device-energy-management-stub.cpp", "${chip_root}/examples/all-clusters-app/all-clusters-common/src/energy-evse-stub.cpp", "${chip_root}/examples/all-clusters-app/all-clusters-common/src/fan-stub.cpp", "${chip_root}/examples/all-clusters-app/all-clusters-common/src/resource-monitoring-delegates.cpp", diff --git a/examples/energy-management-app/linux/BUILD.gn b/examples/energy-management-app/linux/BUILD.gn index bcc8045edbf00e..8fb53878129c60 100644 --- a/examples/energy-management-app/linux/BUILD.gn +++ b/examples/energy-management-app/linux/BUILD.gn @@ -37,7 +37,7 @@ config("includes") { executable("chip-energy-management-app") { sources = [ "${chip_root}/examples/energy-management-app/energy-management-common/src/DeviceEnergyManagementDelegateImpl.cpp", - "${chip_root}/examples/energy-management-app/energy-management-common/src/DeviceEnergyManagementManager.cpp", + "${chip_root}/examples/energy-management-app/energy-management-common/src/DeviceEnergyManagementManager.cpp", "${chip_root}/examples/energy-management-app/energy-management-common/src/EVSEManufacturerImpl.cpp", "${chip_root}/examples/energy-management-app/energy-management-common/src/EnergyEvseDelegateImpl.cpp", "${chip_root}/examples/energy-management-app/energy-management-common/src/EnergyEvseManager.cpp", diff --git a/examples/shell/shell_common/BUILD.gn b/examples/shell/shell_common/BUILD.gn index 35dceff96796c3..28b26af3ae211f 100644 --- a/examples/shell/shell_common/BUILD.gn +++ b/examples/shell/shell_common/BUILD.gn @@ -65,7 +65,7 @@ static_library("shell_common") { sources += [ "${chip_root}/examples/all-clusters-app/all-clusters-common/src/bridged-actions-stub.cpp", - "${chip_root}/examples/all-clusters-app/all-clusters-common/src/device-energy-management-stub.cpp", + "${chip_root}/examples/all-clusters-app/all-clusters-common/src/device-energy-management-stub.cpp", "${chip_root}/examples/all-clusters-app/all-clusters-common/src/energy-evse-stub.cpp", "${chip_root}/examples/all-clusters-app/all-clusters-common/src/smco-stub.cpp", "${chip_root}/examples/all-clusters-app/all-clusters-common/src/static-supported-modes-manager.cpp", @@ -76,10 +76,10 @@ static_library("shell_common") { "${chip_root}/examples/energy-management-app/energy-management-common/src/EnergyEvseManager.cpp", ] - include_dirs = [ - "${chip_root}/examples/all-clusters-app/all-clusters-common/include", - "${chip_root}/examples/energy-management-app/energy-management-common/include", - ] + include_dirs = [ + "${chip_root}/examples/all-clusters-app/all-clusters-common/include", + "${chip_root}/examples/energy-management-app/energy-management-common/include", + ] public_deps += [ "${chip_root}/examples/all-clusters-app/all-clusters-common" ] From 8744697b702a9cc0e26c961cca54719bcdaaea4a Mon Sep 17 00:00:00 2001 From: James Harrow Date: Thu, 21 Dec 2023 00:08:44 +0000 Subject: [PATCH 042/114] Updated CMakeLists.txt to remove duplicate energy-management files. --- examples/all-clusters-app/mbed/CMakeLists.txt | 10 ++++++++-- examples/all-clusters-app/nrfconnect/CMakeLists.txt | 9 +++++++-- examples/all-clusters-app/openiotsdk/CMakeLists.txt | 9 +++++++-- examples/all-clusters-app/telink/CMakeLists.txt | 9 +++++++-- 4 files changed, 29 insertions(+), 8 deletions(-) diff --git a/examples/all-clusters-app/mbed/CMakeLists.txt b/examples/all-clusters-app/mbed/CMakeLists.txt index 79a48c85938f78..c05444608c02fc 100644 --- a/examples/all-clusters-app/mbed/CMakeLists.txt +++ b/examples/all-clusters-app/mbed/CMakeLists.txt @@ -7,6 +7,7 @@ get_filename_component(CHIP_ROOT ${CMAKE_CURRENT_SOURCE_DIR}/../../.. REALPATH) get_filename_component(MBED_COMMON ${CHIP_ROOT}/examples/platform/mbed REALPATH) get_filename_component(GEN_DIR ${CHIP_ROOT}/zzz_generated/ REALPATH) get_filename_component(ALL_CLUSTERS_COMMON ${CHIP_ROOT}/examples/all-clusters-app/all-clusters-common REALPATH) +get_filename_component(ENERGY_MANAGEMENT_COMMON ${CHIP_ROOT}/examples/energy-management-app/energy-management-common/ REALPATH) get_filename_component(NLIO_ROOT ${CHIP_ROOT}/third_party/nlio/repo/include REALPATH) configure_file( @@ -49,6 +50,7 @@ target_include_directories(${APP_TARGET} PRIVATE main/include/ ${MBED_COMMON}/util/include ${ALL_CLUSTERS_COMMON}/include + ${ENERGY_MANAGEMENT_COMMON}/include ${GEN_DIR}/app-common ${GEN_DIR}/all-clusters-app ${NLIO_ROOT} @@ -63,13 +65,17 @@ target_sources(${APP_TARGET} PRIVATE ${ALL_CLUSTERS_COMMON}/src/air-quality-instance.cpp ${ALL_CLUSTERS_COMMON}/src/concentration-measurement-instances.cpp ${ALL_CLUSTERS_COMMON}/src/fan-stub.cpp - ${ALL_CLUSTERS_COMMON}/src/EnergyEvseDelegateImpl.cpp - ${ALL_CLUSTERS_COMMON}/src/EnergyEvseManager.cpp + ${ALL_CLUSTERS_COMMON}/src/device-energy-management-stub.cpp ${ALL_CLUSTERS_COMMON}/src/energy-evse-stub.cpp ${ALL_CLUSTERS_COMMON}/src/resource-monitoring-delegates.cpp ${ALL_CLUSTERS_COMMON}/src/smco-stub.cpp ${ALL_CLUSTERS_COMMON}/src/static-supported-modes-manager.cpp ${ALL_CLUSTERS_COMMON}/src/static-supported-temperature-levels.cpp + ${ENERGY_MANAGEMENT_COMMON}/src/EnergyEvseDelegateImpl.cpp + ${ENERGY_MANAGEMENT_COMMON}/src/EnergyEvseManager.cpp + ${ENERGY_MANAGEMENT_COMMON}/src/DeviceEnergyManagementDelegateImpl.cpp + ${ENERGY_MANAGEMENT_COMMON}/src/DeviceEnergyManagementManager.cpp + ) chip_configure_data_model(${APP_TARGET} diff --git a/examples/all-clusters-app/nrfconnect/CMakeLists.txt b/examples/all-clusters-app/nrfconnect/CMakeLists.txt index 72b93e0647724c..1aa797cce5d169 100644 --- a/examples/all-clusters-app/nrfconnect/CMakeLists.txt +++ b/examples/all-clusters-app/nrfconnect/CMakeLists.txt @@ -19,6 +19,7 @@ get_filename_component(CHIP_ROOT ${CMAKE_CURRENT_SOURCE_DIR}/third_party/connect get_filename_component(NRFCONNECT_COMMON ${CHIP_ROOT}/examples/platform/nrfconnect REALPATH) get_filename_component(GEN_DIR ${CHIP_ROOT}/zzz_generated/ REALPATH) get_filename_component(ALL_CLUSTERS_COMMON_DIR ${CHIP_ROOT}/examples/all-clusters-app/all-clusters-common REALPATH) +get_filename_component(ENERGY_MANAGEMENT_COMMON_DIR ${CHIP_ROOT}/examples/energy-management-app/energy-management-common/ REALPATH) include(${CHIP_ROOT}/config/nrfconnect/app/check-nrfconnect-version.cmake) @@ -49,6 +50,7 @@ include(${CHIP_ROOT}/src/app/chip_data_model.cmake) target_include_directories(app PRIVATE main/include ${ALL_CLUSTERS_COMMON_DIR}/include + ${ENERGY_MANAGEMENT_COMMON_DIR}/include ${GEN_DIR}/app-common ${GEN_DIR}/all-clusters-app ${NRFCONNECT_COMMON}/util/include) @@ -61,13 +63,16 @@ target_sources(app PRIVATE ${ALL_CLUSTERS_COMMON_DIR}/src/static-supported-temperature-levels.cpp ${ALL_CLUSTERS_COMMON_DIR}/src/bridged-actions-stub.cpp ${ALL_CLUSTERS_COMMON_DIR}/src/fan-stub.cpp - ${ALL_CLUSTERS_COMMON_DIR}/src/EnergyEvseDelegateImpl.cpp - ${ALL_CLUSTERS_COMMON_DIR}/src/EnergyEvseManager.cpp ${ALL_CLUSTERS_COMMON_DIR}/src/energy-evse-stub.cpp + ${ALL_CLUSTERS_COMMON_DIR}/src/device-energy-management-stub.cpp ${ALL_CLUSTERS_COMMON_DIR}/src/binding-handler.cpp ${ALL_CLUSTERS_COMMON_DIR}/src/air-quality-instance.cpp ${ALL_CLUSTERS_COMMON_DIR}/src/concentration-measurement-instances.cpp ${ALL_CLUSTERS_COMMON_DIR}/src/resource-monitoring-delegates.cpp + ${ENERGY_MANAGEMENT_COMMON_DIR}/src/EnergyEvseDelegateImpl.cpp + ${ENERGY_MANAGEMENT_COMMON_DIR}/src/EnergyEvseManager.cpp + ${ENERGY_MANAGEMENT_COMMON_DIR}/src/DeviceEnergyManagementDelegateImpl.cpp + ${ENERGY_MANAGEMENT_COMMON_DIR}/src/DeviceEnergyManagementManager.cpp ${NRFCONNECT_COMMON}/util/LEDWidget.cpp) chip_configure_data_model(app diff --git a/examples/all-clusters-app/openiotsdk/CMakeLists.txt b/examples/all-clusters-app/openiotsdk/CMakeLists.txt index dce8295b300cb4..ad451ac2235657 100644 --- a/examples/all-clusters-app/openiotsdk/CMakeLists.txt +++ b/examples/all-clusters-app/openiotsdk/CMakeLists.txt @@ -20,6 +20,7 @@ get_filename_component(CHIP_ROOT ${CMAKE_CURRENT_SOURCE_DIR}/../../.. REALPATH) get_filename_component(OPEN_IOT_SDK_CONFIG ${CHIP_ROOT}/config/openiotsdk REALPATH) get_filename_component(OPEN_IOT_SDK_EXAMPLE_COMMON ${CHIP_ROOT}/examples/platform/openiotsdk REALPATH) get_filename_component(ALL_CLUSTERS_COMMON ${CHIP_ROOT}/examples/all-clusters-app/all-clusters-common REALPATH) +get_filename_component(ENERGY_MANAGEMENT_COMMON ${CHIP_ROOT}/examples/energy-management-app/energy-management-common/ REALPATH) list(APPEND CMAKE_MODULE_PATH ${OPEN_IOT_SDK_CONFIG}/cmake) @@ -47,6 +48,7 @@ target_include_directories(${APP_TARGET} PRIVATE main/include ${ALL_CLUSTERS_COMMON}/include + ${ENERGY_MANAGEMENT_COMMON}/include ) target_sources(${APP_TARGET} @@ -57,12 +59,15 @@ target_sources(${APP_TARGET} ${ALL_CLUSTERS_COMMON}/src/air-quality-instance.cpp ${ALL_CLUSTERS_COMMON}/src/concentration-measurement-instances.cpp ${ALL_CLUSTERS_COMMON}/src/fan-stub.cpp - ${ALL_CLUSTERS_COMMON}/src/EnergyEvseDelegateImpl.cpp - ${ALL_CLUSTERS_COMMON}/src/EnergyEvseManager.cpp + ${ALL_CLUSTERS_COMMON}/src/device-energy-management-stub.cpp ${ALL_CLUSTERS_COMMON}/src/energy-evse-stub.cpp ${ALL_CLUSTERS_COMMON}/src/resource-monitoring-delegates.cpp ${ALL_CLUSTERS_COMMON}/src/static-supported-modes-manager.cpp ${ALL_CLUSTERS_COMMON}/src/binding-handler.cpp + ${ENERGY_MANAGEMENT_COMMON}/src/EnergyEvseDelegateImpl.cpp + ${ENERGY_MANAGEMENT_COMMON}/src/EnergyEvseManager.cpp + ${ENERGY_MANAGEMENT_COMMON}/src/DeviceEnergyManagementDelegateImpl.cpp + ${ENERGY_MANAGEMENT_COMMON}/src/DeviceEnergyManagementManager.cpp ) target_link_libraries(${APP_TARGET} diff --git a/examples/all-clusters-app/telink/CMakeLists.txt b/examples/all-clusters-app/telink/CMakeLists.txt index fa279aa4c8a90f..ab422a38530d84 100644 --- a/examples/all-clusters-app/telink/CMakeLists.txt +++ b/examples/all-clusters-app/telink/CMakeLists.txt @@ -19,6 +19,7 @@ get_filename_component(CHIP_ROOT ${CMAKE_CURRENT_SOURCE_DIR}/third_party/connect get_filename_component(TELINK_COMMON ${CHIP_ROOT}/examples/platform/telink REALPATH) get_filename_component(GEN_DIR ${CHIP_ROOT}/zzz_generated/ REALPATH) get_filename_component(ALL_CLUSTERS_COMMON_DIR ${CHIP_ROOT}/examples/all-clusters-app/all-clusters-common REALPATH) +get_filename_component(ENERGY_MANAGEMENT_COMMON_DIR ${CHIP_ROOT}/examples/energy-management-app/energy-management-common/ REALPATH) if(EXISTS "${CMAKE_CURRENT_SOURCE_DIR}/boards/${BOARD}.overlay") set(LOCAL_DTC_OVERLAY_FILE "${CMAKE_CURRENT_SOURCE_DIR}/boards/${BOARD}.overlay") @@ -65,6 +66,7 @@ target_compile_options(app PRIVATE -fpermissive) target_include_directories(app PRIVATE include ${ALL_CLUSTERS_COMMON_DIR}/include + ${ENERGY_MANAGEMENT_COMMON_DIR}/include ${GEN_DIR}/app-common ${GEN_DIR}/all-clusters-app ${TELINK_COMMON}/common/include @@ -84,10 +86,13 @@ target_sources(app PRIVATE ${ALL_CLUSTERS_COMMON_DIR}/src/air-quality-instance.cpp ${ALL_CLUSTERS_COMMON_DIR}/src/concentration-measurement-instances.cpp ${ALL_CLUSTERS_COMMON_DIR}/src/fan-stub.cpp - ${ALL_CLUSTERS_COMMON_DIR}/src/EnergyEvseDelegateImpl.cpp - ${ALL_CLUSTERS_COMMON_DIR}/src/EnergyEvseManager.cpp + ${ALL_CLUSTERS_COMMON_DIR}/src/device-energy-management-stub.cpp ${ALL_CLUSTERS_COMMON_DIR}/src/energy-evse-stub.cpp ${ALL_CLUSTERS_COMMON_DIR}/src/resource-monitoring-delegates.cpp + ${ENERGY_MANAGEMENT_COMMON_DIR}/src/EnergyEvseDelegateImpl.cpp + ${ENERGY_MANAGEMENT_COMMON_DIR}/src/EnergyEvseManager.cpp + ${ENERGY_MANAGEMENT_COMMON_DIR}/src/DeviceEnergyManagementDelegateImpl.cpp + ${ENERGY_MANAGEMENT_COMMON_DIR}/src/DeviceEnergyManagementManager.cpp ${TELINK_COMMON}/common/src/mainCommon.cpp ${TELINK_COMMON}/common/src/AppTaskCommon.cpp ${TELINK_COMMON}/util/src/LEDWidget.cpp From 2f744c6c786e822be85e12332f61193ed5e5bafe Mon Sep 17 00:00:00 2001 From: James Harrow Date: Thu, 21 Dec 2023 00:26:19 +0000 Subject: [PATCH 043/114] Added device-energy-management-server to ESP32 all-clusters CMakeLists.txt --- examples/all-clusters-app/esp32/main/CMakeLists.txt | 1 + 1 file changed, 1 insertion(+) diff --git a/examples/all-clusters-app/esp32/main/CMakeLists.txt b/examples/all-clusters-app/esp32/main/CMakeLists.txt index e8851aa5a4d3d5..798bdec98b8e3b 100644 --- a/examples/all-clusters-app/esp32/main/CMakeLists.txt +++ b/examples/all-clusters-app/esp32/main/CMakeLists.txt @@ -73,6 +73,7 @@ set(SRC_DIRS_LIST "${CMAKE_SOURCE_DIR}/third_party/connectedhomeip/src/app/clusters/icd-management-server" "${CMAKE_SOURCE_DIR}/third_party/connectedhomeip/src/app/clusters/diagnostic-logs-server" "${CMAKE_SOURCE_DIR}/third_party/connectedhomeip/src/app/clusters/occupancy-sensor-server" + "${CMAKE_SOURCE_DIR}/third_party/connectedhomeip/src/app/clusters/device-energy-management-server" "${CMAKE_SOURCE_DIR}/third_party/connectedhomeip/src/app/clusters/energy-evse-server" "${CMAKE_SOURCE_DIR}/third_party/connectedhomeip/src/app/clusters/ethernet-network-diagnostics-server" "${CMAKE_SOURCE_DIR}/third_party/connectedhomeip/src/app/clusters/localization-configuration-server" From 88003efc9f7864ee24c7b0a198d881e468b85ff4 Mon Sep 17 00:00:00 2001 From: James Harrow Date: Thu, 21 Dec 2023 09:26:32 +0000 Subject: [PATCH 044/114] Removed return at end of void function. --- .../device-energy-management-server.cpp | 9 --------- 1 file changed, 9 deletions(-) diff --git a/src/app/clusters/device-energy-management-server/device-energy-management-server.cpp b/src/app/clusters/device-energy-management-server/device-energy-management-server.cpp index 1d656c2e366fee..098ee4241e8ee5 100644 --- a/src/app/clusters/device-energy-management-server/device-energy-management-server.cpp +++ b/src/app/clusters/device-energy-management-server/device-energy-management-server.cpp @@ -275,7 +275,6 @@ void Instance::HandlePowerAdjustRequest(HandlerContext & ctx, const Commands::Po { ChipLogError(Zcl, "DEM: %s Failed to PowerAdjustRequest() args.", __FUNCTION__); } - return; } void Instance::HandleCancelPowerAdjustRequest(HandlerContext & ctx, @@ -300,8 +299,6 @@ void Instance::HandleCancelPowerAdjustRequest(HandlerContext & ctx, ChipLogError(Zcl, "DEM: %s Failed to CancelPowerAdjustRequest()", __FUNCTION__); return; } - - return; } void Instance::HandleStartTimeAdjustRequest(HandlerContext & ctx, @@ -402,8 +399,6 @@ void Instance::HandleStartTimeAdjustRequest(HandlerContext & ctx, static_cast(requestedStartTime)); return; } - - return; } void Instance::HandlePauseRequest(HandlerContext & ctx, const Commands::PauseRequest::DecodableType & commandData) @@ -478,8 +473,6 @@ void Instance::HandlePauseRequest(HandlerContext & ctx, const Commands::PauseReq ChipLogError(Zcl, "DEM: %s - mDelegate.PauseRequest(%ld) FAILURE", __FUNCTION__, static_cast(duration)); return; } - - return; } void Instance::HandleResumeRequest(HandlerContext & ctx, const Commands::ResumeRequest::DecodableType & commandData) @@ -501,8 +494,6 @@ void Instance::HandleResumeRequest(HandlerContext & ctx, const Commands::ResumeR ChipLogError(Zcl, "DEM: %s - mDelegate.ResumeRequest() FAILURE", __FUNCTION__); return; } - - return; } void Instance::HandleModifyForecastRequest(HandlerContext & ctx, const Commands::ModifyForecastRequest::DecodableType & commandData) From 0bad68b9a9101f69e90e38969dd854935d6086d7 Mon Sep 17 00:00:00 2001 From: James Harrow Date: Thu, 21 Dec 2023 09:33:22 +0000 Subject: [PATCH 045/114] Added include to all-clusters-minimal in ESP32 --- examples/all-clusters-minimal-app/esp32/main/CMakeLists.txt | 3 +++ 1 file changed, 3 insertions(+) diff --git a/examples/all-clusters-minimal-app/esp32/main/CMakeLists.txt b/examples/all-clusters-minimal-app/esp32/main/CMakeLists.txt index 33582927c19d26..cae8b64315a232 100644 --- a/examples/all-clusters-minimal-app/esp32/main/CMakeLists.txt +++ b/examples/all-clusters-minimal-app/esp32/main/CMakeLists.txt @@ -19,6 +19,7 @@ # The list of src and include dirs must be in sync with that in all-clusters-minimal-app/esp32/main/component.mk set(PRIV_INCLUDE_DIRS_LIST "${CMAKE_SOURCE_DIR}/third_party/connectedhomeip/examples/all-clusters-app/all-clusters-common/include" + "${CMAKE_SOURCE_DIR}/third_party/connectedhomeip/examples/energy-management-app/energy-management-common/include" "${CMAKE_CURRENT_LIST_DIR}/include" "${CMAKE_SOURCE_DIR}/third_party/connectedhomeip/examples/providers" "${CMAKE_SOURCE_DIR}/third_party/connectedhomeip/examples/platform/esp32" @@ -80,6 +81,8 @@ set(SRC_DIRS_LIST "${CMAKE_SOURCE_DIR}/third_party/connectedhomeip/src/app/clusters/diagnostic-logs-server" "${CMAKE_SOURCE_DIR}/third_party/connectedhomeip/src/app/clusters/door-lock-server" "${CMAKE_SOURCE_DIR}/third_party/connectedhomeip/src/app/clusters/occupancy-sensor-server" + "${CMAKE_SOURCE_DIR}/third_party/connectedhomeip/src/app/clusters/device-energy-management-server" + "${CMAKE_SOURCE_DIR}/third_party/connectedhomeip/src/app/clusters/energy-evse-server" "${CMAKE_SOURCE_DIR}/third_party/connectedhomeip/src/app/clusters/ethernet-network-diagnostics-server" "${CMAKE_SOURCE_DIR}/third_party/connectedhomeip/src/app/clusters/localization-configuration-server" "${CMAKE_SOURCE_DIR}/third_party/connectedhomeip/src/app/clusters/time-format-localization-server" From 082f1b7e3c321c4e099fcfdec8eacdb5263068ae Mon Sep 17 00:00:00 2001 From: James Harrow Date: Fri, 22 Dec 2023 09:28:56 +0000 Subject: [PATCH 046/114] Removed __FUNCTION__ from logs --- .../DeviceEnergyManagementDelegateImpl.cpp | 5 +- .../device-energy-management-server.cpp | 60 +++++++++---------- 2 files changed, 32 insertions(+), 33 deletions(-) diff --git a/examples/energy-management-app/energy-management-common/src/DeviceEnergyManagementDelegateImpl.cpp b/examples/energy-management-app/energy-management-common/src/DeviceEnergyManagementDelegateImpl.cpp index 74ad9e9e23f47a..25a9afd6a766cc 100644 --- a/examples/energy-management-app/energy-management-common/src/DeviceEnergyManagementDelegateImpl.cpp +++ b/examples/energy-management-app/energy-management-common/src/DeviceEnergyManagementDelegateImpl.cpp @@ -335,7 +335,7 @@ DeviceEnergyManagementDelegate::SetPowerAdjustmentCapability(PowerAdjustmentCapa if (powerAdjustmentCapability.IsNull()) { mPowerAdjustmentCapability.SetNull(); - ChipLogDetail(AppServer, "null src - %s", __FUNCTION__); + ChipLogDetail(AppServer, "DEM: PowerAdjustmentCapability is null"); } else { @@ -365,7 +365,7 @@ CHIP_ERROR DeviceEnergyManagementDelegate::SetForecast(DataModel::Nullable= pas.minPower) && (durationSec >= pas.minDuration) && (power <= pas.maxPower) && (durationSec <= pas.maxDuration)) { - ChipLogProgress(Zcl, "DEM: %s Good PowerAdjustment args", __FUNCTION__); + ChipLogProgress(Zcl, "DEM: Good PowerAdjustment args"); validArgs = true; break; } @@ -262,18 +262,18 @@ void Instance::HandlePowerAdjustRequest(HandlerContext & ctx, const Commands::Po if (!validArgs) { - ChipLogError(Zcl, "DEM: %s invalid request range", __FUNCTION__); + ChipLogError(Zcl, "DEM: invalid request range"); ctx.mCommandHandler.AddStatus(ctx.mRequestPath, Status::ConstraintError); return; } - ChipLogProgress(Zcl, "DEM: %s Good PowerAdjustRequest() args.", __FUNCTION__); + ChipLogProgress(Zcl, "DEM: Good PowerAdjustRequest() args."); status = mDelegate.PowerAdjustRequest(power, durationSec); ctx.mCommandHandler.AddStatus(ctx.mRequestPath, status); if (status != Status::Success) { - ChipLogError(Zcl, "DEM: %s Failed to PowerAdjustRequest() args.", __FUNCTION__); + ChipLogError(Zcl, "DEM: Failed to PowerAdjustRequest() args."); } } @@ -287,7 +287,7 @@ void Instance::HandleCancelPowerAdjustRequest(HandlerContext & ctx, esaStatus = mDelegate.GetESAState(); if (ESAStateEnum::kPowerAdjustActive != esaStatus) { - ChipLogError(Zcl, "DEM: %s - kPowerAdjustActive != esaStatus", __FUNCTION__); + ChipLogError(Zcl, "DEM: kPowerAdjustActive != esaStatus"); ctx.mCommandHandler.AddStatus(ctx.mRequestPath, Status::Failure); return; } @@ -296,7 +296,7 @@ void Instance::HandleCancelPowerAdjustRequest(HandlerContext & ctx, ctx.mCommandHandler.AddStatus(ctx.mRequestPath, status); if (status != Status::Success) { - ChipLogError(Zcl, "DEM: %s Failed to CancelPowerAdjustRequest()", __FUNCTION__); + ChipLogError(Zcl, "DEM: Failed to CancelPowerAdjustRequest()"); return; } } @@ -314,14 +314,14 @@ void Instance::HandleStartTimeAdjustRequest(HandlerContext & ctx, if (forecast.IsNull()) { - ChipLogError(Zcl, "DEM: %s - Forecast is Null", __FUNCTION__); + ChipLogError(Zcl, "DEM: Forecast is Null"); ctx.mCommandHandler.AddStatus(ctx.mRequestPath, Status::Failure); return; } if (ESAStateEnum::kUserOptOut == mDelegate.GetESAState()) { - ChipLogError(Zcl, "DEM: %s - ESAState = kUserOptOut", __FUNCTION__); + ChipLogError(Zcl, "DEM: ESAState = kUserOptOut"); ctx.mCommandHandler.AddStatus(ctx.mRequestPath, Status::Failure); return; } @@ -335,14 +335,14 @@ void Instance::HandleStartTimeAdjustRequest(HandlerContext & ctx, if (forecast.Value().earliestStartTime.HasValue() || forecast.Value().latestEndTime.HasValue()) { /* These Should not be NULL since this command requires FA feature and these are mandatory for that */ - ChipLogError(Zcl, "DEM: %s - EarliestStartTime / LatestEndTime not valid", __FUNCTION__); + ChipLogError(Zcl, "DEM: EarliestStartTime / LatestEndTime not valid"); ctx.mCommandHandler.AddStatus(ctx.mRequestPath, Status::Failure); return; } if (forecast.Value().earliestStartTime.Value().IsNull()) { - chip::System::Clock::Milliseconds64 cTMs; + System::Clock::Milliseconds64 cTMs; CHIP_ERROR chipError = chip::System::SystemClock().GetClock_RealTimeMS(cTMs); if (chipError != CHIP_NO_ERROR) { @@ -375,7 +375,7 @@ void Instance::HandleStartTimeAdjustRequest(HandlerContext & ctx, if (requestedStartTime < earliestStartTime) { - ChipLogError(Zcl, "DEM: %s - Bad requestedStartTime %ld, earlier than earliestStartTime %ld.", __FUNCTION__, + ChipLogError(Zcl, "DEM: Bad requestedStartTime %ld, earlier than earliestStartTime %ld.", static_cast(requestedStartTime), static_cast(earliestStartTime)); ctx.mCommandHandler.AddStatus(ctx.mRequestPath, Status::ConstraintError); return; @@ -383,19 +383,19 @@ void Instance::HandleStartTimeAdjustRequest(HandlerContext & ctx, if ((requestedStartTime + duration) > latestEndTime) { - ChipLogError(Zcl, "DEM: %s - Bad requestedStartTime + duration %ld, later than latestEndTime %ld.", __FUNCTION__, + ChipLogError(Zcl, "DEM: Bad requestedStartTime + duration %ld, later than latestEndTime %ld.", static_cast(requestedStartTime + duration), static_cast(latestEndTime)); ctx.mCommandHandler.AddStatus(ctx.mRequestPath, Status::ConstraintError); return; } - ChipLogProgress(Zcl, "DEM: %s - Good requestedStartTime %ld.", __FUNCTION__, + ChipLogProgress(Zcl, "DEM: Good requestedStartTime %ld.", static_cast(requestedStartTime)); status = mDelegate.StartTimeAdjustRequest(requestedStartTime); ctx.mCommandHandler.AddStatus(ctx.mRequestPath, status); if (status != Status::Success) { - ChipLogError(Zcl, "DEM: %s - StartTimeAdjustRequest(%ld) FAILURE", __FUNCTION__, + ChipLogError(Zcl, "DEM: StartTimeAdjustRequest(%ld) FAILURE", static_cast(requestedStartTime)); return; } @@ -411,14 +411,14 @@ void Instance::HandlePauseRequest(HandlerContext & ctx, const Commands::PauseReq if (forecast.IsNull()) { - ChipLogError(Zcl, "DEM: %s - Forecast is Null", __FUNCTION__); + ChipLogError(Zcl, "DEM: Forecast is Null"); ctx.mCommandHandler.AddStatus(ctx.mRequestPath, Status::Failure); return; } if (ESAStateEnum::kUserOptOut == mDelegate.GetESAState()) { - ChipLogError(Zcl, "DEM: %s - ESAState = kUserOptOut", __FUNCTION__); + ChipLogError(Zcl, "DEM: %s - ESAState = kUserOptOut"); ctx.mCommandHandler.AddStatus(ctx.mRequestPath, Status::Failure); return; } @@ -429,7 +429,7 @@ void Instance::HandlePauseRequest(HandlerContext & ctx, const Commands::PauseReq uint16_t activeSlotNumber; if (forecast.Value().activeSlotNumber.IsNull()) { - ChipLogError(Zcl, "DEM: %s - activeSlotNumber Is Null", __FUNCTION__); + ChipLogError(Zcl, "DEM: activeSlotNumber Is Null"); ctx.mCommandHandler.AddStatus(ctx.mRequestPath, Status::Failure); return; } @@ -437,7 +437,7 @@ void Instance::HandlePauseRequest(HandlerContext & ctx, const Commands::PauseReq activeSlotNumber = forecast.Value().activeSlotNumber.Value(); if (activeSlotNumber >= forecast.Value().slots.size()) { - ChipLogError(Zcl, "DEM: %s - Bad activeSlotNumber %d , size()=%d.", __FUNCTION__, activeSlotNumber, + ChipLogError(Zcl, "DEM: Bad activeSlotNumber %d , size()=%d.", activeSlotNumber, static_cast(forecast.Value().slots.size())); ctx.mCommandHandler.AddStatus(ctx.mRequestPath, Status::Failure); return; @@ -445,7 +445,7 @@ void Instance::HandlePauseRequest(HandlerContext & ctx, const Commands::PauseReq if (!forecast.Value().slots[activeSlotNumber].slotIsPauseable) { - ChipLogError(Zcl, "DEM: %s - activeSlotNumber %d is NOT pauseable.", __FUNCTION__, activeSlotNumber); + ChipLogError(Zcl, "DEM: activeSlotNumber %d is NOT pauseable.", activeSlotNumber); ctx.mCommandHandler.AddStatus(ctx.mRequestPath, Status::ConstraintError); return; } @@ -453,7 +453,7 @@ void Instance::HandlePauseRequest(HandlerContext & ctx, const Commands::PauseReq if ((duration < forecast.Value().slots[activeSlotNumber].minPauseDuration) && (duration > forecast.Value().slots[activeSlotNumber].maxPauseDuration)) { - ChipLogError(Zcl, "DEM: %s - out of range pause duration %ld", __FUNCTION__, static_cast(duration)); + ChipLogError(Zcl, "DEM: out of range pause duration %ld", static_cast(duration)); ctx.mCommandHandler.AddStatus(ctx.mRequestPath, Status::ConstraintError); return; } @@ -461,7 +461,7 @@ void Instance::HandlePauseRequest(HandlerContext & ctx, const Commands::PauseReq err = mDelegate.SetESAState(ESAStateEnum::kPaused); if (CHIP_NO_ERROR != err) { - ChipLogError(Zcl, "DEM: %s - SetESAState(paused) FAILURE", __FUNCTION__); + ChipLogError(Zcl, "DEM: SetESAState(paused) FAILURE"); ctx.mCommandHandler.AddStatus(ctx.mRequestPath, Status::Failure); return; } @@ -470,7 +470,7 @@ void Instance::HandlePauseRequest(HandlerContext & ctx, const Commands::PauseReq ctx.mCommandHandler.AddStatus(ctx.mRequestPath, Status::Failure); if (status != Status::Success) { - ChipLogError(Zcl, "DEM: %s - mDelegate.PauseRequest(%ld) FAILURE", __FUNCTION__, static_cast(duration)); + ChipLogError(Zcl, "DEM: mDelegate.PauseRequest(%ld) FAILURE", static_cast(duration)); return; } } @@ -482,7 +482,7 @@ void Instance::HandleResumeRequest(HandlerContext & ctx, const Commands::ResumeR if (ESAStateEnum::kPaused != mDelegate.GetESAState()) { - ChipLogError(Zcl, "DEM: %s - ESAState not Paused.", __FUNCTION__); + ChipLogError(Zcl, "DEM: ESAState not Paused."); ctx.mCommandHandler.AddStatus(ctx.mRequestPath, Status::Failure); return; } @@ -491,7 +491,7 @@ void Instance::HandleResumeRequest(HandlerContext & ctx, const Commands::ResumeR ctx.mCommandHandler.AddStatus(ctx.mRequestPath, Status::Failure); if (status != Status::Success) { - ChipLogError(Zcl, "DEM: %s - mDelegate.ResumeRequest() FAILURE", __FUNCTION__); + ChipLogError(Zcl, "DEM: mDelegate.ResumeRequest() FAILURE"); return; } } @@ -504,7 +504,7 @@ void Instance::HandleModifyForecastRequest(HandlerContext & ctx, const Commands: if (ESAStateEnum::kUserOptOut == mDelegate.GetESAState()) { - ChipLogError(Zcl, "DEM: %s - ESAState = kUserOptOut", __FUNCTION__); + ChipLogError(Zcl, "DEM: ESAState = kUserOptOut"); ctx.mCommandHandler.AddStatus(ctx.mRequestPath, Status::Failure); return; } @@ -512,7 +512,7 @@ void Instance::HandleModifyForecastRequest(HandlerContext & ctx, const Commands: forecast = mDelegate.GetForecast(); if (forecast.IsNull()) { - ChipLogError(Zcl, "DEM: %s - Forecast is Null", __FUNCTION__); + ChipLogError(Zcl, "DEM: Forecast is Null"); ctx.mCommandHandler.AddStatus(ctx.mRequestPath, Status::Failure); return; } @@ -521,7 +521,7 @@ void Instance::HandleModifyForecastRequest(HandlerContext & ctx, const Commands: status = mDelegate.ModifyForecastRequest(forecastId, slotAdjustments); if (status != Status::Success) { - ChipLogError(Zcl, "DEM: %s - mDelegate.ModifyForecastRequest() FAILURE", __FUNCTION__); + ChipLogError(Zcl, "DEM: mDelegate.ModifyForecastRequest() FAILURE"); ctx.mCommandHandler.AddStatus(ctx.mRequestPath, Status::Failure); return; } @@ -534,7 +534,7 @@ void Instance::HandleRequestConstraintBasedForecast(HandlerContext & ctx, if (ESAStateEnum::kUserOptOut == mDelegate.GetESAState()) { - ChipLogError(Zcl, "DEM: %s - ESAState = kUserOptOut", __FUNCTION__); + ChipLogError(Zcl, "DEM: ESAState = kUserOptOut"); ctx.mCommandHandler.AddStatus(ctx.mRequestPath, Status::Failure); return; } @@ -542,7 +542,7 @@ void Instance::HandleRequestConstraintBasedForecast(HandlerContext & ctx, status = mDelegate.RequestConstraintBasedForecast(commandData.constraints); if (status != Status::Success) { - ChipLogError(Zcl, "DEM: %s - mDelegate.commandData.constraints() FAILURE", __FUNCTION__); + ChipLogError(Zcl, "DEM: mDelegate.commandData.constraints() FAILURE"); ctx.mCommandHandler.AddStatus(ctx.mRequestPath, Status::Failure); return; } From db4e85bae8ad42b5921b938d48377c569c684f63 Mon Sep 17 00:00:00 2001 From: James Harrow Date: Tue, 26 Dec 2023 10:23:17 +0000 Subject: [PATCH 047/114] Removed stray %s --- .../device-energy-management-server.cpp | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/src/app/clusters/device-energy-management-server/device-energy-management-server.cpp b/src/app/clusters/device-energy-management-server/device-energy-management-server.cpp index 39b0c0e50135f7..60b341022d68cb 100644 --- a/src/app/clusters/device-energy-management-server/device-energy-management-server.cpp +++ b/src/app/clusters/device-energy-management-server/device-energy-management-server.cpp @@ -389,14 +389,12 @@ void Instance::HandleStartTimeAdjustRequest(HandlerContext & ctx, return; } - ChipLogProgress(Zcl, "DEM: Good requestedStartTime %ld.", - static_cast(requestedStartTime)); + ChipLogProgress(Zcl, "DEM: Good requestedStartTime %ld.", static_cast(requestedStartTime)); status = mDelegate.StartTimeAdjustRequest(requestedStartTime); ctx.mCommandHandler.AddStatus(ctx.mRequestPath, status); if (status != Status::Success) { - ChipLogError(Zcl, "DEM: StartTimeAdjustRequest(%ld) FAILURE", - static_cast(requestedStartTime)); + ChipLogError(Zcl, "DEM: StartTimeAdjustRequest(%ld) FAILURE", static_cast(requestedStartTime)); return; } } @@ -418,7 +416,7 @@ void Instance::HandlePauseRequest(HandlerContext & ctx, const Commands::PauseReq if (ESAStateEnum::kUserOptOut == mDelegate.GetESAState()) { - ChipLogError(Zcl, "DEM: %s - ESAState = kUserOptOut"); + ChipLogError(Zcl, "DEM: ESAState = kUserOptOut"); ctx.mCommandHandler.AddStatus(ctx.mRequestPath, Status::Failure); return; } From f7652064f7bae4c43945824adf32d68e1684a615 Mon Sep 17 00:00:00 2001 From: James Harrow Date: Tue, 26 Dec 2023 10:46:17 +0000 Subject: [PATCH 048/114] Added FeatureMap handling in sdk (not in ember) --- .../all-clusters-common/all-clusters-app.matter | 4 ++-- .../all-clusters-common/all-clusters-app.zap | 17 ++++++++--------- .../energy-management-app.matter | 4 ++-- .../energy-management-app.zap | 16 ++++++++-------- .../device-energy-management-server.cpp | 3 +++ .../energy-evse-server/energy-evse-server.cpp | 4 ++++ 6 files changed, 27 insertions(+), 21 deletions(-) diff --git a/examples/all-clusters-app/all-clusters-common/all-clusters-app.matter b/examples/all-clusters-app/all-clusters-common/all-clusters-app.matter index c79296da267040..6784c9d249fe90 100644 --- a/examples/all-clusters-app/all-clusters-common/all-clusters-app.matter +++ b/examples/all-clusters-app/all-clusters-common/all-clusters-app.matter @@ -7550,7 +7550,7 @@ endpoint 1 { callback attribute acceptedCommandList; callback attribute eventList; callback attribute attributeList; - ram attribute featureMap default = 0; + callback attribute featureMap default = 0; ram attribute clusterRevision default = 2; handle command PowerAdjustRequest; @@ -7592,7 +7592,7 @@ endpoint 1 { callback attribute acceptedCommandList; callback attribute eventList; callback attribute attributeList; - ram attribute featureMap default = 0; + callback attribute featureMap default = 0; ram attribute clusterRevision default = 2; handle command GetTargetsResponse; diff --git a/examples/all-clusters-app/all-clusters-common/all-clusters-app.zap b/examples/all-clusters-app/all-clusters-common/all-clusters-app.zap index d827e1e122954f..28c219ed59dfa0 100644 --- a/examples/all-clusters-app/all-clusters-common/all-clusters-app.zap +++ b/examples/all-clusters-app/all-clusters-common/all-clusters-app.zap @@ -8426,7 +8426,7 @@ "storageOption": "External", "singleton": 0, "bounded": 0, - "defaultValue": "", + "defaultValue": null, "reportable": 1, "minInterval": 1, "maxInterval": 65534, @@ -8458,7 +8458,7 @@ "storageOption": "External", "singleton": 0, "bounded": 0, - "defaultValue": "", + "defaultValue": null, "reportable": 1, "minInterval": 1, "maxInterval": 65534, @@ -8474,7 +8474,7 @@ "storageOption": "External", "singleton": 0, "bounded": 0, - "defaultValue": "", + "defaultValue": null, "reportable": 1, "minInterval": 1, "maxInterval": 65534, @@ -8490,7 +8490,7 @@ "storageOption": "External", "singleton": 0, "bounded": 0, - "defaultValue": "", + "defaultValue": null, "reportable": 1, "minInterval": 1, "maxInterval": 65534, @@ -8506,7 +8506,7 @@ "storageOption": "External", "singleton": 0, "bounded": 0, - "defaultValue": "", + "defaultValue": null, "reportable": 1, "minInterval": 1, "maxInterval": 65534, @@ -12117,7 +12117,7 @@ "side": "server", "type": "bitmap32", "included": 1, - "storageOption": "RAM", + "storageOption": "External", "singleton": 0, "bounded": 0, "defaultValue": "0", @@ -12720,7 +12720,7 @@ "side": "server", "type": "bitmap32", "included": 1, - "storageOption": "RAM", + "storageOption": "External", "singleton": 0, "bounded": 0, "defaultValue": "0", @@ -22967,5 +22967,4 @@ } ], "log": [] -} - +} \ No newline at end of file diff --git a/examples/energy-management-app/energy-management-common/energy-management-app.matter b/examples/energy-management-app/energy-management-common/energy-management-app.matter index 3e841739756f22..d9de9f7e8b79ba 100644 --- a/examples/energy-management-app/energy-management-common/energy-management-app.matter +++ b/examples/energy-management-app/energy-management-common/energy-management-app.matter @@ -1485,7 +1485,7 @@ endpoint 1 { callback attribute acceptedCommandList; callback attribute eventList; callback attribute attributeList; - ram attribute featureMap default = 0; + callback attribute featureMap default = 0; ram attribute clusterRevision default = 2; handle command PowerAdjustRequest; @@ -1533,7 +1533,7 @@ endpoint 1 { callback attribute acceptedCommandList; callback attribute eventList; callback attribute attributeList; - ram attribute featureMap default = 1; + callback attribute featureMap default = 1; ram attribute clusterRevision default = 2; handle command GetTargetsResponse; diff --git a/examples/energy-management-app/energy-management-common/energy-management-app.zap b/examples/energy-management-app/energy-management-common/energy-management-app.zap index b7d2271cea5b8b..8ed4aa6e2167d7 100644 --- a/examples/energy-management-app/energy-management-common/energy-management-app.zap +++ b/examples/energy-management-app/energy-management-common/energy-management-app.zap @@ -2674,7 +2674,7 @@ "storageOption": "External", "singleton": 0, "bounded": 0, - "defaultValue": "", + "defaultValue": null, "reportable": 1, "minInterval": 1, "maxInterval": 65534, @@ -2690,7 +2690,7 @@ "storageOption": "External", "singleton": 0, "bounded": 0, - "defaultValue": "", + "defaultValue": null, "reportable": 1, "minInterval": 1, "maxInterval": 65534, @@ -2706,7 +2706,7 @@ "storageOption": "External", "singleton": 0, "bounded": 0, - "defaultValue": "", + "defaultValue": null, "reportable": 1, "minInterval": 1, "maxInterval": 65534, @@ -2722,7 +2722,7 @@ "storageOption": "External", "singleton": 0, "bounded": 0, - "defaultValue": "", + "defaultValue": null, "reportable": 1, "minInterval": 1, "maxInterval": 65534, @@ -2738,7 +2738,7 @@ "storageOption": "External", "singleton": 0, "bounded": 0, - "defaultValue": "", + "defaultValue": null, "reportable": 1, "minInterval": 1, "maxInterval": 65534, @@ -2754,7 +2754,7 @@ "storageOption": "External", "singleton": 0, "bounded": 0, - "defaultValue": "", + "defaultValue": null, "reportable": 1, "minInterval": 1, "maxInterval": 65534, @@ -2767,7 +2767,7 @@ "side": "server", "type": "bitmap32", "included": 1, - "storageOption": "RAM", + "storageOption": "External", "singleton": 0, "bounded": 0, "defaultValue": "0", @@ -3370,7 +3370,7 @@ "side": "server", "type": "bitmap32", "included": 1, - "storageOption": "RAM", + "storageOption": "External", "singleton": 0, "bounded": 0, "defaultValue": "1", diff --git a/src/app/clusters/device-energy-management-server/device-energy-management-server.cpp b/src/app/clusters/device-energy-management-server/device-energy-management-server.cpp index 60b341022d68cb..02f3a74523567a 100644 --- a/src/app/clusters/device-energy-management-server/device-energy-management-server.cpp +++ b/src/app/clusters/device-energy-management-server/device-energy-management-server.cpp @@ -87,6 +87,9 @@ CHIP_ERROR Instance::Read(const ConcreteReadAttributePath & aPath, AttributeValu return CHIP_IM_GLOBAL_STATUS(UnsupportedAttribute); } return aEncoder.Encode(mDelegate.GetForecast()); + /* FeatureMap - is held locally */ + case FeatureMap::Id: + return aEncoder.Encode(mFeature); } /* Allow all other unhandled attributes to fall through to Ember */ diff --git a/src/app/clusters/energy-evse-server/energy-evse-server.cpp b/src/app/clusters/energy-evse-server/energy-evse-server.cpp index 60f9e24be0f962..949a43867ab141 100644 --- a/src/app/clusters/energy-evse-server/energy-evse-server.cpp +++ b/src/app/clusters/energy-evse-server/energy-evse-server.cpp @@ -125,6 +125,10 @@ CHIP_ERROR Instance::Read(const ConcreteReadAttributePath & aPath, AttributeValu return aEncoder.Encode(mDelegate.GetSessionEnergyCharged()); case SessionEnergyDischarged::Id: return aEncoder.Encode(mDelegate.GetSessionEnergyDischarged()); + + /* FeatureMap - is held locally */ + case FeatureMap::Id: + return aEncoder.Encode(mFeature); } /* Allow all other unhandled attributes to fall through to Ember */ return CHIP_NO_ERROR; From a098fbdc68253d62357e1c8b2964a39f7d246668 Mon Sep 17 00:00:00 2001 From: James Harrow Date: Wed, 27 Dec 2023 12:12:46 +0000 Subject: [PATCH 049/114] Removed extra chip:: --- .../device-energy-management-server.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/app/clusters/device-energy-management-server/device-energy-management-server.cpp b/src/app/clusters/device-energy-management-server/device-energy-management-server.cpp index 02f3a74523567a..673f1ea638011f 100644 --- a/src/app/clusters/device-energy-management-server/device-energy-management-server.cpp +++ b/src/app/clusters/device-energy-management-server/device-energy-management-server.cpp @@ -346,7 +346,7 @@ void Instance::HandleStartTimeAdjustRequest(HandlerContext & ctx, if (forecast.Value().earliestStartTime.Value().IsNull()) { System::Clock::Milliseconds64 cTMs; - CHIP_ERROR chipError = chip::System::SystemClock().GetClock_RealTimeMS(cTMs); + CHIP_ERROR chipError = System::SystemClock().GetClock_RealTimeMS(cTMs); if (chipError != CHIP_NO_ERROR) { ChipLogError(Zcl, "DEM: Unable to get current time - error=%ld (%s)]", @@ -355,9 +355,9 @@ void Instance::HandleStartTimeAdjustRequest(HandlerContext & ctx, return; } - auto unixEpoch = std::chrono::duration_cast(cTMs).count(); + auto unixEpoch = std::chrono::duration_cast(cTMs).count(); uint32_t chipEpoch = 0; - if (!chip::UnixEpochToChipEpochTime(unixEpoch, chipEpoch)) + if (!UnixEpochToChipEpochTime(unixEpoch, chipEpoch)) { ChipLogError(Zcl, "DEM: unable to convert Unix Epoch time to Matter Epoch Time"); ctx.mCommandHandler.AddStatus(ctx.mRequestPath, Status::Failure); From dac77cb32ac160d20fcb6b7fa29e6597ec365591 Mon Sep 17 00:00:00 2001 From: James Harrow Date: Wed, 27 Dec 2023 12:13:32 +0000 Subject: [PATCH 050/114] Used CHIP_ERROR_FORMAT, err.Format() mechanism --- .../device-energy-management-server.cpp | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/src/app/clusters/device-energy-management-server/device-energy-management-server.cpp b/src/app/clusters/device-energy-management-server/device-energy-management-server.cpp index 673f1ea638011f..96130daa654388 100644 --- a/src/app/clusters/device-energy-management-server/device-energy-management-server.cpp +++ b/src/app/clusters/device-energy-management-server/device-energy-management-server.cpp @@ -346,11 +346,10 @@ void Instance::HandleStartTimeAdjustRequest(HandlerContext & ctx, if (forecast.Value().earliestStartTime.Value().IsNull()) { System::Clock::Milliseconds64 cTMs; - CHIP_ERROR chipError = System::SystemClock().GetClock_RealTimeMS(cTMs); - if (chipError != CHIP_NO_ERROR) + CHIP_ERROR err = System::SystemClock().GetClock_RealTimeMS(cTMs); + if (err != CHIP_NO_ERROR) { - ChipLogError(Zcl, "DEM: Unable to get current time - error=%ld (%s)]", - static_cast(chipError.AsInteger()), chipError.AsString()); + ChipLogError(Zcl, "DEM: Unable to get current time - err:%" CHIP_ERROR_FORMAT, err.Format()); ctx.mCommandHandler.AddStatus(ctx.mRequestPath, Status::Failure); return; } From 8ea64dde32ba6ef694f64f7ae5b58ddef9a1442f Mon Sep 17 00:00:00 2001 From: James Harrow Date: Wed, 27 Dec 2023 13:01:01 +0000 Subject: [PATCH 051/114] Refactored StartTimeAdjust based on review comments. --- .../device-energy-management-server.cpp | 64 +++++++++++-------- 1 file changed, 36 insertions(+), 28 deletions(-) diff --git a/src/app/clusters/device-energy-management-server/device-energy-management-server.cpp b/src/app/clusters/device-energy-management-server/device-energy-management-server.cpp index 96130daa654388..f5c7f4b47a83de 100644 --- a/src/app/clusters/device-energy-management-server/device-energy-management-server.cpp +++ b/src/app/clusters/device-energy-management-server/device-energy-management-server.cpp @@ -307,15 +307,15 @@ void Instance::HandleCancelPowerAdjustRequest(HandlerContext & ctx, void Instance::HandleStartTimeAdjustRequest(HandlerContext & ctx, const Commands::StartTimeAdjustRequest::DecodableType & commandData) { - Status status = Status::Success; - uint32_t earliestStartTime = 0; - uint32_t latestEndTime = 0; - DataModel::Nullable forecast = mDelegate.GetForecast(); - + Status status = Status::Success; + uint32_t earliestStartTimeEpoch = 0; + uint32_t latestEndTimeEpoch = 0; + uint32_t requestedStartTimeEpoch = commandData.requestedStartTime; uint32_t duration; - uint32_t requestedStartTime = commandData.requestedStartTime; - if (forecast.IsNull()) + DataModel::Nullable forecastNullable = mDelegate.GetForecast(); + + if (forecastNullable.IsNull()) { ChipLogError(Zcl, "DEM: Forecast is Null"); ctx.mCommandHandler.AddStatus(ctx.mRequestPath, Status::Failure); @@ -329,21 +329,30 @@ void Instance::HandleStartTimeAdjustRequest(HandlerContext & ctx, return; } - /* If the RequestedStartTime value resulted in a time shift which is + /* Temporary variable to save calling .Value() on forecastNullable */ + auto & forecast = forecastNullable.Value(); + + /** + * If the RequestedStartTime value resulted in a time shift which is * outside the time constraints of EarliestStartTime and * LatestEndTime, then the command SHALL be rejected with CONSTRAINT_ERROR; - * otherwise the command SHALL be rejected with FAILURE + * in other failure scenarios the command SHALL be rejected with FAILURE */ - /* earliestStartTime is optional based on the FA (ForecastAdjust) feature AND is nullable */ - if (forecast.Value().earliestStartTime.HasValue() || forecast.Value().latestEndTime.HasValue()) + /* earliestStartTime is optional based on the StartTimeAdjust (STA) feature AND is nullable */ + if (!(forecast.earliestStartTime.HasValue()) || !(forecast.latestEndTime.HasValue())) { - /* These Should not be NULL since this command requires FA feature and these are mandatory for that */ - ChipLogError(Zcl, "DEM: EarliestStartTime / LatestEndTime not valid"); + /* These should not be NULL since this command requires STA feature and these are mandatory for that */ + ChipLogError(Zcl, "DEM: EarliestStartTime / LatestEndTime do not have values"); ctx.mCommandHandler.AddStatus(ctx.mRequestPath, Status::Failure); return; } - if (forecast.Value().earliestStartTime.Value().IsNull()) + /* Temporary variable to save keep calling .Value() on the Optional element */ + auto & earliestStartTimeOptional = forecast.earliestStartTime.Value(); + /* Latest End Time is optional & cannot be null - unlike earliestStartTime! */ + latestEndTimeEpoch = forecast.latestEndTime.Value(); + + if (earliestStartTimeOptional.IsNull()) { System::Clock::Milliseconds64 cTMs; CHIP_ERROR err = System::SystemClock().GetClock_RealTimeMS(cTMs); @@ -364,39 +373,38 @@ void Instance::HandleStartTimeAdjustRequest(HandlerContext & ctx, } /* Null means - We can start immediately */ - earliestStartTime = chipEpoch; /* NOW */ + earliestStartTimeEpoch = chipEpoch; /* NOW */ } else { - earliestStartTime = forecast.Value().earliestStartTime.Value().Value(); + earliestStartTimeEpoch = earliestStartTimeOptional.Value(); } - /* Latest End Time is optional & cannot be null - unlike earliestStartTime! */ - latestEndTime = forecast.Value().latestEndTime.Value(); - - duration = forecast.Value().endTime - forecast.Value().startTime; // the current entire forecast duration - if (requestedStartTime < earliestStartTime) + duration = forecast.endTime - forecast.startTime; // the current entire forecast duration + if (requestedStartTimeEpoch < earliestStartTimeEpoch) { ChipLogError(Zcl, "DEM: Bad requestedStartTime %ld, earlier than earliestStartTime %ld.", - static_cast(requestedStartTime), static_cast(earliestStartTime)); + static_cast(requestedStartTimeEpoch), + static_cast(earliestStartTimeEpoch)); ctx.mCommandHandler.AddStatus(ctx.mRequestPath, Status::ConstraintError); return; } - if ((requestedStartTime + duration) > latestEndTime) + if ((requestedStartTimeEpoch + duration) > latestEndTimeEpoch) { - ChipLogError(Zcl, "DEM: Bad requestedStartTime + duration %ld, later than latestEndTime %ld.", - static_cast(requestedStartTime + duration), static_cast(latestEndTime)); + ChipLogError(Zcl, "DEM: Bad requestedStartTimeEpoch + duration %ld, later than latestEndTime %ld.", + static_cast(requestedStartTimeEpoch + duration), + static_cast(latestEndTimeEpoch)); ctx.mCommandHandler.AddStatus(ctx.mRequestPath, Status::ConstraintError); return; } - ChipLogProgress(Zcl, "DEM: Good requestedStartTime %ld.", static_cast(requestedStartTime)); - status = mDelegate.StartTimeAdjustRequest(requestedStartTime); + ChipLogProgress(Zcl, "DEM: Good requestedStartTimeEpoch %ld.", static_cast(requestedStartTimeEpoch)); + status = mDelegate.StartTimeAdjustRequest(requestedStartTimeEpoch); ctx.mCommandHandler.AddStatus(ctx.mRequestPath, status); if (status != Status::Success) { - ChipLogError(Zcl, "DEM: StartTimeAdjustRequest(%ld) FAILURE", static_cast(requestedStartTime)); + ChipLogError(Zcl, "DEM: StartTimeAdjustRequest(%ld) FAILURE", static_cast(requestedStartTimeEpoch)); return; } } From 7e0e5e737c6e024673f05ce5f8f9490511609435 Mon Sep 17 00:00:00 2001 From: James Harrow Date: Wed, 27 Dec 2023 13:14:07 +0000 Subject: [PATCH 052/114] Removed unnecessary Write Attributes function --- .../device-energy-management-server.cpp | 5 ----- .../device-energy-management-server.h | 2 +- 2 files changed, 1 insertion(+), 6 deletions(-) diff --git a/src/app/clusters/device-energy-management-server/device-energy-management-server.cpp b/src/app/clusters/device-energy-management-server/device-energy-management-server.cpp index f5c7f4b47a83de..255976b61da748 100644 --- a/src/app/clusters/device-energy-management-server/device-energy-management-server.cpp +++ b/src/app/clusters/device-energy-management-server/device-energy-management-server.cpp @@ -96,11 +96,6 @@ CHIP_ERROR Instance::Read(const ConcreteReadAttributePath & aPath, AttributeValu return CHIP_NO_ERROR; } -CHIP_ERROR Instance::Write(const ConcreteDataAttributePath & aPath, AttributeValueDecoder & aDecoder) -{ - return CHIP_ERROR_NOT_IMPLEMENTED; // Nothing writable in this cluster ! -} - // CommandHandlerInterface CHIP_ERROR Instance::EnumerateAcceptedCommands(const ConcreteClusterPath & cluster, CommandIdCallback callback, void * context) { diff --git a/src/app/clusters/device-energy-management-server/device-energy-management-server.h b/src/app/clusters/device-energy-management-server/device-energy-management-server.h index 457a3782fed4c5..ce9641104e5db4 100644 --- a/src/app/clusters/device-energy-management-server/device-energy-management-server.h +++ b/src/app/clusters/device-energy-management-server/device-energy-management-server.h @@ -195,7 +195,7 @@ class Instance : public AttributeAccessInterface, public CommandHandlerInterface // AttributeAccessInterface CHIP_ERROR Read(const ConcreteReadAttributePath & aPath, AttributeValueEncoder & aEncoder) override; - CHIP_ERROR Write(const ConcreteDataAttributePath & aPath, AttributeValueDecoder & aDecoder) override; + // NOTE there are no writable attributes // CommandHandlerInterface void InvokeCommand(HandlerContext & handlerContext) override; From 3f0cdedbc478f219df4cbfcb3fa1d1f32fadea9a Mon Sep 17 00:00:00 2001 From: James Harrow Date: Wed, 27 Dec 2023 18:22:36 +0000 Subject: [PATCH 053/114] Beginnings of Session handling --- .../include/EnergyEvseDelegateImpl.h | 52 +++++++- .../src/EnergyEvseDelegateImpl.cpp | 118 +++++++++++++++++- 2 files changed, 161 insertions(+), 9 deletions(-) diff --git a/examples/energy-management-app/energy-management-common/include/EnergyEvseDelegateImpl.h b/examples/energy-management-app/energy-management-common/include/EnergyEvseDelegateImpl.h index f3c003d081fc6e..6f80064d2dd9b6 100644 --- a/examples/energy-management-app/energy-management-common/include/EnergyEvseDelegateImpl.h +++ b/examples/energy-management-app/energy-management-common/include/EnergyEvseDelegateImpl.h @@ -31,6 +31,51 @@ namespace app { namespace Clusters { namespace EnergyEvse { +/** + * Helper class to handle all of the session related info + */ +class EvseSession +{ +public: + /** + * @brief This function samples the start-time, and energy meter to hold the session info + * + * @param chargingMeterValue - The current value of the energy meter (charging) in mWh + * @param dischargingMeterValue - The current value of the energy meter (discharging) in mWh + */ + void StartSession(int64_t chargingMeterValue, int64_t dischargingMeterValue); + + /** + * @brief This function updates the session Duration to allow read attributes to return latest values + */ + void RecalculateSessionDuration(); + + /** + * @brief This function updates the EnergyCharged meter value + * + * @param chargingMeterValue - The value of the energy meter (charging) in mWh + */ + void UpdateEnergyCharged(int64_t chargingMeterValue); + + /** + * @brief This function updates the EnergyDischarged meter value + * + * @param dischargingMeterValue - The value of the energy meter (discharging) in mWh + */ + void UpdateEnergyDischarged(int64_t dischargingMeterValue); + + /* Public members - represent attributes in the cluster */ + DataModel::Nullable mSessionID; + DataModel::Nullable mSessionDuration; + DataModel::Nullable mSessionEnergyCharged; + DataModel::Nullable mSessionEnergyDischarged; + +private: + uint32_t mStartTime = 0; // Epoch_s - 0 means it hasn't started yet + int64_t mSessionEnergyChargedAtStart = 0; // in mWh - 0 means it hasn't been set yet + int64_t mSessionEnergyDischargedAtStart = 0; // in mWh - 0 means it hasn't been set yet +}; + /** * The application delegate. */ @@ -193,11 +238,8 @@ class EnergyEvseDelegate : public EnergyEvse::Delegate /* PNC attributes*/ DataModel::Nullable mVehicleID; - /* Session SESS attributes */ - DataModel::Nullable mSessionID; - DataModel::Nullable mSessionDuration; - DataModel::Nullable mSessionEnergyCharged; - DataModel::Nullable mSessionEnergyDischarged; + /* Session Object */ + EvseSession mSession; }; } // namespace EnergyEvse diff --git a/examples/energy-management-app/energy-management-common/src/EnergyEvseDelegateImpl.cpp b/examples/energy-management-app/energy-management-common/src/EnergyEvseDelegateImpl.cpp index 4cc83eaaf8a835..3ea92aa78d6298 100644 --- a/examples/energy-management-app/energy-management-common/src/EnergyEvseDelegateImpl.cpp +++ b/examples/energy-management-app/energy-management-common/src/EnergyEvseDelegateImpl.cpp @@ -831,17 +831,127 @@ DataModel::Nullable EnergyEvseDelegate::GetVehicleID() /* Session SESS attributes */ DataModel::Nullable EnergyEvseDelegate::GetSessionID() { - return mSessionID; + return mSession.mSessionID; } DataModel::Nullable EnergyEvseDelegate::GetSessionDuration() { - return mSessionDuration; + mSession.RecalculateSessionDuration(); + return mSession.mSessionDuration; } DataModel::Nullable EnergyEvseDelegate::GetSessionEnergyCharged() { - return mSessionEnergyCharged; + return mSession.mSessionEnergyCharged; } DataModel::Nullable EnergyEvseDelegate::GetSessionEnergyDischarged() { - return mSessionEnergyDischarged; + return mSession.mSessionEnergyDischarged; +} + +/** + * @brief Helper function to get current timestamp in Epoch format + * + * @param chipEpoch reference to hold return timestamp + */ +CHIP_ERROR GetEpochTS(uint32_t & chipEpoch) +{ + chipEpoch = 0; + + System::Clock::Milliseconds64 cTMs; + CHIP_ERROR err = System::SystemClock().GetClock_RealTimeMS(cTMs); + if (err != CHIP_NO_ERROR) + { + ChipLogError(Zcl, "EVSE: Unable to get current time - err:%" CHIP_ERROR_FORMAT, err.Format()); + return err; + } + + auto unixEpoch = std::chrono::duration_cast(cTMs).count(); + if (!UnixEpochToChipEpochTime(unixEpoch, chipEpoch)) + { + ChipLogError(Zcl, "EVSE: unable to convert Unix Epoch time to Matter Epoch Time"); + return err; + } + + return CHIP_NO_ERROR; +} + +/** + * @brief This function samples the start-time, and energy meter to hold the session info + * + * @param chargingMeterValue - The current value of the energy meter (charging) in mWh + * @param dischargingMeterValue - The current value of the energy meter (discharging) in mWh + */ +void EvseSession::StartSession(int64_t chargingMeterValue, int64_t dischargingMeterValue) +{ + /* Get Timestamp */ + uint32_t chipEpoch = 0; + if (GetEpochTS(chipEpoch) != CHIP_NO_ERROR) + { + ChipLogError(AppServer, "EVSE: Failed to get timestamp when starting session"); + return; + } + mStartTime = chipEpoch; + + mSessionEnergyChargedAtStart = chargingMeterValue; + mSessionEnergyDischargedAtStart = dischargingMeterValue; + + if (mSessionID.IsNull()) + { + mSessionID = MakeNullable(static_cast(0)); + } + else + { + mSessionID = MakeNullable(mSessionID.Value()++); + } + + /* Reset other session values */ + mSessionDuration = MakeNullable(static_cast(0)); + mSessionEnergyCharged = MakeNullable(static_cast(0)); + mSessionEnergyDischarged = MakeNullable(static_cast(0)); + + // TODO persist mSessionID + // TODO persist mStartTime + // TODO persist mSessionEnergyChargedAtStart + // TODO persist mSessionEnergyDischargedAtStart + + // TODO call MatterReportingAttributeChangeCallback +} + +/** + * @brief This function updates the session attrs to allow read attributes to return latest values + */ +void EvseSession::RecalculateSessionDuration() +{ + /* Get Timestamp */ + uint32_t chipEpoch = 0; + if (GetEpochTS(chipEpoch) != CHIP_NO_ERROR) + { + ChipLogError(AppServer, "EVSE: Failed to get timestamp when updating session duration"); + return; + } + + uint32_t duration = chipEpoch - mStartTime; + mSessionDuration = MakeNullable(duration); + // TODO call MatterReportingAttributeChangeCallback +} + +/** + * @brief This function updates the EnergyCharged meter value + * + * @param chargingMeterValue - The value of the energy meter (charging) in mWh + */ +void EvseSession::UpdateEnergyCharged(int64_t chargingMeterValue) +{ + mSessionEnergyCharged = MakeNullable(chargingMeterValue - mSessionEnergyChargedAtStart); + // TODO call MatterReportingAttributeChangeCallback +} + +/** + * @brief This function updates the EnergyDischarged meter value + * + * @param dischargingMeterValue - The value of the energy meter (discharging) in mWh + */ +void EvseSession::UpdateEnergyDischarged(int64_t dischargingMeterValue) +{ + mSessionEnergyDischarged = MakeNullable(dischargingMeterValue - mSessionEnergyDischargedAtStart); + // TODO call MatterReportingAttributeChangeCallback } From 2990233368235d1e1b8abbe2bd779ff8dd026efb Mon Sep 17 00:00:00 2001 From: James Harrow Date: Thu, 28 Dec 2023 19:50:33 +0000 Subject: [PATCH 054/114] Added beginnings of EVConnected,EVNotDetected,EnergyTransferStarted,EnergyTransferStopped handling. State machine is not finished. Callback to read Energy Meter added --- .../include/EVSECallbacks.h | 17 ++ .../include/EVSEManufacturerImpl.h | 2 + .../include/EnergyEvseDelegateImpl.h | 14 +- .../src/EVSEManufacturerImpl.cpp | 18 +- .../src/EnergyEvseDelegateImpl.cpp | 243 ++++++++++++++++-- 5 files changed, 274 insertions(+), 20 deletions(-) diff --git a/examples/energy-management-app/energy-management-common/include/EVSECallbacks.h b/examples/energy-management-app/energy-management-common/include/EVSECallbacks.h index 5bdac2f8e853d6..e72ee80ef9fcca 100644 --- a/examples/energy-management-app/energy-management-common/include/EVSECallbacks.h +++ b/examples/energy-management-app/energy-management-common/include/EVSECallbacks.h @@ -44,12 +44,22 @@ enum EVSECallbackType * Charging Preferences have changed */ ChargingPreferencesChanged, + /* + * Energy Meter Reading requested + */ + EnergyMeterReadingRequested, /* * DeviceEnergyManagement has changed */ DeviceEnergyManagementChanged, }; +enum ChargingDischargingType +{ + kCharging, + kDischarging +}; + struct EVSECbInfo { EVSECallbackType type; @@ -68,6 +78,13 @@ struct EVSECbInfo { int64_t maximumChargeCurrent; } ChargingCurrent; + + /* for type = EnergyMeterReadingRequested */ + struct + { + ChargingDischargingType meterType; + int64_t * energyMeterValuePtr; + } EnergyMeterReadingRequest; }; }; diff --git a/examples/energy-management-app/energy-management-common/include/EVSEManufacturerImpl.h b/examples/energy-management-app/energy-management-common/include/EVSEManufacturerImpl.h index 4ff45e925674aa..4bb7cfb1dcafbf 100644 --- a/examples/energy-management-app/energy-management-common/include/EVSEManufacturerImpl.h +++ b/examples/energy-management-app/energy-management-common/include/EVSEManufacturerImpl.h @@ -49,6 +49,8 @@ class EVSEManufacturer static void ApplicationCallbackHandler(const EVSECbInfo * cb, intptr_t arg); private: + int64_t mLastChargingEnergyMeter = 0; + int64_t mLastDischargingEnergyMeter = 0; }; } // namespace EnergyEvse diff --git a/examples/energy-management-app/energy-management-common/include/EnergyEvseDelegateImpl.h b/examples/energy-management-app/energy-management-common/include/EnergyEvseDelegateImpl.h index 6f80064d2dd9b6..c7be153da04fd0 100644 --- a/examples/energy-management-app/energy-management-common/include/EnergyEvseDelegateImpl.h +++ b/examples/energy-management-app/energy-management-common/include/EnergyEvseDelegateImpl.h @@ -37,6 +37,7 @@ namespace EnergyEvse { class EvseSession { public: + EvseSession(EndpointId aEndpoint) { mEndpointId = aEndpoint; } /** * @brief This function samples the start-time, and energy meter to hold the session info * @@ -71,6 +72,8 @@ class EvseSession DataModel::Nullable mSessionEnergyDischarged; private: + EndpointId mEndpointId = 0; + uint32_t mStartTime = 0; // Epoch_s - 0 means it hasn't started yet int64_t mSessionEnergyChargedAtStart = 0; // in mWh - 0 means it hasn't been set yet int64_t mSessionEnergyDischargedAtStart = 0; // in mWh - 0 means it hasn't been set yet @@ -129,6 +132,11 @@ class EnergyEvseDelegate : public EnergyEvse::Delegate Status HwSetRFID(ByteSpan uid); Status HwSetVehicleID(const CharSpan & vehID); + Status SendEVConnectedEvent(); + Status SendEVNotDetectedEvent(); + Status SendEnergyTransferStartedEvent(); + Status SendEnergyTransferStoppedEvent(EnergyTransferStoppedReasonEnum reason); + // ------------------------------------------------------------------ // Get attribute methods StateEnum GetState() override; @@ -204,6 +212,7 @@ class EnergyEvseDelegate : public EnergyEvse::Delegate EVSECallbackWrapper mCallbacks = { .handler = nullptr, .arg = 0 }; /* Wrapper to allow callbacks to be registered */ Status NotifyApplicationCurrentLimitChange(int64_t maximumChargeCurrent); Status NotifyApplicationStateChange(); + Status GetEVSEEnergyMeterValue(ChargingDischargingType meterType, int64_t & aMeterValue); /** * @brief Helper function to work out the charge limit based on conditions and settings @@ -239,7 +248,10 @@ class EnergyEvseDelegate : public EnergyEvse::Delegate DataModel::Nullable mVehicleID; /* Session Object */ - EvseSession mSession; + EvseSession mSession = EvseSession(mEndpointId); + + /* Helper variable to hold meter val since last EnergyTransferStarted event */ + int64_t mMeterValueAtEnergyTransferStart; }; } // namespace EnergyEvse diff --git a/examples/energy-management-app/energy-management-common/src/EVSEManufacturerImpl.cpp b/examples/energy-management-app/energy-management-common/src/EVSEManufacturerImpl.cpp index 8daf1781103831..a49ae50d96a4c0 100644 --- a/examples/energy-management-app/energy-management-common/src/EVSEManufacturerImpl.cpp +++ b/examples/energy-management-app/energy-management-common/src/EVSEManufacturerImpl.cpp @@ -35,7 +35,7 @@ CHIP_ERROR EVSEManufacturer::Init(EnergyEvseManager * aInstance) return CHIP_ERROR_UNINITIALIZED; } - dg->HwRegisterEvseCallbackHandler(ApplicationCallbackHandler, reinterpret_cast(nullptr)); + dg->HwRegisterEvseCallbackHandler(ApplicationCallbackHandler, reinterpret_cast(this)); /* Set the EVSE Hardware Maximum current limit */ // For Manufacturer to specify the hardware capability in mA @@ -78,6 +78,8 @@ CHIP_ERROR EVSEManufacturer::Shutdown(EnergyEvseManager * aInstance) */ void EVSEManufacturer::ApplicationCallbackHandler(const EVSECbInfo * cb, intptr_t arg) { + EVSEManufacturer * pClass = reinterpret_cast(arg); + switch (cb->type) { case EVSECallbackType::StateChanged: @@ -87,7 +89,19 @@ void EVSEManufacturer::ApplicationCallbackHandler(const EVSECbInfo * cb, intptr_ ChipLogProgress(AppServer, "EVSE callback - maxChargeCurrent changed to %ld", static_cast(cb->ChargingCurrent.maximumChargeCurrent)); break; + case EVSECallbackType::EnergyMeterReadingRequested: + ChipLogProgress(AppServer, "EVSE callback - EnergyMeterReadingRequested"); + if (cb->EnergyMeterReadingRequest.meterType == ChargingDischargingType::kCharging) + { + *(cb->EnergyMeterReadingRequest.energyMeterValuePtr) = pClass->mLastChargingEnergyMeter; + } + else + { + *(cb->EnergyMeterReadingRequest.energyMeterValuePtr) = pClass->mLastDischargingEnergyMeter; + } + break; + default: - ChipLogError(AppServer, "Unhandler EVSE Callback type %d", static_cast(cb->type)); + ChipLogError(AppServer, "Unhandled EVSE Callback type %d", static_cast(cb->type)); } } diff --git a/examples/energy-management-app/energy-management-common/src/EnergyEvseDelegateImpl.cpp b/examples/energy-management-app/energy-management-common/src/EnergyEvseDelegateImpl.cpp index 3ea92aa78d6298..d54e936581e264 100644 --- a/examples/energy-management-app/energy-management-common/src/EnergyEvseDelegateImpl.cpp +++ b/examples/energy-management-app/energy-management-common/src/EnergyEvseDelegateImpl.cpp @@ -309,36 +309,95 @@ Status EnergyEvseDelegate::HwSetCableAssemblyLimit(int64_t currentmA) return this->ComputeMaxChargeCurrentLimit(); } +bool IsEvPluggedIn(StateEnum state) +{ + if ((state == StateEnum::kNotPluggedIn) || (state == StateEnum::kFault) || (state == StateEnum::kSessionEnding)) + { + return false; + } + else + { + return true; + } +} + +bool IsEvTransferringEnergy(StateEnum state) +{ + if ((state == StateEnum::kPluggedInCharging) || (state == StateEnum::kPluggedInDischarging)) + { + return true; + } + else + { + return false; + } +} /** * @brief Called by EVSE Hardware to indicate if EV is detected * - * The only allowed states that the EVSE hardware can set are: + * The only allowed states that the EVSE hardware can tell us about are: * kNotPluggedIn * kPluggedInNoDemand * kPluggedInDemand * + * The actual overall state is more complex and includes faults, + * enable & disable charging or discharging etc. + * * @param StateEnum - the state of the EV being plugged in and asking for demand etc */ -Status EnergyEvseDelegate::HwSetState(StateEnum state) +Status EnergyEvseDelegate::HwSetState(StateEnum newState) { - switch (state) + switch (newState) { case StateEnum::kNotPluggedIn: - // TODO - work out logic here - mHwState = state; - break; - case StateEnum::kPluggedInNoDemand: - // TODO - work out logic here - mHwState = state; + if (IsEvPluggedIn(mState)) + { + /* EV was plugged in, but no longer is */ + mSession.RecalculateSessionDuration(); + if (IsEvTransferringEnergy(mState)) + { + /* + * EV was transferring current - unusual to get to this case without + * first having the state set to kPluggedInNoDemand or kPluggedInDemand + */ + mSession.RecalculateSessionDuration(); + SendEnergyTransferStoppedEvent(EnergyTransferStoppedReasonEnum::kOther); + } + + SendEVNotDetectedEvent(); + SetState(newState); + } break; + + case StateEnum::kPluggedInNoDemand: /* deliberate fall-thru */ case StateEnum::kPluggedInDemand: - // TODO - work out logic here - mHwState = state; + if (IsEvPluggedIn(mState)) + { + /* EV was already plugged in before */ + if (IsEvTransferringEnergy(mState)) + { + mSession.RecalculateSessionDuration(); + SendEnergyTransferStoppedEvent(newState == StateEnum::kPluggedInNoDemand + ? EnergyTransferStoppedReasonEnum::kEVStopped + : EnergyTransferStoppedReasonEnum::kEVSEStopped); + } + SetState(newState); + } + else + { + /* EV was not plugged in - start a new session */ + // TODO get energy meter readings + mSession.StartSession(0, 0); + SendEVConnectedEvent(); + + /* If*/ + + SetState(newState); + } break; default: /* All other states should be managed by the Delegate */ - // TODO (assert?) break; } @@ -507,6 +566,153 @@ Status EnergyEvseDelegate::NotifyApplicationStateChange() return Status::Success; } +Status EnergyEvseDelegate::GetEVSEEnergyMeterValue(ChargingDischargingType meterType, int64_t & aMeterValue) +{ + EVSECbInfo cbInfo; + + cbInfo.type = EVSECallbackType::EnergyMeterReadingRequested; + + cbInfo.EnergyMeterReadingRequest.meterType = meterType; + cbInfo.EnergyMeterReadingRequest.energyMeterValuePtr = &aMeterValue; + + if (mCallbacks.handler != nullptr) + { + mCallbacks.handler(&cbInfo, mCallbacks.arg); + } + + return Status::Success; +} + +Status EnergyEvseDelegate::SendEVConnectedEvent() +{ + Events::EVConnected::Type event; + EventNumber eventNumber; + + if (mSession.mSessionID.IsNull()) + { + ChipLogError(AppServer, "SessionID is Null"); + return Status::Failure; + } + + event.sessionID = mSession.mSessionID.Value(); + + CHIP_ERROR err = LogEvent(event, mEndpointId, eventNumber); + if (CHIP_NO_ERROR != err) + { + ChipLogError(AppServer, "Unable to send notify event: %" CHIP_ERROR_FORMAT, err.Format()); + return Status::Failure; + } + return Status::Success; +} + +Status EnergyEvseDelegate::SendEVNotDetectedEvent() +{ + Events::EVNotDetected::Type event; + EventNumber eventNumber; + + if (mSession.mSessionID.IsNull()) + { + ChipLogError(AppServer, "SessionID is Null"); + return Status::Failure; + } + + event.sessionID = mSession.mSessionID.Value(); + event.state = mState; + event.sessionDuration = mSession.mSessionDuration.Value(); + event.sessionEnergyCharged = mSession.mSessionEnergyCharged.Value(); + event.sessionEnergyDischarged = MakeOptional(mSession.mSessionEnergyDischarged.Value()); + + CHIP_ERROR err = LogEvent(event, mEndpointId, eventNumber); + if (CHIP_NO_ERROR != err) + { + ChipLogError(AppServer, "Unable to send notify event: %" CHIP_ERROR_FORMAT, err.Format()); + return Status::Failure; + } + return Status::Success; +} + +Status EnergyEvseDelegate::SendEnergyTransferStartedEvent() +{ + Events::EnergyTransferStarted::Type event; + EventNumber eventNumber; + + if (mSession.mSessionID.IsNull()) + { + ChipLogError(AppServer, "SessionID is Null"); + return Status::Failure; + } + + event.sessionID = mSession.mSessionID.Value(); + event.state = mState; + /** + * A positive value indicates the EV has been enabled for charging and the value is + * taken directly from the MaximumChargeCurrent attribute. + * A negative value indicates that the EV has been enabled for discharging and the value can be taken + * from the MaximumDischargeCurrent attribute with its sign inverted. + */ + + if (mState == StateEnum::kPluggedInCharging) + { + /* Sample the energy meter for charging */ + GetEVSEEnergyMeterValue(ChargingDischargingType::kCharging, mMeterValueAtEnergyTransferStart); + event.maximumCurrent = mMaximumChargeCurrent; + } + else if (mState == StateEnum::kPluggedInDischarging) + { + /* Sample the energy meter for discharging */ + GetEVSEEnergyMeterValue(ChargingDischargingType::kDischarging, mMeterValueAtEnergyTransferStart); + + /* discharging should have a negative current */ + event.maximumCurrent = -mMaximumDischargeCurrent; + } + + CHIP_ERROR err = LogEvent(event, mEndpointId, eventNumber); + if (CHIP_NO_ERROR != err) + { + ChipLogError(AppServer, "Unable to send notify event: %" CHIP_ERROR_FORMAT, err.Format()); + return Status::Failure; + } + + return Status::Success; +} +Status EnergyEvseDelegate::SendEnergyTransferStoppedEvent(EnergyTransferStoppedReasonEnum reason) +{ + Events::EnergyTransferStopped::Type event; + EventNumber eventNumber; + + if (mSession.mSessionID.IsNull()) + { + ChipLogError(AppServer, "SessionID is Null"); + return Status::Failure; + } + + event.sessionID = mSession.mSessionID.Value(); + event.state = mState; + event.reason = reason; + int64_t meterValueNow = 0; + + if (mState == StateEnum::kPluggedInCharging) + { + GetEVSEEnergyMeterValue(ChargingDischargingType::kCharging, meterValueNow); + event.energyTransferred = meterValueNow - mMeterValueAtEnergyTransferStart; + } + else if (mState == StateEnum::kPluggedInDischarging) + { + GetEVSEEnergyMeterValue(ChargingDischargingType::kDischarging, meterValueNow); + + /* discharging should have a negative value */ + event.energyTransferred = mMeterValueAtEnergyTransferStart - meterValueNow; + } + + CHIP_ERROR err = LogEvent(event, mEndpointId, eventNumber); + if (CHIP_NO_ERROR != err) + { + ChipLogError(AppServer, "Unable to send notify event: %" CHIP_ERROR_FORMAT, err.Format()); + return Status::Failure; + } + return Status::Success; +} + /** * Attribute methods */ @@ -908,12 +1114,15 @@ void EvseSession::StartSession(int64_t chargingMeterValue, int64_t dischargingMe mSessionEnergyCharged = MakeNullable(static_cast(0)); mSessionEnergyDischarged = MakeNullable(static_cast(0)); + MatterReportingAttributeChangeCallback(mEndpointId, EnergyEvse::Id, SessionID::Id); + MatterReportingAttributeChangeCallback(mEndpointId, EnergyEvse::Id, SessionDuration::Id); + MatterReportingAttributeChangeCallback(mEndpointId, EnergyEvse::Id, SessionEnergyCharged::Id); + MatterReportingAttributeChangeCallback(mEndpointId, EnergyEvse::Id, SessionEnergyDischarged::Id); + // TODO persist mSessionID // TODO persist mStartTime // TODO persist mSessionEnergyChargedAtStart // TODO persist mSessionEnergyDischargedAtStart - - // TODO call MatterReportingAttributeChangeCallback } /** @@ -931,7 +1140,7 @@ void EvseSession::RecalculateSessionDuration() uint32_t duration = chipEpoch - mStartTime; mSessionDuration = MakeNullable(duration); - // TODO call MatterReportingAttributeChangeCallback + MatterReportingAttributeChangeCallback(mEndpointId, EnergyEvse::Id, SessionDuration::Id); } /** @@ -942,7 +1151,7 @@ void EvseSession::RecalculateSessionDuration() void EvseSession::UpdateEnergyCharged(int64_t chargingMeterValue) { mSessionEnergyCharged = MakeNullable(chargingMeterValue - mSessionEnergyChargedAtStart); - // TODO call MatterReportingAttributeChangeCallback + MatterReportingAttributeChangeCallback(mEndpointId, EnergyEvse::Id, SessionEnergyCharged::Id); } /** @@ -953,5 +1162,5 @@ void EvseSession::UpdateEnergyCharged(int64_t chargingMeterValue) void EvseSession::UpdateEnergyDischarged(int64_t dischargingMeterValue) { mSessionEnergyDischarged = MakeNullable(dischargingMeterValue - mSessionEnergyDischargedAtStart); - // TODO call MatterReportingAttributeChangeCallback + MatterReportingAttributeChangeCallback(mEndpointId, EnergyEvse::Id, SessionEnergyDischarged::Id); } From c7034536d48f8f5db93affe7e5c8b475f9d12ede Mon Sep 17 00:00:00 2001 From: James Harrow Date: Fri, 29 Dec 2023 00:33:20 +0000 Subject: [PATCH 055/114] Added framework for EVSE Test Event triggers --- .../src/EVSEManufacturerImpl.cpp | 35 +++++++++++++++++++ examples/platform/linux/AppMain.cpp | 10 ++++++ examples/platform/linux/BUILD.gn | 9 ++++- src/app/chip_data_model.gni | 7 ++++ 4 files changed, 60 insertions(+), 1 deletion(-) diff --git a/examples/energy-management-app/energy-management-common/src/EVSEManufacturerImpl.cpp b/examples/energy-management-app/energy-management-common/src/EVSEManufacturerImpl.cpp index a49ae50d96a4c0..a8bdb85c35c84d 100644 --- a/examples/energy-management-app/energy-management-common/src/EVSEManufacturerImpl.cpp +++ b/examples/energy-management-app/energy-management-common/src/EVSEManufacturerImpl.cpp @@ -18,7 +18,9 @@ #include #include +#include +using namespace chip; using namespace chip::app; using namespace chip::app::Clusters; using namespace chip::app::Clusters::EnergyEvse; @@ -105,3 +107,36 @@ void EVSEManufacturer::ApplicationCallbackHandler(const EVSECbInfo * cb, intptr_ ChipLogError(AppServer, "Unhandled EVSE Callback type %d", static_cast(cb->type)); } } + +bool HandleEnergyEvseTestEventTrigger(uint64_t eventTrigger) +{ + EnergyEvseTrigger trigger = static_cast(eventTrigger); + + switch (trigger) + { + case EnergyEvseTrigger::kBasicFunctionality: + ChipLogProgress(Support, "[EnergyEVSE-Test-Event] => Basic Functionality install"); + break; + case EnergyEvseTrigger::kBasicFunctionalityClear: + ChipLogProgress(Support, "[EnergyEVSE-Test-Event] => Basic Functionality clear"); + break; + case EnergyEvseTrigger::kEVPluggedIn: + ChipLogProgress(Support, "[EnergyEVSE-Test-Event] => EV plugged in"); + break; + case EnergyEvseTrigger::kEVPluggedInClear: + ChipLogProgress(Support, "[EnergyEVSE-Test-Event] => EV unplugged"); + break; + case EnergyEvseTrigger::kEVChargeDemand: + ChipLogProgress(Support, "[EnergyEVSE-Test-Event] => EV Charge Demand"); + break; + case EnergyEvseTrigger::kEVChargeDemandClear: + ChipLogProgress(Support, "[EnergyEVSE-Test-Event] => EV Charge NoDemand"); + break; + + default: + + return false; + } + + return true; +} \ No newline at end of file diff --git a/examples/platform/linux/AppMain.cpp b/examples/platform/linux/AppMain.cpp index 79e3e08edce718..1d2127aad36dba 100644 --- a/examples/platform/linux/AppMain.cpp +++ b/examples/platform/linux/AppMain.cpp @@ -80,6 +80,9 @@ #if CHIP_DEVICE_CONFIG_ENABLE_SMOKE_CO_TRIGGER #include #endif +#if CHIP_DEVICE_CONFIG_ENABLE_ENERGY_EVSE_TRIGGER +#include +#endif #include #include @@ -552,6 +555,13 @@ void ChipLinuxAppMainLoop(AppMainLoopImplementation * impl) }; otherDelegate = &smokeCOTestEventTriggerDelegate; #endif +#if CHIP_DEVICE_CONFIG_ENABLE_ENERGY_EVSE_TRIGGER + static EnergyEvseTestEventTriggerDelegate energyEvseTestEventTriggerDelegate{ + ByteSpan(LinuxDeviceOptions::GetInstance().testEventTriggerEnableKey), otherDelegate + }; + otherDelegate = &energyEvseTestEventTriggerDelegate; +#endif + // For general testing of TestEventTrigger, we have a common "core" event trigger delegate. static SampleTestEventTriggerDelegate testEventTriggerDelegate; VerifyOrDie(testEventTriggerDelegate.Init(ByteSpan(LinuxDeviceOptions::GetInstance().testEventTriggerEnableKey), diff --git a/examples/platform/linux/BUILD.gn b/examples/platform/linux/BUILD.gn index 46229c5f7ed42c..7c2ea169437b21 100644 --- a/examples/platform/linux/BUILD.gn +++ b/examples/platform/linux/BUILD.gn @@ -21,6 +21,7 @@ import("${chip_root}/src/tracing/tracing_args.gni") declare_args() { chip_enable_smoke_co_trigger = false + chip_enable_energy_evse_trigger = false } config("app-main-config") { @@ -37,6 +38,10 @@ source_set("smco-test-event-trigger") { sources = [ "${chip_root}/src/app/clusters/smoke-co-alarm-server/SmokeCOTestEventTriggerDelegate.h" ] } +source_set("energy-evse-test-event-trigger") { + sources = [ "${chip_root}/src/app/clusters/energy-evse-server/EnergyEvseTestEventTriggerDelegate.h" ] +} + source_set("app-main") { defines = [ "ENABLE_TRACING=${matter_enable_tracing_support}" ] sources = [ @@ -94,7 +99,9 @@ source_set("app-main") { ] } - defines += [ "CHIP_DEVICE_CONFIG_ENABLE_SMOKE_CO_TRIGGER=${chip_enable_smoke_co_trigger}" ] + defines += [ "CHIP_DEVICE_CONFIG_ENABLE_SMOKE_CO_TRIGGER=${chip_enable_smoke_co_trigger}", + "CHIP_DEVICE_CONFIG_ENABLE_ENERGY_EVSE_TRIGGER=${chip_enable_energy_evse_trigger}" ] + public_configs = [ ":app-main-config" ] } diff --git a/src/app/chip_data_model.gni b/src/app/chip_data_model.gni index b882c875dc3ac2..835e1467b57e15 100644 --- a/src/app/chip_data_model.gni +++ b/src/app/chip_data_model.gni @@ -329,6 +329,13 @@ template("chip_data_model") { "${_app_root}/clusters/${cluster}/${cluster}.cpp", "${_app_root}/clusters/${cluster}/${cluster}.h", ] + } else if (cluster == "energy-evse-server") { + sources += [ + "${_app_root}/clusters/${cluster}/${cluster}.cpp", + "${_app_root}/clusters/${cluster}/${cluster}.h", + "${_app_root}/clusters/${cluster}/EnergyEvseTestEventTriggerDelegate.cpp", + "${_app_root}/clusters/${cluster}/EnergyEvseTestEventTriggerDelegate.h", + ] } else { sources += [ "${_app_root}/clusters/${cluster}/${cluster}.cpp" ] } From bfc9bfb5f02309547422b78bb2c436963f40fdc4 Mon Sep 17 00:00:00 2001 From: James Harrow Date: Fri, 29 Dec 2023 00:34:18 +0000 Subject: [PATCH 056/114] Added EnergyEvseTestEventTrigger delegates --- .../EnergyEvseTestEventTriggerDelegate.cpp | 42 ++++++++++++ .../EnergyEvseTestEventTriggerDelegate.h | 66 +++++++++++++++++++ 2 files changed, 108 insertions(+) create mode 100644 src/app/clusters/energy-evse-server/EnergyEvseTestEventTriggerDelegate.cpp create mode 100644 src/app/clusters/energy-evse-server/EnergyEvseTestEventTriggerDelegate.h diff --git a/src/app/clusters/energy-evse-server/EnergyEvseTestEventTriggerDelegate.cpp b/src/app/clusters/energy-evse-server/EnergyEvseTestEventTriggerDelegate.cpp new file mode 100644 index 00000000000000..78fb87085f3b10 --- /dev/null +++ b/src/app/clusters/energy-evse-server/EnergyEvseTestEventTriggerDelegate.cpp @@ -0,0 +1,42 @@ +/* + * + * 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. + */ + +#include "EnergyEvseTestEventTriggerDelegate.h" + +using namespace chip::app::Clusters::EnergyEvse; + +namespace chip { + +bool EnergyEvseTestEventTriggerDelegate::DoesEnableKeyMatch(const ByteSpan & enableKey) const +{ + return !mEnableKey.empty() && mEnableKey.data_equal(enableKey); +} + +CHIP_ERROR EnergyEvseTestEventTriggerDelegate::HandleEventTrigger(uint64_t eventTrigger) +{ + if (HandleEnergyEvseTestEventTrigger(eventTrigger)) + { + return CHIP_NO_ERROR; + } + if (mOtherDelegate != nullptr) + { + return mOtherDelegate->HandleEventTrigger(eventTrigger); + } + return CHIP_ERROR_INVALID_ARGUMENT; +} + +} // namespace chip diff --git a/src/app/clusters/energy-evse-server/EnergyEvseTestEventTriggerDelegate.h b/src/app/clusters/energy-evse-server/EnergyEvseTestEventTriggerDelegate.h new file mode 100644 index 00000000000000..489ca7974eefcb --- /dev/null +++ b/src/app/clusters/energy-evse-server/EnergyEvseTestEventTriggerDelegate.h @@ -0,0 +1,66 @@ +/* + * + * 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. + */ + +#pragma once + +#include +#include + +namespace chip { + +enum class EnergyEvseTrigger : uint64_t +{ + // Scenarios + kBasicFunctionality = 0x0099000000000000, // Basic Functionality Test Event | Simulate installation with + // _{A_CIRCUIT_CAPACITY}_=32A and _{A_USER_MAXIMUM_CHARGE_CURRENT}_=32A + kBasicFunctionalityClear = 0x0099000000000001, // Basic Functionality Test Event Clear | End simulation of installation + kEVPluggedIn = 0x0099000000000002, // EV Plugged-in Test Event | Simulate plugging + // the EV into the EVSE using a cable of 63A capacity + kEVPluggedInClear = 0x0099000000000003, // EV Plugged-in Test Event Clear | Simulate unplugging the EV + kEVChargeDemand = 0x0099000000000004, // EV Charge Demand Test Event | Simulate the EV presenting charge demand to the EVSE + kEVChargeDemandClear = 0x0099000000000005, // EV Charge Demand Test Event Clear | Simulate the EV becoming fully charged + +}; + +class EnergyEvseTestEventTriggerDelegate : public TestEventTriggerDelegate +{ +public: + explicit EnergyEvseTestEventTriggerDelegate(const ByteSpan & enableKey, TestEventTriggerDelegate * otherDelegate) : + mEnableKey(enableKey), mOtherDelegate(otherDelegate) + {} + + bool DoesEnableKeyMatch(const ByteSpan & enableKey) const override; + CHIP_ERROR HandleEventTrigger(uint64_t eventTrigger) override; + +private: + ByteSpan mEnableKey; + TestEventTriggerDelegate * mOtherDelegate; +}; + +} // namespace chip + +/** + * @brief User handler for handling the test event trigger + * + * @note If TestEventTrigger is enabled, it needs to be implemented in the app + * + * @param eventTrigger Event trigger to handle + * + * @retval true on success + * @retval false if error happened + */ +bool HandleEnergyEvseTestEventTrigger(uint64_t eventTrigger); From 590e63f1ed9890d14c61cd106fb332f6c3247f75 Mon Sep 17 00:00:00 2001 From: "Restyled.io" Date: Fri, 29 Dec 2023 01:06:11 +0000 Subject: [PATCH 057/114] Restyled by whitespace --- .../energy-management-common/src/EVSEManufacturerImpl.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/examples/energy-management-app/energy-management-common/src/EVSEManufacturerImpl.cpp b/examples/energy-management-app/energy-management-common/src/EVSEManufacturerImpl.cpp index a8bdb85c35c84d..7b671e2d73e3bf 100644 --- a/examples/energy-management-app/energy-management-common/src/EVSEManufacturerImpl.cpp +++ b/examples/energy-management-app/energy-management-common/src/EVSEManufacturerImpl.cpp @@ -139,4 +139,4 @@ bool HandleEnergyEvseTestEventTrigger(uint64_t eventTrigger) } return true; -} \ No newline at end of file +} From 451428e8ef1605f6da2cf2283cdc1fed69987db3 Mon Sep 17 00:00:00 2001 From: "Restyled.io" Date: Fri, 29 Dec 2023 01:06:14 +0000 Subject: [PATCH 058/114] Restyled by gn --- examples/platform/linux/BUILD.gn | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/examples/platform/linux/BUILD.gn b/examples/platform/linux/BUILD.gn index 7c2ea169437b21..576192ca6cc2f0 100644 --- a/examples/platform/linux/BUILD.gn +++ b/examples/platform/linux/BUILD.gn @@ -99,9 +99,10 @@ source_set("app-main") { ] } - defines += [ "CHIP_DEVICE_CONFIG_ENABLE_SMOKE_CO_TRIGGER=${chip_enable_smoke_co_trigger}", - "CHIP_DEVICE_CONFIG_ENABLE_ENERGY_EVSE_TRIGGER=${chip_enable_energy_evse_trigger}" ] - + defines += [ + "CHIP_DEVICE_CONFIG_ENABLE_SMOKE_CO_TRIGGER=${chip_enable_smoke_co_trigger}", + "CHIP_DEVICE_CONFIG_ENABLE_ENERGY_EVSE_TRIGGER=${chip_enable_energy_evse_trigger}", + ] public_configs = [ ":app-main-config" ] } From 22d25045a50d97aa1c58c99121427f5eb4def81f Mon Sep 17 00:00:00 2001 From: James Harrow Date: Fri, 29 Dec 2023 08:09:40 +0000 Subject: [PATCH 059/114] Added :energy-evse-test-event-trigger to public_deps to see if it resolves build errors --- examples/platform/linux/BUILD.gn | 1 + 1 file changed, 1 insertion(+) diff --git a/examples/platform/linux/BUILD.gn b/examples/platform/linux/BUILD.gn index 576192ca6cc2f0..70605c3a7dee44 100644 --- a/examples/platform/linux/BUILD.gn +++ b/examples/platform/linux/BUILD.gn @@ -65,6 +65,7 @@ source_set("app-main") { public_deps = [ ":smco-test-event-trigger", + ":energy-evse-test-event-trigger", "${chip_root}/src/lib", "${chip_root}/src/platform/logging:force_stdio", ] From 85c68edf4b298e89db4075b84de078a77893ce5c Mon Sep 17 00:00:00 2001 From: "Restyled.io" Date: Fri, 29 Dec 2023 08:10:28 +0000 Subject: [PATCH 060/114] Restyled by gn --- examples/platform/linux/BUILD.gn | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/examples/platform/linux/BUILD.gn b/examples/platform/linux/BUILD.gn index 70605c3a7dee44..c926a9998e8207 100644 --- a/examples/platform/linux/BUILD.gn +++ b/examples/platform/linux/BUILD.gn @@ -64,8 +64,8 @@ source_set("app-main") { ] public_deps = [ - ":smco-test-event-trigger", ":energy-evse-test-event-trigger", + ":smco-test-event-trigger", "${chip_root}/src/lib", "${chip_root}/src/platform/logging:force_stdio", ] From a897decdbf4a8e55ee4d12991cabe7c30b7c34ff Mon Sep 17 00:00:00 2001 From: James Harrow Date: Sat, 30 Dec 2023 13:13:09 +0000 Subject: [PATCH 061/114] Fixed Darwin compile error - do not use else after return --- .../src/EnergyEvseDelegateImpl.cpp | 10 ++-------- 1 file changed, 2 insertions(+), 8 deletions(-) diff --git a/examples/energy-management-app/energy-management-common/src/EnergyEvseDelegateImpl.cpp b/examples/energy-management-app/energy-management-common/src/EnergyEvseDelegateImpl.cpp index d54e936581e264..431886b83a64f2 100644 --- a/examples/energy-management-app/energy-management-common/src/EnergyEvseDelegateImpl.cpp +++ b/examples/energy-management-app/energy-management-common/src/EnergyEvseDelegateImpl.cpp @@ -315,10 +315,7 @@ bool IsEvPluggedIn(StateEnum state) { return false; } - else - { - return true; - } + return true; } bool IsEvTransferringEnergy(StateEnum state) @@ -327,10 +324,7 @@ bool IsEvTransferringEnergy(StateEnum state) { return true; } - else - { - return false; - } + return false; } /** * @brief Called by EVSE Hardware to indicate if EV is detected From 9ccf8e557e08e85eec0fd7aaac86c535c50f7947 Mon Sep 17 00:00:00 2001 From: James Harrow Date: Sun, 31 Dec 2023 23:35:46 +0000 Subject: [PATCH 062/114] Refactored code so that the EvseManufacturer instance could be retrieved for Test Event triggers --- .../include/EVSEManufacturerImpl.h | 17 ++++- .../src/EVSEManufacturerImpl.cpp | 70 ++++++++++++++----- examples/energy-management-app/linux/main.cpp | 11 ++- 3 files changed, 74 insertions(+), 24 deletions(-) diff --git a/examples/energy-management-app/energy-management-common/include/EVSEManufacturerImpl.h b/examples/energy-management-app/energy-management-common/include/EVSEManufacturerImpl.h index 4bb7cfb1dcafbf..01f46a9d717e19 100644 --- a/examples/energy-management-app/energy-management-common/include/EVSEManufacturerImpl.h +++ b/examples/energy-management-app/energy-management-common/include/EVSEManufacturerImpl.h @@ -33,15 +33,26 @@ namespace EnergyEvse { class EVSEManufacturer { public: + EVSEManufacturer(EnergyEvseManager * aInstance) { mInstance = aInstance; } + EnergyEvseManager * GetInstance() { return mInstance; } + EnergyEvseDelegate * GetDelegate() + { + if (mInstance) + { + return mInstance->GetDelegate(); + } + return nullptr; + } + /** * @brief Called at start up to apply hardware settings */ - CHIP_ERROR Init(EnergyEvseManager * aInstance); + CHIP_ERROR Init(); /** * @brief Called at shutdown */ - CHIP_ERROR Shutdown(EnergyEvseManager * aInstance); + CHIP_ERROR Shutdown(); /** * @brief Main Callback handler from delegate to user code @@ -49,6 +60,8 @@ class EVSEManufacturer static void ApplicationCallbackHandler(const EVSECbInfo * cb, intptr_t arg); private: + EnergyEvseManager * mInstance; + int64_t mLastChargingEnergyMeter = 0; int64_t mLastDischargingEnergyMeter = 0; }; diff --git a/examples/energy-management-app/energy-management-common/src/EVSEManufacturerImpl.cpp b/examples/energy-management-app/energy-management-common/src/EVSEManufacturerImpl.cpp index 7b671e2d73e3bf..682d1b07d77f2c 100644 --- a/examples/energy-management-app/energy-management-common/src/EVSEManufacturerImpl.cpp +++ b/examples/energy-management-app/energy-management-common/src/EVSEManufacturerImpl.cpp @@ -25,12 +25,15 @@ using namespace chip::app; using namespace chip::app::Clusters; using namespace chip::app::Clusters::EnergyEvse; -CHIP_ERROR EVSEManufacturer::Init(EnergyEvseManager * aInstance) +/* Function prototype - this should be implemented somewhere in main.cpp or similar */ +EVSEManufacturer * GetEvseManufacturer(); + +CHIP_ERROR EVSEManufacturer::Init() { /* Manufacturers should modify this to do any custom initialisation */ /* Register callbacks */ - EnergyEvseDelegate * dg = aInstance->GetDelegate(); + EnergyEvseDelegate * dg = GetEvseManufacturer()->GetDelegate(); if (dg == nullptr) { ChipLogError(AppServer, "Delegate is not initialized"); @@ -39,34 +42,28 @@ CHIP_ERROR EVSEManufacturer::Init(EnergyEvseManager * aInstance) dg->HwRegisterEvseCallbackHandler(ApplicationCallbackHandler, reinterpret_cast(this)); - /* Set the EVSE Hardware Maximum current limit */ // For Manufacturer to specify the hardware capability in mA - dg->HwSetMaxHardwareCurrentLimit(32000); + // dg->HwSetMaxHardwareCurrentLimit(32000); // For Manufacturer to specify the CircuitCapacity (e.g. from DIP switches) - dg->HwSetCircuitCapacity(20000); - - /* For now let's pretend the EV is plugged in, and asking for demand */ - dg->HwSetState(StateEnum::kPluggedInDemand); - dg->HwSetCableAssemblyLimit(63000); + // dg->HwSetCircuitCapacity(20000); - /* For now let's pretend the vehicle ID is set */ - dg->HwSetVehicleID(CharSpan::fromCharString("TEST_VEHICLE_123456789")); - dg->HwSetVehicleID(CharSpan::fromCharString("TEST_VEHICLE_9876543210")); + // For now let's pretend the EV is plugged in, and asking for demand + // dg->HwSetState(StateEnum::kPluggedInDemand); + // dg->HwSetCableAssemblyLimit(63000); - /* This next one will fail because it is too long */ - dg->HwSetVehicleID(CharSpan::fromCharString("TEST_VEHICLE_9876543210TOOOOOOOOOOOOOOOOOOO")); + // For now let's pretend the vehicle ID is set + // dg->HwSetVehicleID(CharSpan::fromCharString("TEST_VEHICLE_123456789")); - /* For now let's pretend the RFID sensor was triggered - send an event */ - uint8_t uid[10] = { 0x01, 0x23, 0x45, 0x67, 0x89, 0xAA, 0xBB, 0xCC, 0xDD, 0xEE }; - dg->HwSetRFID(ByteSpan(uid)); + // For now let's pretend the RFID sensor was triggered - send an event + // uint8_t uid[10] = { 0x01, 0x23, 0x45, 0x67, 0x89, 0xAA, 0xBB, 0xCC, 0xDD, 0xEE }; + // dg->HwSetRFID(ByteSpan(uid)); return CHIP_NO_ERROR; } -CHIP_ERROR EVSEManufacturer::Shutdown(EnergyEvseManager * aInstance) +CHIP_ERROR EVSEManufacturer::Shutdown() { - return CHIP_NO_ERROR; } @@ -108,6 +105,35 @@ void EVSEManufacturer::ApplicationCallbackHandler(const EVSECbInfo * cb, intptr_ } } +void SetTestEventTrigger_BasicFunctionality() +{ + EnergyEvseDelegate * dg = GetEvseManufacturer()->GetDelegate(); + + // TODO save the values so we can restore them in the clear event + dg->HwSetCircuitCapacity(32000); + dg->SetUserMaximumChargeCurrent(32000); + dg->HwSetState(StateEnum::kNotPluggedIn); +} +void SetTestEventTrigger_BasicFunctionalityClear() {} + +void SetTestEventTrigger_EVPluggedIn() +{ + EnergyEvseDelegate * dg = GetEvseManufacturer()->GetDelegate(); + + // TODO save the values so we can restore them in the clear event + dg->HwSetState(StateEnum::kPluggedInNoDemand); +} +void SetTestEventTrigger_EVPluggedInClear() {} + +void SetTestEventTrigger_EVChargeDemand() +{ + EnergyEvseDelegate * dg = GetEvseManufacturer()->GetDelegate(); + + // TODO save the values so we can restore them in the clear event + dg->HwSetState(StateEnum::kPluggedInDemand); +} +void SetTestEventTrigger_EVChargeDemandClear() {} + bool HandleEnergyEvseTestEventTrigger(uint64_t eventTrigger) { EnergyEvseTrigger trigger = static_cast(eventTrigger); @@ -116,21 +142,27 @@ bool HandleEnergyEvseTestEventTrigger(uint64_t eventTrigger) { case EnergyEvseTrigger::kBasicFunctionality: ChipLogProgress(Support, "[EnergyEVSE-Test-Event] => Basic Functionality install"); + SetTestEventTrigger_BasicFunctionality(); break; case EnergyEvseTrigger::kBasicFunctionalityClear: ChipLogProgress(Support, "[EnergyEVSE-Test-Event] => Basic Functionality clear"); + SetTestEventTrigger_BasicFunctionalityClear(); break; case EnergyEvseTrigger::kEVPluggedIn: ChipLogProgress(Support, "[EnergyEVSE-Test-Event] => EV plugged in"); + SetTestEventTrigger_EVPluggedIn(); break; case EnergyEvseTrigger::kEVPluggedInClear: ChipLogProgress(Support, "[EnergyEVSE-Test-Event] => EV unplugged"); + SetTestEventTrigger_EVPluggedInClear(); break; case EnergyEvseTrigger::kEVChargeDemand: ChipLogProgress(Support, "[EnergyEVSE-Test-Event] => EV Charge Demand"); + SetTestEventTrigger_EVChargeDemand(); break; case EnergyEvseTrigger::kEVChargeDemandClear: ChipLogProgress(Support, "[EnergyEVSE-Test-Event] => EV Charge NoDemand"); + SetTestEventTrigger_EVChargeDemandClear(); break; default: diff --git a/examples/energy-management-app/linux/main.cpp b/examples/energy-management-app/linux/main.cpp index dddc6f53d76b20..83cdecbe83db15 100644 --- a/examples/energy-management-app/linux/main.cpp +++ b/examples/energy-management-app/linux/main.cpp @@ -39,6 +39,11 @@ static EnergyEvseDelegate * gDelegate = nullptr; static EnergyEvseManager * gInstance = nullptr; static EVSEManufacturer * gEvseManufacturer = nullptr; +EVSEManufacturer * GetEvseManufacturer() +{ + return gEvseManufacturer; +} + void ApplicationInit() { CHIP_ERROR err; @@ -87,7 +92,7 @@ void ApplicationInit() } /* Now create EVSEManufacturer*/ - gEvseManufacturer = new EVSEManufacturer(); + gEvseManufacturer = new EVSEManufacturer(gInstance); if (gEvseManufacturer == nullptr) { ChipLogError(AppServer, "Failed to allocate memory for EvseManufacturer"); @@ -99,7 +104,7 @@ void ApplicationInit() } /* Call Manufacturer specific init */ - err = gEvseManufacturer->Init(gInstance); + err = gEvseManufacturer->Init(); if (err != CHIP_NO_ERROR) { ChipLogError(AppServer, "Init failed on gEvseManufacturer"); @@ -118,7 +123,7 @@ void ApplicationShutdown() ChipLogDetail(AppServer, "Energy Management App: ApplicationShutdown()"); /* Shutdown the EVSEManufacturer*/ - gEvseManufacturer->Shutdown(gInstance); + gEvseManufacturer->Shutdown(); /* Shutdown the Instance - deregister attribute & command handler */ gInstance->Shutdown(); From 57cde7a5ef0ef9d28407cba40959e28d5ba8081b Mon Sep 17 00:00:00 2001 From: James Harrow Date: Sun, 31 Dec 2023 23:36:30 +0000 Subject: [PATCH 063/114] Started adding TC_EEVSE_2_2.py --- src/python_testing/TC_EEVSE_2_2.py | 253 +++++++++++++++++++++++++++++ 1 file changed, 253 insertions(+) create mode 100644 src/python_testing/TC_EEVSE_2_2.py diff --git a/src/python_testing/TC_EEVSE_2_2.py b/src/python_testing/TC_EEVSE_2_2.py new file mode 100644 index 00000000000000..bca70f873cc7bf --- /dev/null +++ b/src/python_testing/TC_EEVSE_2_2.py @@ -0,0 +1,253 @@ +# +# Copyright (c) 2023 Project CHIP Authors +# All rights reserved. +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +import datetime +import logging +import time + +import chip.clusters as Clusters +import pytz +from chip.interaction_model import InteractionModelError, Status +from matter_testing_support import MatterBaseTest, async_test_body, default_matter_test_main, TestStep +from mobly import asserts + +logger = logging.getLogger(__name__) + + +class TC_EEVSE_2_2(MatterBaseTest): + async def read_evse_attribute_expect_success(self, endpoint, attribute): + full_attr = getattr(Clusters.EnergyEvse.Attributes, attribute) + cluster = Clusters.Objects.EnergyEvse + return await self.read_single_attribute_check_success(endpoint=endpoint, cluster=cluster, attribute=full_attr) + + async def write_user_max_charge(self, endpoint, user_max_charge): + result = await self.default_controller.WriteAttribute(self.dut_node_id, + [(endpoint, + Clusters.EnergyEvse.Attributes.UserMaximumChargeCurrent(user_max_charge))]) + asserts.assert_equal(result[0].Status, Status.Success, "UserMaximumChargeCurrent write failed") + + async def send_enable_charge_command(self, endpoint: int = 0, charge_until: int = None, timedRequestTimeoutMs: int = 60000, + min_charge: int = None, max_charge: int = None, expected_status: Status = Status.Success): + try: + await self.send_single_cmd(cmd=Clusters.EnergyEvse.Commands.EnableCharging( + chargingEnabledUntil=charge_until, + minimumChargeCurrent=6000, + maximumChargeCurrent=60000), + endpoint=1, + timedRequestTimeoutMs=timedRequestTimeoutMs) + + except InteractionModelError as e: + asserts.assert_equal(e.status, expected_status, "Unexpected error returned") + + async def send_disable_command(self, endpoint: int = 0, expected_status: Status = Status.Success): + try: + await self.send_single_cmd(cmd=Clusters.EnergyEvse.Commands.Disable(), endpoint=1) + + except InteractionModelError as e: + asserts.assert_equal(e.status, expected_status, "Unexpected error returned") + + def desc_TC_EEVSE_2_2(self) -> str: + """Returns a description of this test""" + return "5.1.3. [TC-EEVSE-2.2] Primary functionality with DUT as Server" + + def pics_TC_EEVSE_2_2(self): + """ This function returns a list of PICS for this test case that must be True for the test to be run""" + # In this case - there is no feature flags needed to run this test case + return None + + def steps_TC_EEVSE_2_2(self) -> list[TestStep]: + steps = [ + TestStep("1", "Commissioning, already done", is_commissioning=True), + TestStep("2", "TH reads TestEventTriggersEnabled attribute from General Diagnostics Cluster. Verify that TestEventTriggersEnabled attribute has a value of 1 (True)"), + TestStep("3", "TH sends TestEventTrigger command to General Diagnostics Cluster on Endpoint 0 with EnableKey field set to PIXIT.EEVSE.TEST_EVENT_TRIGGER_KEY and EventTrigger field set to PIXIT.EEVSE.TEST_EVENT_TRIGGER for Basic Functionality Test Event"), + TestStep("3a", "After a few seconds TH reads from the DUT the State attribute. Verify value is 0x00 (NotPluggedIn)"), + ] + + return steps + + async def send_test_event_triggers(self, enableKey=bytes([b for b in range(16)]), eventTrigger=0x0099000000000000): + try: + await self.send_single_cmd(endpoint=0, + cmd=Clusters.GeneralDiagnostics.Commands.TestEventTrigger( + enableKey, + eventTrigger) + ) + + except InteractionModelError as e: + asserts.fail(f"Unexpected error returned - {e.status}") + + # TC_EEVSE_2_2 tests steps + async def steps_2_check_test_event_triggers_enabled(self): + full_attr = Clusters.GeneralDiagnostics.Attributes.TestEventTriggersEnabled + cluster = Clusters.Objects.GeneralDiagnostics + test_event_enabled = await self.read_single_attribute_check_success(endpoint=0, cluster=cluster, attribute=full_attr) + asserts.assert_equal(test_event_enabled, True, "TestEventTriggersEnabled is False") + + async def steps_3_send_test_event_triggers(self): + await self.send_test_event_triggers(eventTrigger=0x0099000000000000) + + @async_test_body + async def test_TC_EEVSE_2_2(self): + print_steps = True + + # Part 1 + self.step("1") + + # Part 2 + self.step("2") + await self.steps_2_check_test_event_triggers_enabled() + + # Part 3 + self.step("3") + await self.steps_3_send_test_event_triggers() + self.step("3a") + state = await self.read_evse_attribute_expect_success(endpoint=1, attribute="State") + asserts.assert_equal(state, Clusters.EnergyEvse.Enums.StateEnum.kNotPluggedIn, + f"Unexpected State value - expected kNotPluggedIn (0), was {state}") + self.step("3b") + self.step("3c") + self.step("3d") + self.print_step("3b", "TH reads from the DUT the SupplyState attribute. Verify value is 0x00 (Disabled)") + self.print_step("3c", "TH reads from the DUT the FaultState attribute. Verify value is 0x00 (NoError)") + self.print_step("3d", "TH reads from the DUT the SessionID attribute") + + # Part 4 + self.print_step("4", "TH sends TestEventTrigger command to General Diagnostics Cluster on Endpoint 0 with EnableKey field set to PIXIT.EEVSE.TEST_EVENT_TRIGGER_KEY and EventTrigger field set to PIXIT.EEVSE.TEST_EVENT_TRIGGER for EV Plugged-in Test Event") + self.print_step("4", "Verify Event EEVSE.S.E00(EVConnected) sent") + + self.print_step("4a", "TH reads from the DUT the State attribute. Verify value is 0x01 (PluggedInNoDemand)") + + # Part 5 + self.print_step( + "5", "TH sends command EnableCharging with ChargingEnabledUntil=2 minutes in the future, minimumChargeCurrent=6000, maximumChargeCurrent=60000") + # get epoch time for ChargeUntil variable (2 minutes from now) + utc_time_2_mins = datetime.datetime.now(pytz.utc) + datetime.timedelta(minutes=2) + epoch_time = (utc_time_2_mins - datetime.datetime(2000, 1, 1, tzinfo=pytz.utc)).total_seconds() + await self.send_enable_charge_command(endpoint=1, charge_until=epoch_time, min_charge=6000, max_charge=60000) + + # Part 6 + self.print_step("6", "TH sends TestEventTrigger command to General Diagnostics Cluster on Endpoint 0 with EnableKey field set to PIXIT.EEVSE.TEST_EVENT_TRIGGER_KEY and EventTrigger field set to PIXIT.EEVSE.TEST_EVENT_TRIGGER for EV Charge Demand Test Event") + self.print_step("6", "Verify Event EEVSE.S.E02(EnergyTransferStarted) sent") + + self.print_step('6a', 'TH reads from the DUT the State attribute. Verify it is 3 (PluggedinCharging)') + current_state = await self.read_evse_attribute_expect_success(endpoint=1, attribute='State') + asserts.assert_equal(current_state, 3, f'State should be 3, but is actually {current_state}') + + self.print_step('6b', 'TH reads from the DUT the SupplyState attribute. Verify it is 1 (ChargingEnabled)') + current_supply_state = await self.read_evse_attribute_expect_success(endpoint=1, attribute='SupplyState') + asserts.assert_equal(current_supply_state, 1, f'SupplyState should be 1, but is actually {current_supply_state}') + + self.print_step('6c', f'TH reads from the DUT the ChargingEnabledUntil attribute. Verify it is the {epoch_time}') + charge_until_time = await self.read_evse_attribute_expect_success(endpoint=1, attribute='ChargingEnabledUntil') + asserts.assert_equal(charge_until_time, epoch_time, + f'ChargingEnabledUntil should be {epoch_time}, but is actually {charge_until_time}') + + self.print_step('6d', 'TH reads from the DUT the MinimumChargeCurrent attribute. Verify it is the commanded value (6000)') + minimum_charge_value = await self.read_evse_attribute_expect_success(endpoint=1, attribute='MinimumChargeCurrent') + asserts.assert_equal(minimum_charge_value, 6000, + f'MinimumChargeValue should be 6000, but is actually {minimum_charge_value}') + + self.print_step( + '6e', 'TH reads from the DUT the MaximumChargeCurrent attribute. Verify it is the MIN(command value (60000), CircuitCapacity)') + maximum_charge_value = await self.read_evse_attribute_expect_success(endpoint=1, attribute='MinimumChargeCurrent') + circuit_capacity = await self.read_evse_attribute_expect_success(endpoint=1, attribute='CircuitCapacity') + expected_max_charge = min(6000, circuit_capacity) + asserts.assert_equal(maximum_charge_value, expected_max_charge, + f'MaximumChargeValue should be {expected_max_charge}, but is actually {maximum_charge_value}') + + # Part 7 + self.print_step(7, 'Wait for 2 minutes') + time.sleep(120) + + self.print_step('7a', 'TH reads from the DUT the State attribute. Verify it is 2 (PluggedinDemand)') + current_state = await self.read_evse_attribute_expect_success(endpoint=1, attribute='State') + asserts.assert_equal(current_state, 2, f'State should be 2, but is actually {current_state}') + + self.print_step('7b', 'TH reads from the DUT the SupplyState attribute. Verify it is 0 (Disabled)') + current_supply_state = await self.read_evse_attribute_expect_success(endpoint=1, attribute='SupplyState') + asserts.assert_equal(current_supply_state, 0, f'SupplyState should be 0, but is actually {current_supply_state}') + + # Part 8 + self.print_step( + 8, 'TH sends command EnableCharging with ChargingEnabledUntil=NULL, minimumChargeCurrent = 6000, maximumChargeCurrent=12000') + await self.send_enable_charge_command(endpoint=1, charge_until=epoch_time, min_charge=6000, max_charge=12000) + + self.print_step('8a', 'TH reads from the DUT the State attribute. Verify it is 3 (PluggedinCharging)') + current_state = await self.read_evse_attribute_expect_success(endpoint=1, attribute='State') + asserts.assert_equal(current_state, 3, f'State should be 3, but is actually {current_state}') + + self.print_step('8b', 'TH reads from the DUT the SupplyState attribute. Verify it is 1 (ChargingEnabled)') + current_supply_state = await self.read_evse_attribute_expect_success(endpoint=1, attribute='SupplyState') + asserts.assert_equal(current_supply_state, 1, f'SupplyState should be 1, but is actually {current_supply_state}') + + self.print_step('8c', f'TH reads from the DUT the ChargingEnabledUntil attribute. Verify it is the {epoch_time}') + charge_until_time = await self.read_evse_attribute_expect_success(endpoint=1, attribute='ChargingEnabledUntil') + asserts.assert_equal(charge_until_time, epoch_time, + f'ChargingEnabledUntil should be {epoch_time}, but is actually {charge_until_time}') + + self.print_step('8d', 'TH reads from the DUT the MinimumChargeCurrent attribute. Verify it is the commanded value (6000)') + minimum_charge_value = await self.read_evse_attribute_expect_success(endpoint=1, attribute='MinimumChargeCurrent') + asserts.assert_equal(minimum_charge_value, 6000, + f'MinimumChargeValue should be 6000, but is actually {minimum_charge_value}') + + self.print_step( + '8e', 'TH reads from the DUT the MaximumChargeCurrent attribute. Verify it is the MIN(command value (60000), CircuitCapacity)') + maximum_charge_value = await self.read_evse_attribute_expect_success(endpoint=1, attribute='MaximumChargeCurrent') + circuit_capacity = await self.read_evse_attribute_expect_success(endpoint=1, attribute='CircuitCapacity') + expected_max_charge = min(12000, circuit_capacity) + asserts.assert_equal(maximum_charge_value, expected_max_charge, + f'MaximumChargeValue should be {expected_max_charge}, but is actually {maximum_charge_value}') + + # Part 9 + # This may not work as the optional attribute may not be currently supported. + self.print_step(9, 'If the optional attribute is supported TH writes to the DUT UserMaximumChargeCurrent=6000') + self.write_user_max_charge(1, user_max_charge=6000) + + self.print_step('9a', 'After a few seconds TH reads from the DUT the MaximumChargeCurrent') + time.sleep(3) + maximum_charge_value = await self.read_evse_attribute_expect_success(endpoint=1, attribute='MaximumChargeCurrent') + circuit_capacity = await self.read_evse_attribute_expect_success(endpoint=1, attribute='CircuitCapacity') + expected_max_charge = min(maximum_charge_value, circuit_capacity) + asserts.assert_equal(maximum_charge_value, expected_max_charge, + f'MaximumChargeValue should be {expected_max_charge}, but is actually {maximum_charge_value}') + + # Part 10 - TODO Requires Test Event Triggers + + # Part 11 - TODO Requires Test Event Triggers + + # Part 12 - TODO Requires Test Event Triggers + + # Part 13 + self.print_step(13, 'TH sends a Disable command') + await self.send_disable_command(endpoint=1) + + self.print_step('13a', 'TH reads from the DUT the State attribute. Verify it is 2 (PluggedinDemand)') + current_state = await self.read_evse_attribute_expect_success(endpoint=1, attribute='State') + asserts.assert_equal(current_state, 2, f'State should be 2, but is actually {current_state}') + + self.print_step('13b', 'TH reads from the DUT the SupplyState attribute. Verify it is 0 (Disabled)') + current_supply_state = await self.read_evse_attribute_expect_success(endpoint=1, attribute='SupplyState') + asserts.assert_equal(current_supply_state, 0, f'SupplyState should be 0, but is actually {current_supply_state}') + + # Part 14 - TODO Requires Test Event Triggers + + # Part 15 - TODO Requires Test Event Triggers + + # Part 16 - TODO Requires Test Event Triggers + + +if __name__ == "__main__": + default_matter_test_main() From b775fedc73381e25586c99729b5f68b8e0741f80 Mon Sep 17 00:00:00 2001 From: James Harrow Date: Mon, 1 Jan 2024 22:09:43 +0000 Subject: [PATCH 064/114] Updated TC_EEVSE_2_2.py to support test events. Still needs to handle reading of Logged Events and verifying they are correct. --- src/python_testing/TC_EEVSE_2_2.py | 346 ++++++++++++++++++----------- 1 file changed, 220 insertions(+), 126 deletions(-) diff --git a/src/python_testing/TC_EEVSE_2_2.py b/src/python_testing/TC_EEVSE_2_2.py index bca70f873cc7bf..d7968f8e6989e5 100644 --- a/src/python_testing/TC_EEVSE_2_2.py +++ b/src/python_testing/TC_EEVSE_2_2.py @@ -33,6 +33,14 @@ async def read_evse_attribute_expect_success(self, endpoint, attribute): cluster = Clusters.Objects.EnergyEvse return await self.read_single_attribute_check_success(endpoint=endpoint, cluster=cluster, attribute=full_attr) + async def check_evse_attribute(self, attribute, expected_value): + value = await self.read_evse_attribute_expect_success(endpoint=1, attribute=attribute) + asserts.assert_equal(value, expected_value, + f"Unexpected '{attribute}' value - expected {expected_value}, was {value}") + + async def get_supported_energy_evse_attributes(self, endpoint): + return await self.read_evse_attribute_expect_success(endpoint, "AttributeList") + async def write_user_max_charge(self, endpoint, user_max_charge): result = await self.default_controller.WriteAttribute(self.dut_node_id, [(endpoint, @@ -74,6 +82,48 @@ def steps_TC_EEVSE_2_2(self) -> list[TestStep]: TestStep("2", "TH reads TestEventTriggersEnabled attribute from General Diagnostics Cluster. Verify that TestEventTriggersEnabled attribute has a value of 1 (True)"), TestStep("3", "TH sends TestEventTrigger command to General Diagnostics Cluster on Endpoint 0 with EnableKey field set to PIXIT.EEVSE.TEST_EVENT_TRIGGER_KEY and EventTrigger field set to PIXIT.EEVSE.TEST_EVENT_TRIGGER for Basic Functionality Test Event"), TestStep("3a", "After a few seconds TH reads from the DUT the State attribute. Verify value is 0x00 (NotPluggedIn)"), + TestStep("3b", "TH reads from the DUT the SupplyState attribute. Verify value is 0x00 (Disabled)"), + TestStep("3c", "TH reads from the DUT the FaultState attribute. Verify value is 0x00 (NoError)"), + TestStep("3d", "TH reads from the DUT the SessionID attribute"), + TestStep("4", "TH sends TestEventTrigger command to General Diagnostics Cluster on Endpoint 0 with EnableKey field set to PIXIT.EEVSE.TEST_EVENT_TRIGGER_KEY and EventTrigger field set to PIXIT.EEVSE.TEST_EVENT_TRIGGER for EV Plugged-in Test Event. Verify Event EEVSE.S.E00(EVConnected) sent"), + TestStep("4a", "TH reads from the DUT the State attribute. Verify value is 0x01 (PluggedInNoDemand)"), + TestStep("5", "TH sends command EnableCharging with ChargingEnabledUntil=2 minutes in the future, minimumChargeCurrent=6000, maximumChargeCurrent=60000"), + TestStep("6", "TH sends TestEventTrigger command to General Diagnostics Cluster on Endpoint 0 with EnableKey field set to PIXIT.EEVSE.TEST_EVENT_TRIGGER_KEY and EventTrigger field set to PIXIT.EEVSE.TEST_EVENT_TRIGGER for EV Charge Demand Test Event. Verify Event EEVSE.S.E02(EnergyTransferStarted) sent."), + TestStep("6a", "TH reads from the DUT the State attribute. Verify value is 0x3 (PluggedInCharging)"), + TestStep("6b", "TH reads from the DUT the SupplyState attribute. Verify value is 0x1 (ChargingEnabled)"), + TestStep("6c", "TH reads from the DUT the ChargingEnabledUntil attribute. Verify value is the commanded value"), + TestStep("6d", "TH reads from the DUT the MinimumChargeCurrent attribute. Verify value is the commanded value (6000)"), + TestStep("6e", "TH reads from the DUT the MaximumChargeCurrent attribute. Verify value is the min(command value (60000), CircuitCapacity)"), + TestStep("7", "Wait 2 minutes. Verify Event EEVSE.S.E03(EnergyTransferStopped) sent with reason EvseStopped"), + TestStep("7a", "TH reads from the DUT the State attribute. Verify value is 0x02 (PluggedInDemand)"), + TestStep("7b", "TH reads from the DUT the SupplyState attribute. Verify value is 0x00 (Disabled)"), + TestStep("8", "TH sends command EnableCharging with ChargingEnabledUntil=NULL, minimumChargeCurrent = 6000, maximumChargeCurrent=12000"), + TestStep("8a", "TH reads from the DUT the State attribute. Verify value is 0x03 (PluggedInCharging)"), + TestStep("8b", "TH reads from the DUT the SupplyState attribute. Verify value is 1 (ChargingEnabled)"), + TestStep("8c", "TH reads from the DUT the ChargingEnabledUntil attribute. Verify value is the commanded value (NULL)"), + TestStep("8d", "TH reads from the DUT the MinimumChargeCurrent attribute. Verify value is the commanded value (6000)"), + TestStep("8d", "TH reads from the DUT the MaximumChargeCurrent attribute. Verify value is the MIN(command value (60000), CircuitCapacity)"), + TestStep("9", "If the optional attribute is supported TH writes to the DUT UserMaximumChargeCurrent=6000"), + TestStep("9a", "After a few seconds TH reads from the DUT the MaximumChargeCurrent. Verify value is UserMaximumChargeCurrent value (6000)"), + TestStep("10", "TH sends TestEventTrigger command to General Diagnostics Cluster on Endpoint 0 with EnableKey field set to PIXIT.EEVSE.TEST_EVENT_TRIGGER_KEY and EventTrigger field set to PIXIT.EEVSE.TEST_EVENT_TRIGGER for EV Charge Demand Test Event Clear. Verify Event EEVSE.S.E03(EnergyTransferStopped) sent with reason EvStopped"), + TestStep("10a", "TH reads from the DUT the State attribute. Verify value is 0x02 (PluggedInDemand)"), + TestStep("11", "TH sends TestEventTrigger command to General Diagnostics Cluster on Endpoint 0 with EnableKey field set to PIXIT.EEVSE.TEST_EVENT_TRIGGER_KEY and EventTrigger field set to PIXIT.EEVSE.TEST_EVENT_TRIGGER for EV Charge Demand Test Event. Verify Event EEVSE.S.E02(EnergyTransferStarted) sent."), + TestStep("11a", "TH reads from the DUT the State attribute. Verify value is 0x02 (PluggedInDemand)"), + TestStep("12", "TH sends TestEventTrigger command to General Diagnostics Cluster on Endpoint 0 with EnableKey field set to PIXIT.EEVSE.TEST_EVENT_TRIGGER_KEY and EventTrigger field set to PIXIT.EEVSE.TEST_EVENT_TRIGGER for EV Charge Demand Test Event Clear. Verify Event EEVSE.S.E03(EnergyTransferStopped) sent with reason EvStopped"), + TestStep("12a", "TH reads from the DUT the State attribute. Verify value is 0x02 (PluggedInDemand)"), + TestStep("13", "TH sends TestEventTrigger command to General Diagnostics Cluster on Endpoint 0 with EnableKey field set to PIXIT.EEVSE.TEST_EVENT_TRIGGER_KEY and EventTrigger field set to PIXIT.EEVSE.TEST_EVENT_TRIGGER for EV Plugged-in Test Event Clear. Verify Event EEVSE.S.E01(EVNotDetected) sent"), + TestStep("13a", "TH reads from the DUT the State attribute. Verify value is 0x00 (NotPluggedIn)"), + TestStep("13b", "TH reads from the DUT the SupplyState attribute. Verify value is 0x01 (ChargingEnabled)"), + TestStep("13c", "TH reads from the DUT the SessionID attribute. Verify value is the same value noted in 5c"), + TestStep("13d", "TH reads from the DUT the SessionDuration attribute. Verify value is greater than 120 (and match the time taken for the tests from step 4 to step 13)"), + TestStep("14", "TH sends TestEventTrigger command to General Diagnostics Cluster on Endpoint 0 with EnableKey field set to PIXIT.EEVSE.TEST_EVENT_TRIGGER_KEY and EventTrigger field set to PIXIT.EEVSE.TEST_EVENT_TRIGGER for EV Plugged-in Test Event. Verify Event EEVSE.S.E00(EVConnected) sent"), + TestStep("14a", "TH sends TestEventTrigger command to General Diagnostics Cluster on Endpoint 0 with EnableKey field set to PIXIT.EEVSE.TEST_EVENT_TRIGGER_KEY and EventTrigger field set to PIXIT.EEVSE.TEST_EVENT_TRIGGER for EV Charge Demand Test Event. Verify Event EEVSE.S.E02(EnergyTransferStarted) sent."), + TestStep("14b", "TH reads from the DUT the SessionID attribute. Verify value is 1 more than the value noted in 5c"), + TestStep("15", "TH sends command Disable. Verify Event EEVSE.S.E03(EnergyTransferStopped) sent with reason EvseStopped"), + TestStep("15a", "TH reads from the DUT the SupplyState attribute. Verify value is 0x00 (Disabled)"), + TestStep("16", "TH sends TestEventTrigger command to General Diagnostics Cluster on Endpoint 0 with EnableKey field set to PIXIT.EEVSE.TEST_EVENT_TRIGGER_KEY and EventTrigger field set to PIXIT.EEVSE.TEST_EVENT_TRIGGER for EV Charge Demand Test Event Clear."), + TestStep("17", "TH sends TestEventTrigger command to General Diagnostics Cluster on Endpoint 0 with EnableKey field set to PIXIT.EEVSE.TEST_EVENT_TRIGGER_KEY and EventTrigger field set to PIXIT.EEVSE.TEST_EVENT_TRIGGER for EV Plugged-in Test Event Clear. Verify Event EEVSE.S.E01(EVNotDetected) sent"), + TestStep("18", "TH sends TestEventTrigger command to General Diagnostics Cluster on Endpoint 0 with EnableKey field set to PIXIT.EEVSE.TEST_EVENT_TRIGGER_KEY and EventTrigger field set to PIXIT.EEVSE.TEST_EVENT_TRIGGER for Basic Functionality Test Event Clear."), ] return steps @@ -90,163 +140,207 @@ async def send_test_event_triggers(self, enableKey=bytes([b for b in range(16)]) asserts.fail(f"Unexpected error returned - {e.status}") # TC_EEVSE_2_2 tests steps - async def steps_2_check_test_event_triggers_enabled(self): + async def check_test_event_triggers_enabled(self): full_attr = Clusters.GeneralDiagnostics.Attributes.TestEventTriggersEnabled cluster = Clusters.Objects.GeneralDiagnostics test_event_enabled = await self.read_single_attribute_check_success(endpoint=0, cluster=cluster, attribute=full_attr) asserts.assert_equal(test_event_enabled, True, "TestEventTriggersEnabled is False") - async def steps_3_send_test_event_triggers(self): + async def send_test_event_trigger_basic(self): await self.send_test_event_triggers(eventTrigger=0x0099000000000000) + async def send_test_event_trigger_basic_clear(self): + await self.send_test_event_triggers(eventTrigger=0x0099000000000001) + + async def send_test_event_trigger_pluggedin(self): + await self.send_test_event_triggers(eventTrigger=0x0099000000000002) + + async def send_test_event_trigger_pluggedin_clear(self): + await self.send_test_event_triggers(eventTrigger=0x0099000000000003) + + async def send_test_event_trigger_charge_demand(self): + await self.send_test_event_triggers(eventTrigger=0x0099000000000004) + + async def send_test_event_trigger_charge_demand_clear(self): + await self.send_test_event_triggers(eventTrigger=0x0099000000000005) + @async_test_body async def test_TC_EEVSE_2_2(self): - print_steps = True - - # Part 1 self.step("1") + # Commission DUT - already done - # Part 2 self.step("2") - await self.steps_2_check_test_event_triggers_enabled() + await self.check_test_event_triggers_enabled() - # Part 3 self.step("3") - await self.steps_3_send_test_event_triggers() + await self.send_test_event_trigger_basic() + + # After a few seconds... + time.sleep(3) + self.step("3a") - state = await self.read_evse_attribute_expect_success(endpoint=1, attribute="State") - asserts.assert_equal(state, Clusters.EnergyEvse.Enums.StateEnum.kNotPluggedIn, - f"Unexpected State value - expected kNotPluggedIn (0), was {state}") + await self.check_evse_attribute("State", Clusters.EnergyEvse.Enums.StateEnum.kNotPluggedIn) + self.step("3b") + await self.check_evse_attribute("SupplyState", Clusters.EnergyEvse.Enums.SupplyStateEnum.kDisabled) + self.step("3c") + await self.check_evse_attribute("FaultState", Clusters.EnergyEvse.Enums.FaultStateEnum.kNoError) + self.step("3d") - self.print_step("3b", "TH reads from the DUT the SupplyState attribute. Verify value is 0x00 (Disabled)") - self.print_step("3c", "TH reads from the DUT the FaultState attribute. Verify value is 0x00 (NoError)") - self.print_step("3d", "TH reads from the DUT the SessionID attribute") + # Save Session ID - it may be NULL at this point + session_id = await self.read_evse_attribute_expect_success(endpoint=1, attribute="SessionID") - # Part 4 - self.print_step("4", "TH sends TestEventTrigger command to General Diagnostics Cluster on Endpoint 0 with EnableKey field set to PIXIT.EEVSE.TEST_EVENT_TRIGGER_KEY and EventTrigger field set to PIXIT.EEVSE.TEST_EVENT_TRIGGER for EV Plugged-in Test Event") - self.print_step("4", "Verify Event EEVSE.S.E00(EVConnected) sent") + self.step("4") + await self.send_test_event_trigger_pluggedin() + # TODO check PluggedIn Event - self.print_step("4a", "TH reads from the DUT the State attribute. Verify value is 0x01 (PluggedInNoDemand)") + self.step("4a") + await self.check_evse_attribute("State", Clusters.EnergyEvse.Enums.StateEnum.kPluggedInNoDemand) - # Part 5 - self.print_step( - "5", "TH sends command EnableCharging with ChargingEnabledUntil=2 minutes in the future, minimumChargeCurrent=6000, maximumChargeCurrent=60000") + self.step("5") + charging_duration = 5 # TODO test plan spec says 120s - reduced for now + min_charge_current = 6000 + max_charge_current = 60000 # get epoch time for ChargeUntil variable (2 minutes from now) - utc_time_2_mins = datetime.datetime.now(pytz.utc) + datetime.timedelta(minutes=2) - epoch_time = (utc_time_2_mins - datetime.datetime(2000, 1, 1, tzinfo=pytz.utc)).total_seconds() - await self.send_enable_charge_command(endpoint=1, charge_until=epoch_time, min_charge=6000, max_charge=60000) - - # Part 6 - self.print_step("6", "TH sends TestEventTrigger command to General Diagnostics Cluster on Endpoint 0 with EnableKey field set to PIXIT.EEVSE.TEST_EVENT_TRIGGER_KEY and EventTrigger field set to PIXIT.EEVSE.TEST_EVENT_TRIGGER for EV Charge Demand Test Event") - self.print_step("6", "Verify Event EEVSE.S.E02(EnergyTransferStarted) sent") - - self.print_step('6a', 'TH reads from the DUT the State attribute. Verify it is 3 (PluggedinCharging)') - current_state = await self.read_evse_attribute_expect_success(endpoint=1, attribute='State') - asserts.assert_equal(current_state, 3, f'State should be 3, but is actually {current_state}') - - self.print_step('6b', 'TH reads from the DUT the SupplyState attribute. Verify it is 1 (ChargingEnabled)') - current_supply_state = await self.read_evse_attribute_expect_success(endpoint=1, attribute='SupplyState') - asserts.assert_equal(current_supply_state, 1, f'SupplyState should be 1, but is actually {current_supply_state}') - - self.print_step('6c', f'TH reads from the DUT the ChargingEnabledUntil attribute. Verify it is the {epoch_time}') - charge_until_time = await self.read_evse_attribute_expect_success(endpoint=1, attribute='ChargingEnabledUntil') - asserts.assert_equal(charge_until_time, epoch_time, - f'ChargingEnabledUntil should be {epoch_time}, but is actually {charge_until_time}') - - self.print_step('6d', 'TH reads from the DUT the MinimumChargeCurrent attribute. Verify it is the commanded value (6000)') - minimum_charge_value = await self.read_evse_attribute_expect_success(endpoint=1, attribute='MinimumChargeCurrent') - asserts.assert_equal(minimum_charge_value, 6000, - f'MinimumChargeValue should be 6000, but is actually {minimum_charge_value}') - - self.print_step( - '6e', 'TH reads from the DUT the MaximumChargeCurrent attribute. Verify it is the MIN(command value (60000), CircuitCapacity)') - maximum_charge_value = await self.read_evse_attribute_expect_success(endpoint=1, attribute='MinimumChargeCurrent') - circuit_capacity = await self.read_evse_attribute_expect_success(endpoint=1, attribute='CircuitCapacity') - expected_max_charge = min(6000, circuit_capacity) - asserts.assert_equal(maximum_charge_value, expected_max_charge, - f'MaximumChargeValue should be {expected_max_charge}, but is actually {maximum_charge_value}') - - # Part 7 - self.print_step(7, 'Wait for 2 minutes') - time.sleep(120) - - self.print_step('7a', 'TH reads from the DUT the State attribute. Verify it is 2 (PluggedinDemand)') - current_state = await self.read_evse_attribute_expect_success(endpoint=1, attribute='State') - asserts.assert_equal(current_state, 2, f'State should be 2, but is actually {current_state}') - - self.print_step('7b', 'TH reads from the DUT the SupplyState attribute. Verify it is 0 (Disabled)') - current_supply_state = await self.read_evse_attribute_expect_success(endpoint=1, attribute='SupplyState') - asserts.assert_equal(current_supply_state, 0, f'SupplyState should be 0, but is actually {current_supply_state}') - - # Part 8 - self.print_step( - 8, 'TH sends command EnableCharging with ChargingEnabledUntil=NULL, minimumChargeCurrent = 6000, maximumChargeCurrent=12000') - await self.send_enable_charge_command(endpoint=1, charge_until=epoch_time, min_charge=6000, max_charge=12000) - - self.print_step('8a', 'TH reads from the DUT the State attribute. Verify it is 3 (PluggedinCharging)') - current_state = await self.read_evse_attribute_expect_success(endpoint=1, attribute='State') - asserts.assert_equal(current_state, 3, f'State should be 3, but is actually {current_state}') - - self.print_step('8b', 'TH reads from the DUT the SupplyState attribute. Verify it is 1 (ChargingEnabled)') - current_supply_state = await self.read_evse_attribute_expect_success(endpoint=1, attribute='SupplyState') - asserts.assert_equal(current_supply_state, 1, f'SupplyState should be 1, but is actually {current_supply_state}') - - self.print_step('8c', f'TH reads from the DUT the ChargingEnabledUntil attribute. Verify it is the {epoch_time}') - charge_until_time = await self.read_evse_attribute_expect_success(endpoint=1, attribute='ChargingEnabledUntil') - asserts.assert_equal(charge_until_time, epoch_time, - f'ChargingEnabledUntil should be {epoch_time}, but is actually {charge_until_time}') - - self.print_step('8d', 'TH reads from the DUT the MinimumChargeCurrent attribute. Verify it is the commanded value (6000)') - minimum_charge_value = await self.read_evse_attribute_expect_success(endpoint=1, attribute='MinimumChargeCurrent') - asserts.assert_equal(minimum_charge_value, 6000, - f'MinimumChargeValue should be 6000, but is actually {minimum_charge_value}') - - self.print_step( - '8e', 'TH reads from the DUT the MaximumChargeCurrent attribute. Verify it is the MIN(command value (60000), CircuitCapacity)') - maximum_charge_value = await self.read_evse_attribute_expect_success(endpoint=1, attribute='MaximumChargeCurrent') - circuit_capacity = await self.read_evse_attribute_expect_success(endpoint=1, attribute='CircuitCapacity') - expected_max_charge = min(12000, circuit_capacity) - asserts.assert_equal(maximum_charge_value, expected_max_charge, - f'MaximumChargeValue should be {expected_max_charge}, but is actually {maximum_charge_value}') - - # Part 9 - # This may not work as the optional attribute may not be currently supported. - self.print_step(9, 'If the optional attribute is supported TH writes to the DUT UserMaximumChargeCurrent=6000') - self.write_user_max_charge(1, user_max_charge=6000) - - self.print_step('9a', 'After a few seconds TH reads from the DUT the MaximumChargeCurrent') - time.sleep(3) - maximum_charge_value = await self.read_evse_attribute_expect_success(endpoint=1, attribute='MaximumChargeCurrent') - circuit_capacity = await self.read_evse_attribute_expect_success(endpoint=1, attribute='CircuitCapacity') - expected_max_charge = min(maximum_charge_value, circuit_capacity) - asserts.assert_equal(maximum_charge_value, expected_max_charge, - f'MaximumChargeValue should be {expected_max_charge}, but is actually {maximum_charge_value}') + utc_time_charging_end = datetime.datetime.now(pytz.utc) + datetime.timedelta(seconds=charging_duration) + epoch_time = (utc_time_charging_end - datetime.datetime(2000, 1, 1, tzinfo=pytz.utc)).total_seconds() + await self.send_enable_charge_command(endpoint=1, charge_until=epoch_time, min_charge=min_charge_current, max_charge=max_charge_current) + + self.step("6") + await self.send_test_event_trigger_charge_demand() + # TODO check EnergyTransferStarted Event + + self.step("6a") + await self.check_evse_attribute("State", Clusters.EnergyEvse.Enums.StateEnum.kPluggedInCharging) + + self.step("6b") + await self.check_evse_attribute("SupplyState", Clusters.EnergyEvse.Enums.SupplyStateEnum.kChargingEnabled) + + self.step("6c") + await self.check_evse_attribute("ChargingEnabledUntil", epoch_time) + + self.step("6d") + await self.check_evse_attribute("MinimumChargeCurrent", min_charge_current) + + self.step("6e") + circuit_capacity = await self.read_evse_attribute_expect_success(endpoint=1, attribute="CircuitCapacity") + expected_max_charge = min(max_charge_current, circuit_capacity) + await self.check_evse_attribute("MaximumChargeCurrent", expected_max_charge) + + self.step("7") + # Sleep for the charging duration plus a couple of seconds to check it has stopped + time.sleep(charging_duration + 2) + # TODO check EnergyTransferredStoped (EvseStopped) + + self.step("7a") + await self.check_evse_attribute("State", Clusters.EnergyEvse.Enums.StateEnum.kPluggedInDemand) + + self.step("7b") + await self.check_evse_attribute("SupplyState", Clusters.EnergyEvse.Enums.SupplyStateEnum.kDisabled) + + self.step("8") + charge_until = None + min_charge_current = 6000 + max_charge_current = 12000 + + await self.send_enable_charge_command(endpoint=1, charge_until=charge_until, min_charge=min_charge_current, max_charge=max_charge_current) + + self.step("8a") + await self.check_evse_attribute("State", Clusters.EnergyEvse.Enums.StateEnum.kPluggedInCharging) + + self.step("8b") + await self.check_evse_attribute("SupplyState", Clusters.EnergyEvse.Enums.SupplyStateEnum.kChargingEnabled) + + self.step("8c") + await self.check_evse_attribute("ChargingEnabledUntil", charge_until) + + self.step("8d") + await self.check_evse_attribute("MinimumChargeCurrent", min_charge_current) + + self.step("8e") + circuit_capacity = await self.read_evse_attribute_expect_success(endpoint=1, attribute="CircuitCapacity") + expected_max_charge = min(max_charge_current, circuit_capacity) + await self.check_evse_attribute("MaximumChargeCurrent", expected_max_charge) + + self.step("9") + # This will only work if the optional UserMaximumChargeCurrent attribute is supported + if Clusters.EnergyEvse.Attributes.UserMaximumChargeCurrent.attribute_id in self.get_supported_energy_evse_attributes(): + logging.info("UserMaximumChargeCurrent is supported...") + user_max_charge_current = 6000 + self.write_user_max_charge(1, user_max_charge_current) + + self.step("9a") + time.sleep(3) + + expected_max_charge = min(user_max_charge_current, circuit_capacity) + await self.check_evse_attribute("MaximumChargeCurrent", expected_max_charge) + else: + logging.info("UserMaximumChargeCurrent is NOT supported... skipping.") + + self.step("10") + await self.send_test_event_trigger_charge_demand_clear() + # TODO Verify Event EEVSE.S.E03(EnergyTransferStopped) sent with reason EvStopped + + self.step("10a") + await self.check_evse_attribute("State", Clusters.EnergyEvse.Enums.StateEnum.kPluggedInNoDemand) + + self.step("11") + await self.send_test_event_trigger_charge_demand() + # TODO Verify Event EEVSE.S.E03(EnergyTransferStarted) sent + + self.step("12") + await self.send_test_event_trigger_charge_demand_clear() + # TODO Verify Event EEVSE.S.E03(EnergyTransferStopped with reason EvStopped) sent + + self.step("12a") + await self.check_evse_attribute("State", Clusters.EnergyEvse.Enums.StateEnum.kPluggedInNoDemand) + + self.step("13") + await self.send_test_event_trigger_pluggedin_clear() + # TODO Verify EVNotDetected sent + + self.step("13a") + await self.check_evse_attribute("State", Clusters.EnergyEvse.Enums.StateEnum.kNotPluggedIn) + + self.step("13b") + await self.check_evse_attribute("SupplyState", Clusters.EnergyEvse.Enums.SupplyStateEnum.kChargingEnabled) + + self.step("13c") + await self.check_evse_attribute("SessionID", session_id) - # Part 10 - TODO Requires Test Event Triggers + self.step("13d") + session_duration = await self.read_evse_attribute_expect_success(endpoint=1, attribute="SessionDuration") + asserts.assert_greater_equal(session_duration, charging_duration, + f"Unexpected 'SessionDuration' value - expected >= {charging_duration}, was {session_duration}") - # Part 11 - TODO Requires Test Event Triggers + self.step("14") + await self.send_test_event_trigger_pluggedin() + # TODO check PluggedIn Event - # Part 12 - TODO Requires Test Event Triggers + self.step("14a") + await self.send_test_event_trigger_charge_demand() + # TODO check EnergyTransferStarted Event - # Part 13 - self.print_step(13, 'TH sends a Disable command') - await self.send_disable_command(endpoint=1) + self.step("14b") + await self.check_evse_attribute("SessionID", session_id + 1) - self.print_step('13a', 'TH reads from the DUT the State attribute. Verify it is 2 (PluggedinDemand)') - current_state = await self.read_evse_attribute_expect_success(endpoint=1, attribute='State') - asserts.assert_equal(current_state, 2, f'State should be 2, but is actually {current_state}') + self.step("15") + await self.send_disable_command() + # TODO Verify Event EEVSE.S.E03(EnergyTransferStopped with reason EvseStopped) sent - self.print_step('13b', 'TH reads from the DUT the SupplyState attribute. Verify it is 0 (Disabled)') - current_supply_state = await self.read_evse_attribute_expect_success(endpoint=1, attribute='SupplyState') - asserts.assert_equal(current_supply_state, 0, f'SupplyState should be 0, but is actually {current_supply_state}') + self.step("15a") + await self.check_evse_attribute("SupplyState", Clusters.EnergyEvse.Enums.SupplyStateEnum.kDisabled) - # Part 14 - TODO Requires Test Event Triggers + self.step("16") + await self.send_test_event_trigger_charge_demand_clear() - # Part 15 - TODO Requires Test Event Triggers + self.step("17") + await self.send_test_event_trigger_pluggedin_clear() + # TODO Verify EVNotDetected sent - # Part 16 - TODO Requires Test Event Triggers + self.step("18") + await self.send_test_event_trigger_basic_clear() if __name__ == "__main__": From 80756576cabb930f63c8ca6ecde97a4eb521046e Mon Sep 17 00:00:00 2001 From: James Harrow Date: Mon, 1 Jan 2024 22:10:57 +0000 Subject: [PATCH 065/114] Refactored Handling of TestEvents to allow clear, and better error handling. --- .../include/EnergyEvseDelegateImpl.h | 1 + .../src/EVSEManufacturerImpl.cpp | 56 ++++++++++++++++--- 2 files changed, 48 insertions(+), 9 deletions(-) diff --git a/examples/energy-management-app/energy-management-common/include/EnergyEvseDelegateImpl.h b/examples/energy-management-app/energy-management-common/include/EnergyEvseDelegateImpl.h index c7be153da04fd0..2be194e23640f7 100644 --- a/examples/energy-management-app/energy-management-common/include/EnergyEvseDelegateImpl.h +++ b/examples/energy-management-app/energy-management-common/include/EnergyEvseDelegateImpl.h @@ -128,6 +128,7 @@ class EnergyEvseDelegate : public EnergyEvse::Delegate Status HwSetCircuitCapacity(int64_t currentmA); Status HwSetCableAssemblyLimit(int64_t currentmA); Status HwSetState(StateEnum state); + StateEnum HwGetState() { return mHwState; }; Status HwSetFault(FaultStateEnum fault); Status HwSetRFID(ByteSpan uid); Status HwSetVehicleID(const CharSpan & vehID); diff --git a/examples/energy-management-app/energy-management-common/src/EVSEManufacturerImpl.cpp b/examples/energy-management-app/energy-management-common/src/EVSEManufacturerImpl.cpp index 682d1b07d77f2c..1bde91ac89dd83 100644 --- a/examples/energy-management-app/energy-management-common/src/EVSEManufacturerImpl.cpp +++ b/examples/energy-management-app/energy-management-common/src/EVSEManufacturerImpl.cpp @@ -105,34 +105,72 @@ void EVSEManufacturer::ApplicationCallbackHandler(const EVSECbInfo * cb, intptr_ } } +struct EVSETestEventSaveData +{ + int64_t mOldCircuitCapacity; + int64_t mOldUserMaximumChargeCurrent; + StateEnum mOldHwStateBasic; /* For storing hwState before Basic Func event */ + StateEnum mOldHwStatePluggedIn; /* For storing hwState before PluggedIn event */ + StateEnum mOldHwStatePluggedInDemand; /* For storing hwState before PluggedInDemand event */ +}; + +static EVSETestEventSaveData sEVSETestEventSaveData; + +EnergyEvseDelegate * GetEvseDelegate() +{ + EVSEManufacturer * mn = GetEvseManufacturer(); + VerifyOrDieWithMsg(mn != nullptr, AppServer, "EVSEManufacturer is null"); + EnergyEvseDelegate * dg = mn->GetDelegate(); + VerifyOrDieWithMsg(dg != nullptr, AppServer, "EVSE Delegate is null"); + + return dg; +} + void SetTestEventTrigger_BasicFunctionality() { - EnergyEvseDelegate * dg = GetEvseManufacturer()->GetDelegate(); + EnergyEvseDelegate * dg = GetEvseDelegate(); - // TODO save the values so we can restore them in the clear event + sEVSETestEventSaveData.mOldCircuitCapacity = dg->GetCircuitCapacity(); + sEVSETestEventSaveData.mOldUserMaximumChargeCurrent = dg->GetUserMaximumChargeCurrent(); + sEVSETestEventSaveData.mOldHwStateBasic = dg->HwGetState(); dg->HwSetCircuitCapacity(32000); dg->SetUserMaximumChargeCurrent(32000); dg->HwSetState(StateEnum::kNotPluggedIn); } -void SetTestEventTrigger_BasicFunctionalityClear() {} +void SetTestEventTrigger_BasicFunctionalityClear() +{ + EnergyEvseDelegate * dg = GetEvseDelegate(); + dg->HwSetCircuitCapacity(sEVSETestEventSaveData.mOldCircuitCapacity); + dg->SetUserMaximumChargeCurrent(sEVSETestEventSaveData.mOldUserMaximumChargeCurrent); + dg->HwSetState(sEVSETestEventSaveData.mOldHwStateBasic); +} void SetTestEventTrigger_EVPluggedIn() { - EnergyEvseDelegate * dg = GetEvseManufacturer()->GetDelegate(); + EnergyEvseDelegate * dg = GetEvseDelegate(); - // TODO save the values so we can restore them in the clear event + sEVSETestEventSaveData.mOldHwStatePluggedIn = dg->HwGetState(); dg->HwSetState(StateEnum::kPluggedInNoDemand); } -void SetTestEventTrigger_EVPluggedInClear() {} +void SetTestEventTrigger_EVPluggedInClear() +{ + EnergyEvseDelegate * dg = GetEvseDelegate(); + dg->HwSetState(sEVSETestEventSaveData.mOldHwStatePluggedIn); +} void SetTestEventTrigger_EVChargeDemand() { - EnergyEvseDelegate * dg = GetEvseManufacturer()->GetDelegate(); + EnergyEvseDelegate * dg = GetEvseDelegate(); - // TODO save the values so we can restore them in the clear event + sEVSETestEventSaveData.mOldHwStatePluggedInDemand = dg->HwGetState(); dg->HwSetState(StateEnum::kPluggedInDemand); } -void SetTestEventTrigger_EVChargeDemandClear() {} +void SetTestEventTrigger_EVChargeDemandClear() +{ + EnergyEvseDelegate * dg = GetEvseDelegate(); + + dg->HwSetState(sEVSETestEventSaveData.mOldHwStatePluggedInDemand); +} bool HandleEnergyEvseTestEventTrigger(uint64_t eventTrigger) { From 8631c077ea8612a8b83a27d1d95095276eb98cf6 Mon Sep 17 00:00:00 2001 From: James Harrow Date: Tue, 2 Jan 2024 01:07:17 +0000 Subject: [PATCH 066/114] Refactored state handling by decomposing into state machine events where similar functions are performed based on state transition. Fixed TC chargingEnabledUntil cast to int. Note gets to step 6e --- .../include/EnergyEvseDelegateImpl.h | 26 ++ .../src/EnergyEvseDelegateImpl.cpp | 370 ++++++++++++------ src/python_testing/TC_EEVSE_2_2.py | 2 +- 3 files changed, 287 insertions(+), 111 deletions(-) diff --git a/examples/energy-management-app/energy-management-common/include/EnergyEvseDelegateImpl.h b/examples/energy-management-app/energy-management-common/include/EnergyEvseDelegateImpl.h index 2be194e23640f7..2c3fcf8c58d5ac 100644 --- a/examples/energy-management-app/energy-management-common/include/EnergyEvseDelegateImpl.h +++ b/examples/energy-management-app/energy-management-common/include/EnergyEvseDelegateImpl.h @@ -31,6 +31,20 @@ namespace app { namespace Clusters { namespace EnergyEvse { +/* Local state machine Events to allow simpler handling of state transitions */ +enum EVSEStateMachineEvent +{ + EVPluggedInEvent, /* EV has been plugged in */ + EVNotDetectedEvent, /* EV has been unplugged or detected as not connected */ + EVNoDemandEvent, /* EV has stopped asking for demand */ + EVDemandEvent, /* EV has asked for demand*/ + ChargingEnabledEvent, /* Charging has been enabled */ + DischargingEnabledEvent, /* Discharging has been enabled */ + DisabledEvent, /* EVSE has been disabled */ + FaultRaised, /* Fault has been raised */ + FaultCleared, /* Fault has been cleared */ +}; + /** * Helper class to handle all of the session related info */ @@ -215,6 +229,18 @@ class EnergyEvseDelegate : public EnergyEvse::Delegate Status NotifyApplicationStateChange(); Status GetEVSEEnergyMeterValue(ChargingDischargingType meterType, int64_t & aMeterValue); + /* Local State machine handling */ + Status HandleStateMachineEvent(EVSEStateMachineEvent event); + Status HandleEVPluggedInEvent(); + Status HandleEVNotDetectedEvent(); + Status HandleEVNoDemandEvent(); + Status HandleEVDemandEvent(); + Status HandleChargingEnabledEvent(); + Status HandleDischargingEnabledEvent(); + Status HandleDisabledEvent(); + Status HandleFaultRaised(); + Status HandleFaultCleared(); + /** * @brief Helper function to work out the charge limit based on conditions and settings */ diff --git a/examples/energy-management-app/energy-management-common/src/EnergyEvseDelegateImpl.cpp b/examples/energy-management-app/energy-management-common/src/EnergyEvseDelegateImpl.cpp index 431886b83a64f2..640336e8fdb373 100644 --- a/examples/energy-management-app/energy-management-common/src/EnergyEvseDelegateImpl.cpp +++ b/examples/energy-management-app/energy-management-common/src/EnergyEvseDelegateImpl.cpp @@ -48,30 +48,6 @@ Status EnergyEvseDelegate::Disable() { ChipLogProgress(AppServer, "EnergyEvseDelegate::Disable()"); - /* Update State */ - switch (mHwState) - { - case StateEnum::kNotPluggedIn: - SetState(StateEnum::kNotPluggedIn); - break; - - case StateEnum::kPluggedInNoDemand: - SetState(StateEnum::kPluggedInNoDemand); - break; - - case StateEnum::kPluggedInDemand: - SetState(StateEnum::kPluggedInDemand); - break; - - default: - ChipLogError(AppServer, "Unexpected EVSE hardware state"); - SetState(StateEnum::kFault); - break; - } - - /* update SupplyState */ - SetSupplyState(SupplyStateEnum::kDisabled); - /* update ChargingEnabledUntil & DischargingEnabledUntil to show 0 */ SetChargingEnabledUntil(0); SetDischargingEnabledUntil(0); @@ -83,10 +59,7 @@ Status EnergyEvseDelegate::Disable() /* update MaximumDischargeCurrent to 0 */ SetMaximumDischargeCurrent(0); - NotifyApplicationStateChange(); - // TODO: Generate events - - return Status::Success; + return HandleStateMachineEvent(EVSEStateMachineEvent::DisabledEvent); } /** @@ -128,51 +101,19 @@ Status EnergyEvseDelegate::EnableCharging(const DataModel::Nullable & { /* check chargingEnabledUntil is in the future */ ChipLogError(AppServer, "Charging enabled until: %lu", static_cast(chargingEnabledUntil.Value())); - // TODO + SetChargingEnabledUntil(chargingEnabledUntil.Value()); + // TODO start a timer to disable charging later // if (checkChargingEnabled) } - /* Check current state isn't already enabled */ - - /* If charging is already enabled, check that the parameters may have - changed, these may override an existing charging command */ - switch (mHwState) - { - case StateEnum::kNotPluggedIn: - // TODO handle errors here - SetState(StateEnum::kNotPluggedIn); - break; - - case StateEnum::kPluggedInNoDemand: - // TODO handle errors here - // TODO REFACTOR per Andrei's comment in PR30857 - can we collapse this switch statement? - SetState(StateEnum::kPluggedInNoDemand); - break; - - case StateEnum::kPluggedInDemand: - /* If the EVSE is asking for demand then enable charging */ - SetState(StateEnum::kPluggedInCharging); - break; - - default: - ChipLogError(AppServer, "Unexpected EVSE hardware state"); - SetState(StateEnum::kFault); - break; - } - - /* update SupplyState to say that charging is now enabled */ - SetSupplyState(SupplyStateEnum::kChargingEnabled); - /* If it looks ok, store the min & max charging current */ mMaximumChargingCurrentLimitFromCommand = maximumChargeCurrent; SetMinimumChargeCurrent(minimumChargeCurrent); // TODO persist these to KVS - // TODO: Generate events - - NotifyApplicationStateChange(); + ComputeMaxChargeCurrentLimit(); - return this->ComputeMaxChargeCurrentLimit(); + return HandleStateMachineEvent(EVSEStateMachineEvent::ChargingEnabledEvent); } /** @@ -186,14 +127,10 @@ Status EnergyEvseDelegate::EnableDischarging(const DataModel::Nullable { ChipLogProgress(AppServer, "EnergyEvseDelegate::EnableDischarging() called."); - /* update SupplyState */ - SetSupplyState(SupplyStateEnum::kDischargingEnabled); + // TODO save the maxDischarging Current + // TODO Do something with timestamp - // TODO: Generate events - - NotifyApplicationStateChange(); - - return Status::Success; + return HandleStateMachineEvent(EVSEStateMachineEvent::DischargingEnabledEvent); } /** @@ -209,10 +146,6 @@ Status EnergyEvseDelegate::StartDiagnostics() // TODO: Generate events - // TODO: Notify Application to implement Diagnostics - - NotifyApplicationStateChange(); - return Status::Success; } @@ -344,54 +277,47 @@ Status EnergyEvseDelegate::HwSetState(StateEnum newState) switch (newState) { case StateEnum::kNotPluggedIn: - if (IsEvPluggedIn(mState)) + if (mHwState == StateEnum::kPluggedInNoDemand || mHwState == StateEnum::kPluggedInDemand) { - /* EV was plugged in, but no longer is */ - mSession.RecalculateSessionDuration(); - if (IsEvTransferringEnergy(mState)) - { - /* - * EV was transferring current - unusual to get to this case without - * first having the state set to kPluggedInNoDemand or kPluggedInDemand - */ - mSession.RecalculateSessionDuration(); - SendEnergyTransferStoppedEvent(EnergyTransferStoppedReasonEnum::kOther); - } - - SendEVNotDetectedEvent(); - SetState(newState); + /* EVSE has been unplugged now */ + HandleStateMachineEvent(EVSEStateMachineEvent::EVNotDetectedEvent); } break; - case StateEnum::kPluggedInNoDemand: /* deliberate fall-thru */ + case StateEnum::kPluggedInNoDemand: + if (mHwState == StateEnum::kNotPluggedIn) + { + /* EV was unplugged, now is plugged in */ + mHwState = newState; + HandleStateMachineEvent(EVSEStateMachineEvent::EVPluggedInEvent); + } + else if (mHwState == StateEnum::kPluggedInDemand) + { + /* EV was plugged in and wanted demand, now doesn't want demand */ + mHwState = newState; + HandleStateMachineEvent(EVSEStateMachineEvent::EVDemandEvent); + } + break; case StateEnum::kPluggedInDemand: - if (IsEvPluggedIn(mState)) + if (mHwState == StateEnum::kNotPluggedIn) { - /* EV was already plugged in before */ - if (IsEvTransferringEnergy(mState)) - { - mSession.RecalculateSessionDuration(); - SendEnergyTransferStoppedEvent(newState == StateEnum::kPluggedInNoDemand - ? EnergyTransferStoppedReasonEnum::kEVStopped - : EnergyTransferStoppedReasonEnum::kEVSEStopped); - } - SetState(newState); + /* EV was unplugged, now is plugged in and wants demand */ + mHwState = newState; + HandleStateMachineEvent(EVSEStateMachineEvent::EVPluggedInEvent); + HandleStateMachineEvent(EVSEStateMachineEvent::EVDemandEvent); } - else + else if (mHwState == StateEnum::kPluggedInNoDemand) { - /* EV was not plugged in - start a new session */ - // TODO get energy meter readings - mSession.StartSession(0, 0); - SendEVConnectedEvent(); - - /* If*/ - - SetState(newState); + /* EV was plugged in and didn't want demand, now does want demand */ + mHwState = newState; + HandleStateMachineEvent(EVSEStateMachineEvent::EVDemandEvent); } break; default: /* All other states should be managed by the Delegate */ + ChipLogError(AppServer, "HwSetState received invalid enum from caller"); + return Status::Failure; break; } @@ -493,6 +419,228 @@ Status EnergyEvseDelegate::HwSetVehicleID(const CharSpan & newValue) * Functions below are private helper functions internal to the delegate */ +/** + * @brief Main EVSE state machine + * + * This routine handles state transition events to determine behaviour + * + * + */ +Status EnergyEvseDelegate::HandleStateMachineEvent(EVSEStateMachineEvent event) +{ + switch (event) + { + case EVSEStateMachineEvent::EVPluggedInEvent: + ChipLogDetail(AppServer, "EVSE: EV PluggedIn event"); + return HandleEVPluggedInEvent(); + break; + case EVSEStateMachineEvent::EVNotDetectedEvent: + ChipLogDetail(AppServer, "EVSE: EV NotDetected event"); + return HandleEVNotDetectedEvent(); + break; + case EVSEStateMachineEvent::EVNoDemandEvent: + ChipLogDetail(AppServer, "EVSE: EV NoDemand event"); + return HandleEVNoDemandEvent(); + break; + case EVSEStateMachineEvent::EVDemandEvent: + ChipLogDetail(AppServer, "EVSE: EV Demand event"); + return HandleEVDemandEvent(); + break; + case EVSEStateMachineEvent::ChargingEnabledEvent: + ChipLogDetail(AppServer, "EVSE: ChargingEnabled event"); + return HandleChargingEnabledEvent(); + break; + case EVSEStateMachineEvent::DischargingEnabledEvent: + ChipLogDetail(AppServer, "EVSE: DischargingEnabled event"); + return HandleDischargingEnabledEvent(); + break; + case EVSEStateMachineEvent::DisabledEvent: + ChipLogDetail(AppServer, "EVSE: Disabled event"); + return HandleDisabledEvent(); + break; + case EVSEStateMachineEvent::FaultRaised: + ChipLogDetail(AppServer, "EVSE: FaultRaised event"); + return HandleFaultRaised(); + break; + case EVSEStateMachineEvent::FaultCleared: + ChipLogDetail(AppServer, "EVSE: FaultCleared event"); + return HandleFaultCleared(); + break; + default: + return Status::Failure; + } + return Status::Success; +} + +Status EnergyEvseDelegate::HandleEVPluggedInEvent() +{ + /* check if we are already plugged in or not */ + if (mState == StateEnum::kNotPluggedIn) + { + /* EV was not plugged in - start a new session */ + // TODO get energy meter readings + mSession.StartSession(0, 0); + SendEVConnectedEvent(); + + /* Set the state to either PluggedInNoDemand or PluggedInDemand as indicated by mHwState */ + SetState(mHwState); + } + // else we are already plugged in - ignore + return Status::Success; +} + +Status EnergyEvseDelegate::HandleEVNotDetectedEvent() +{ + if (mState == StateEnum::kPluggedInCharging || mState == StateEnum::kPluggedInDischarging) + { + /* + * EV was transferring current - unusual to get to this case without + * first having the state set to kPluggedInNoDemand or kPluggedInDemand + */ + SendEnergyTransferStoppedEvent(EnergyTransferStoppedReasonEnum::kOther); + } + + SendEVNotDetectedEvent(); + SetState(StateEnum::kNotPluggedIn); + return Status::Success; +} + +Status EnergyEvseDelegate::HandleEVNoDemandEvent() +{ + if (mState == StateEnum::kPluggedInCharging || mState == StateEnum::kPluggedInDischarging) + { + /* + * EV was transferring current - EV decided to stop + */ + mSession.RecalculateSessionDuration(); + SendEnergyTransferStoppedEvent(EnergyTransferStoppedReasonEnum::kEVStopped); + } + /* We must still be plugged in to get here - so no need to check if we are plugged in! */ + SetState(StateEnum::kPluggedInNoDemand); + return Status::Success; +} +Status EnergyEvseDelegate::HandleEVDemandEvent() +{ + /* Check to see if the supply is enabled for charging / discharging*/ + switch (mSupplyState) + { + case SupplyStateEnum::kChargingEnabled: + SetState(StateEnum::kPluggedInCharging); + SendEnergyTransferStartedEvent(); + break; + case SupplyStateEnum::kDischargingEnabled: + SetState(StateEnum::kPluggedInDischarging); + SendEnergyTransferStartedEvent(); + break; + case SupplyStateEnum::kDisabled: + case SupplyStateEnum::kDisabledError: + case SupplyStateEnum::kDisabledDiagnostics: + /* We must be plugged in, and the event is asking for demand + * but we can't charge or discharge now - leave it as kPluggedInDemand */ + SetState(StateEnum::kPluggedInDemand); + break; + default: + break; + } + return Status::Success; +} + +Status EnergyEvseDelegate::HandleChargingEnabledEvent() +{ + /* Check there is no Fault or Diagnostics condition */ + // TODO -! + + /* update SupplyState to say that charging is now enabled */ + SetSupplyState(SupplyStateEnum::kChargingEnabled); + + switch (mState) + { + case StateEnum::kNotPluggedIn: + case StateEnum::kPluggedInNoDemand: + break; + case StateEnum::kPluggedInDemand: + SetState(StateEnum::kPluggedInCharging); + SendEnergyTransferStartedEvent(); + break; + case StateEnum::kPluggedInCharging: + break; + case StateEnum::kPluggedInDischarging: + /* Switched from discharging to charging */ + SendEnergyTransferStoppedEvent(EnergyTransferStoppedReasonEnum::kEVSEStopped); + + SetState(StateEnum::kPluggedInCharging); + SendEnergyTransferStartedEvent(); + break; + default: + break; + } + return Status::Success; +} +Status EnergyEvseDelegate::HandleDischargingEnabledEvent() +{ + /* Check there is no Fault or Diagnostics condition */ + // TODO -! + + /* update SupplyState to say that charging is now enabled */ + SetSupplyState(SupplyStateEnum::kDischargingEnabled); + + switch (mState) + { + case StateEnum::kNotPluggedIn: + case StateEnum::kPluggedInNoDemand: + break; + case StateEnum::kPluggedInDemand: + SetState(StateEnum::kPluggedInDischarging); + SendEnergyTransferStartedEvent(); + break; + case StateEnum::kPluggedInCharging: + /* Switched from charging to discharging */ + SendEnergyTransferStoppedEvent(EnergyTransferStoppedReasonEnum::kEVSEStopped); + + SetState(StateEnum::kPluggedInDischarging); + SendEnergyTransferStartedEvent(); + break; + case StateEnum::kPluggedInDischarging: + default: + break; + } + return Status::Success; +} +Status EnergyEvseDelegate::HandleDisabledEvent() +{ + /* Check there is no Fault or Diagnostics condition */ + // TODO -! + + /* update SupplyState to say that charging is now enabled */ + SetSupplyState(SupplyStateEnum::kDisabled); + + switch (mState) + { + case StateEnum::kNotPluggedIn: + case StateEnum::kPluggedInNoDemand: + case StateEnum::kPluggedInDemand: + break; + case StateEnum::kPluggedInCharging: + case StateEnum::kPluggedInDischarging: + SendEnergyTransferStoppedEvent(EnergyTransferStoppedReasonEnum::kEVSEStopped); + SetState(mHwState); + break; + default: + break; + } + + return Status::Success; +} + +Status EnergyEvseDelegate::HandleFaultRaised() +{ + return Status::Success; +} +Status EnergyEvseDelegate::HandleFaultCleared() +{ + return Status::Success; +} + /** * @brief Called to compute the safe charging current limit * @@ -729,6 +877,7 @@ CHIP_ERROR EnergyEvseDelegate::SetState(StateEnum newValue) { ChipLogDetail(AppServer, "State updated to %d", static_cast(mState)); MatterReportingAttributeChangeCallback(mEndpointId, EnergyEvse::Id, State::Id); + NotifyApplicationStateChange(); } return CHIP_NO_ERROR; @@ -754,6 +903,7 @@ CHIP_ERROR EnergyEvseDelegate::SetSupplyState(SupplyStateEnum newValue) { ChipLogDetail(AppServer, "SupplyState updated to %d", static_cast(mSupplyState)); MatterReportingAttributeChangeCallback(mEndpointId, EnergyEvse::Id, SupplyState::Id); + NotifyApplicationStateChange(); } return CHIP_NO_ERROR; } diff --git a/src/python_testing/TC_EEVSE_2_2.py b/src/python_testing/TC_EEVSE_2_2.py index d7968f8e6989e5..72eb26ad9b1372 100644 --- a/src/python_testing/TC_EEVSE_2_2.py +++ b/src/python_testing/TC_EEVSE_2_2.py @@ -204,7 +204,7 @@ async def test_TC_EEVSE_2_2(self): max_charge_current = 60000 # get epoch time for ChargeUntil variable (2 minutes from now) utc_time_charging_end = datetime.datetime.now(pytz.utc) + datetime.timedelta(seconds=charging_duration) - epoch_time = (utc_time_charging_end - datetime.datetime(2000, 1, 1, tzinfo=pytz.utc)).total_seconds() + epoch_time = int((utc_time_charging_end - datetime.datetime(2000, 1, 1, tzinfo=pytz.utc)).total_seconds()) await self.send_enable_charge_command(endpoint=1, charge_until=epoch_time, min_charge=min_charge_current, max_charge=max_charge_current) self.step("6") From a5774dedbbeac63d4b8bb4295ff15a500281b37d Mon Sep 17 00:00:00 2001 From: James Harrow Date: Tue, 2 Jan 2024 21:05:31 +0000 Subject: [PATCH 067/114] Fixed step 6e caused by not setting the cable limit / maxHardwareCurrentLimit in test events --- .../include/EnergyEvseDelegateImpl.h | 2 ++ .../src/EVSEManufacturerImpl.cpp | 12 +++++++++++- .../src/EnergyEvseDelegateImpl.cpp | 12 +++++++++--- 3 files changed, 22 insertions(+), 4 deletions(-) diff --git a/examples/energy-management-app/energy-management-common/include/EnergyEvseDelegateImpl.h b/examples/energy-management-app/energy-management-common/include/EnergyEvseDelegateImpl.h index 2c3fcf8c58d5ac..697e9ed6811ee9 100644 --- a/examples/energy-management-app/energy-management-common/include/EnergyEvseDelegateImpl.h +++ b/examples/energy-management-app/energy-management-common/include/EnergyEvseDelegateImpl.h @@ -139,8 +139,10 @@ class EnergyEvseDelegate : public EnergyEvse::Delegate // ----------------------------------------------------------------- // Internal API to allow an EVSE to change its internal state etc Status HwSetMaxHardwareCurrentLimit(int64_t currentmA); + int64_t HwGetMaxHardwareCurrentLimit() { return mMaxHardwareCurrentLimit; } Status HwSetCircuitCapacity(int64_t currentmA); Status HwSetCableAssemblyLimit(int64_t currentmA); + int64_t HwGetCableAssemblyLimit() { return mCableAssemblyCurrentLimit; } Status HwSetState(StateEnum state); StateEnum HwGetState() { return mHwState; }; Status HwSetFault(FaultStateEnum fault); diff --git a/examples/energy-management-app/energy-management-common/src/EVSEManufacturerImpl.cpp b/examples/energy-management-app/energy-management-common/src/EVSEManufacturerImpl.cpp index 1bde91ac89dd83..8d4279601bd92a 100644 --- a/examples/energy-management-app/energy-management-common/src/EVSEManufacturerImpl.cpp +++ b/examples/energy-management-app/energy-management-common/src/EVSEManufacturerImpl.cpp @@ -107,8 +107,10 @@ void EVSEManufacturer::ApplicationCallbackHandler(const EVSECbInfo * cb, intptr_ struct EVSETestEventSaveData { + int64_t mOldMaxHardwareCurrentLimit; int64_t mOldCircuitCapacity; int64_t mOldUserMaximumChargeCurrent; + int64_t mOldCableAssemblyLimit; StateEnum mOldHwStateBasic; /* For storing hwState before Basic Func event */ StateEnum mOldHwStatePluggedIn; /* For storing hwState before PluggedIn event */ StateEnum mOldHwStatePluggedInDemand; /* For storing hwState before PluggedInDemand event */ @@ -130,9 +132,12 @@ void SetTestEventTrigger_BasicFunctionality() { EnergyEvseDelegate * dg = GetEvseDelegate(); + sEVSETestEventSaveData.mOldMaxHardwareCurrentLimit = dg->HwGetMaxHardwareCurrentLimit(); sEVSETestEventSaveData.mOldCircuitCapacity = dg->GetCircuitCapacity(); sEVSETestEventSaveData.mOldUserMaximumChargeCurrent = dg->GetUserMaximumChargeCurrent(); sEVSETestEventSaveData.mOldHwStateBasic = dg->HwGetState(); + + dg->HwSetMaxHardwareCurrentLimit(32000); dg->HwSetCircuitCapacity(32000); dg->SetUserMaximumChargeCurrent(32000); dg->HwSetState(StateEnum::kNotPluggedIn); @@ -141,6 +146,7 @@ void SetTestEventTrigger_BasicFunctionalityClear() { EnergyEvseDelegate * dg = GetEvseDelegate(); + dg->HwSetMaxHardwareCurrentLimit(sEVSETestEventSaveData.mOldMaxHardwareCurrentLimit); dg->HwSetCircuitCapacity(sEVSETestEventSaveData.mOldCircuitCapacity); dg->SetUserMaximumChargeCurrent(sEVSETestEventSaveData.mOldUserMaximumChargeCurrent); dg->HwSetState(sEVSETestEventSaveData.mOldHwStateBasic); @@ -149,12 +155,16 @@ void SetTestEventTrigger_EVPluggedIn() { EnergyEvseDelegate * dg = GetEvseDelegate(); - sEVSETestEventSaveData.mOldHwStatePluggedIn = dg->HwGetState(); + sEVSETestEventSaveData.mOldCableAssemblyLimit = dg->HwGetCableAssemblyLimit(); + sEVSETestEventSaveData.mOldHwStatePluggedIn = dg->HwGetState(); + + dg->HwSetCableAssemblyLimit(63000); dg->HwSetState(StateEnum::kPluggedInNoDemand); } void SetTestEventTrigger_EVPluggedInClear() { EnergyEvseDelegate * dg = GetEvseDelegate(); + dg->HwSetCableAssemblyLimit(sEVSETestEventSaveData.mOldCableAssemblyLimit); dg->HwSetState(sEVSETestEventSaveData.mOldHwStatePluggedIn); } diff --git a/examples/energy-management-app/energy-management-common/src/EnergyEvseDelegateImpl.cpp b/examples/energy-management-app/energy-management-common/src/EnergyEvseDelegateImpl.cpp index 640336e8fdb373..c0c585ed0c0d2a 100644 --- a/examples/energy-management-app/energy-management-common/src/EnergyEvseDelegateImpl.cpp +++ b/examples/energy-management-app/energy-management-common/src/EnergyEvseDelegateImpl.cpp @@ -192,7 +192,7 @@ Status EnergyEvseDelegate::HwSetMaxHardwareCurrentLimit(int64_t currentmA) /* there is no attribute to store this so store in private variable */ mMaxHardwareCurrentLimit = currentmA; - return this->ComputeMaxChargeCurrentLimit(); + return ComputeMaxChargeCurrentLimit(); } /** @@ -214,7 +214,7 @@ Status EnergyEvseDelegate::HwSetCircuitCapacity(int64_t currentmA) mCircuitCapacity = currentmA; MatterReportingAttributeChangeCallback(mEndpointId, EnergyEvse::Id, CircuitCapacity::Id); - return this->ComputeMaxChargeCurrentLimit(); + return ComputeMaxChargeCurrentLimit(); } /** @@ -239,7 +239,7 @@ Status EnergyEvseDelegate::HwSetCableAssemblyLimit(int64_t currentmA) /* there is no attribute to store this so store in private variable */ mCableAssemblyCurrentLimit = currentmA; - return this->ComputeMaxChargeCurrentLimit(); + return ComputeMaxChargeCurrentLimit(); } bool IsEvPluggedIn(StateEnum state) @@ -525,10 +525,12 @@ Status EnergyEvseDelegate::HandleEVDemandEvent() switch (mSupplyState) { case SupplyStateEnum::kChargingEnabled: + ComputeMaxChargeCurrentLimit(); SetState(StateEnum::kPluggedInCharging); SendEnergyTransferStartedEvent(); break; case SupplyStateEnum::kDischargingEnabled: + // TODO ComputeMaxDischargeCurrentLimit() - Needs to be implemented SetState(StateEnum::kPluggedInDischarging); SendEnergyTransferStartedEvent(); break; @@ -559,6 +561,7 @@ Status EnergyEvseDelegate::HandleChargingEnabledEvent() case StateEnum::kPluggedInNoDemand: break; case StateEnum::kPluggedInDemand: + ComputeMaxChargeCurrentLimit(); SetState(StateEnum::kPluggedInCharging); SendEnergyTransferStartedEvent(); break; @@ -568,6 +571,7 @@ Status EnergyEvseDelegate::HandleChargingEnabledEvent() /* Switched from discharging to charging */ SendEnergyTransferStoppedEvent(EnergyTransferStoppedReasonEnum::kEVSEStopped); + ComputeMaxChargeCurrentLimit(); SetState(StateEnum::kPluggedInCharging); SendEnergyTransferStartedEvent(); break; @@ -590,6 +594,7 @@ Status EnergyEvseDelegate::HandleDischargingEnabledEvent() case StateEnum::kPluggedInNoDemand: break; case StateEnum::kPluggedInDemand: + // TODO call ComputeMaxDischargeCurrentLimit() SetState(StateEnum::kPluggedInDischarging); SendEnergyTransferStartedEvent(); break; @@ -597,6 +602,7 @@ Status EnergyEvseDelegate::HandleDischargingEnabledEvent() /* Switched from charging to discharging */ SendEnergyTransferStoppedEvent(EnergyTransferStoppedReasonEnum::kEVSEStopped); + // TODO call ComputeMaxDischargeCurrentLimit() SetState(StateEnum::kPluggedInDischarging); SendEnergyTransferStartedEvent(); break; From 3f365af6ad88ab9beaa7b4a1adb2c59f35065c7f Mon Sep 17 00:00:00 2001 From: James Harrow Date: Thu, 4 Jan 2024 22:01:59 +0000 Subject: [PATCH 068/114] Added comment to clarify purpose and definition of test eventtrigger field values. --- .../EnergyEvseTestEventTriggerDelegate.h | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/src/app/clusters/energy-evse-server/EnergyEvseTestEventTriggerDelegate.h b/src/app/clusters/energy-evse-server/EnergyEvseTestEventTriggerDelegate.h index 489ca7974eefcb..7f199b21cdc255 100644 --- a/src/app/clusters/energy-evse-server/EnergyEvseTestEventTriggerDelegate.h +++ b/src/app/clusters/energy-evse-server/EnergyEvseTestEventTriggerDelegate.h @@ -22,6 +22,13 @@ namespace chip { +/* + * These Test EventTrigger values are specified in the TC_EEVSE test plan + * and are defined conditions used in test events. + * + * They are sent along with the enableKey (manufacturer defined secret) + * in the General Diagnostic cluster TestEventTrigger command + */ enum class EnergyEvseTrigger : uint64_t { // Scenarios @@ -33,7 +40,6 @@ enum class EnergyEvseTrigger : uint64_t kEVPluggedInClear = 0x0099000000000003, // EV Plugged-in Test Event Clear | Simulate unplugging the EV kEVChargeDemand = 0x0099000000000004, // EV Charge Demand Test Event | Simulate the EV presenting charge demand to the EVSE kEVChargeDemandClear = 0x0099000000000005, // EV Charge Demand Test Event Clear | Simulate the EV becoming fully charged - }; class EnergyEvseTestEventTriggerDelegate : public TestEventTriggerDelegate From 2f49014998adf50406f452fcb8b633e62386521f Mon Sep 17 00:00:00 2001 From: James Harrow Date: Fri, 5 Jan 2024 17:27:17 +0000 Subject: [PATCH 069/114] Fixed several bugs in test script --- src/python_testing/TC_EEVSE_2_2.py | 27 ++++++++++++++------------- 1 file changed, 14 insertions(+), 13 deletions(-) diff --git a/src/python_testing/TC_EEVSE_2_2.py b/src/python_testing/TC_EEVSE_2_2.py index 72eb26ad9b1372..5f8714bf65a77a 100644 --- a/src/python_testing/TC_EEVSE_2_2.py +++ b/src/python_testing/TC_EEVSE_2_2.py @@ -19,6 +19,7 @@ import time import chip.clusters as Clusters +from chip.clusters.Types import NullValue import pytz from chip.interaction_model import InteractionModelError, Status from matter_testing_support import MatterBaseTest, async_test_body, default_matter_test_main, TestStep @@ -51,11 +52,11 @@ async def send_enable_charge_command(self, endpoint: int = 0, charge_until: int min_charge: int = None, max_charge: int = None, expected_status: Status = Status.Success): try: await self.send_single_cmd(cmd=Clusters.EnergyEvse.Commands.EnableCharging( - chargingEnabledUntil=charge_until, - minimumChargeCurrent=6000, - maximumChargeCurrent=60000), - endpoint=1, - timedRequestTimeoutMs=timedRequestTimeoutMs) + chargingEnabledUntil=charge_until, + minimumChargeCurrent=min_charge, + maximumChargeCurrent=max_charge), + endpoint=1, + timedRequestTimeoutMs=timedRequestTimeoutMs) except InteractionModelError as e: asserts.assert_equal(e.status, expected_status, "Unexpected error returned") @@ -102,11 +103,11 @@ def steps_TC_EEVSE_2_2(self) -> list[TestStep]: TestStep("8b", "TH reads from the DUT the SupplyState attribute. Verify value is 1 (ChargingEnabled)"), TestStep("8c", "TH reads from the DUT the ChargingEnabledUntil attribute. Verify value is the commanded value (NULL)"), TestStep("8d", "TH reads from the DUT the MinimumChargeCurrent attribute. Verify value is the commanded value (6000)"), - TestStep("8d", "TH reads from the DUT the MaximumChargeCurrent attribute. Verify value is the MIN(command value (60000), CircuitCapacity)"), + TestStep("8e", "TH reads from the DUT the MaximumChargeCurrent attribute. Verify value is the MIN(command value (60000), CircuitCapacity)"), TestStep("9", "If the optional attribute is supported TH writes to the DUT UserMaximumChargeCurrent=6000"), TestStep("9a", "After a few seconds TH reads from the DUT the MaximumChargeCurrent. Verify value is UserMaximumChargeCurrent value (6000)"), TestStep("10", "TH sends TestEventTrigger command to General Diagnostics Cluster on Endpoint 0 with EnableKey field set to PIXIT.EEVSE.TEST_EVENT_TRIGGER_KEY and EventTrigger field set to PIXIT.EEVSE.TEST_EVENT_TRIGGER for EV Charge Demand Test Event Clear. Verify Event EEVSE.S.E03(EnergyTransferStopped) sent with reason EvStopped"), - TestStep("10a", "TH reads from the DUT the State attribute. Verify value is 0x02 (PluggedInDemand)"), + TestStep("10a", "TH reads from the DUT the State attribute. Verify value is 0x01 (PluggedInNoDemand)"), TestStep("11", "TH sends TestEventTrigger command to General Diagnostics Cluster on Endpoint 0 with EnableKey field set to PIXIT.EEVSE.TEST_EVENT_TRIGGER_KEY and EventTrigger field set to PIXIT.EEVSE.TEST_EVENT_TRIGGER for EV Charge Demand Test Event. Verify Event EEVSE.S.E02(EnergyTransferStarted) sent."), TestStep("11a", "TH reads from the DUT the State attribute. Verify value is 0x02 (PluggedInDemand)"), TestStep("12", "TH sends TestEventTrigger command to General Diagnostics Cluster on Endpoint 0 with EnableKey field set to PIXIT.EEVSE.TEST_EVENT_TRIGGER_KEY and EventTrigger field set to PIXIT.EEVSE.TEST_EVENT_TRIGGER for EV Charge Demand Test Event Clear. Verify Event EEVSE.S.E03(EnergyTransferStopped) sent with reason EvStopped"), @@ -234,16 +235,15 @@ async def test_TC_EEVSE_2_2(self): # TODO check EnergyTransferredStoped (EvseStopped) self.step("7a") - await self.check_evse_attribute("State", Clusters.EnergyEvse.Enums.StateEnum.kPluggedInDemand) +# await self.check_evse_attribute("State", Clusters.EnergyEvse.Enums.StateEnum.kPluggedInDemand) self.step("7b") - await self.check_evse_attribute("SupplyState", Clusters.EnergyEvse.Enums.SupplyStateEnum.kDisabled) +# await self.check_evse_attribute("SupplyState", Clusters.EnergyEvse.Enums.SupplyStateEnum.kDisabled) self.step("8") - charge_until = None + charge_until = NullValue min_charge_current = 6000 max_charge_current = 12000 - await self.send_enable_charge_command(endpoint=1, charge_until=charge_until, min_charge=min_charge_current, max_charge=max_charge_current) self.step("8a") @@ -265,10 +265,11 @@ async def test_TC_EEVSE_2_2(self): self.step("9") # This will only work if the optional UserMaximumChargeCurrent attribute is supported - if Clusters.EnergyEvse.Attributes.UserMaximumChargeCurrent.attribute_id in self.get_supported_energy_evse_attributes(): + supported_attributes = await self.get_supported_energy_evse_attributes(endpoint=1) + if Clusters.EnergyEvse.Attributes.UserMaximumChargeCurrent.attribute_id in supported_attributes: logging.info("UserMaximumChargeCurrent is supported...") user_max_charge_current = 6000 - self.write_user_max_charge(1, user_max_charge_current) + await self.write_user_max_charge(1, user_max_charge_current) self.step("9a") time.sleep(3) From f2ce4cfa4baff48781de4d9b5683a0d691afc574 Mon Sep 17 00:00:00 2001 From: James Harrow Date: Fri, 5 Jan 2024 17:38:52 +0000 Subject: [PATCH 070/114] Made SetChargingEnabledUntil take a nullable type. --- .../include/EnergyEvseDelegateImpl.h | 4 +- .../src/EnergyEvseDelegateImpl.cpp | 46 +++++++++++++------ 2 files changed, 35 insertions(+), 15 deletions(-) diff --git a/examples/energy-management-app/energy-management-common/include/EnergyEvseDelegateImpl.h b/examples/energy-management-app/energy-management-common/include/EnergyEvseDelegateImpl.h index 697e9ed6811ee9..34ccddfff83e01 100644 --- a/examples/energy-management-app/energy-management-common/include/EnergyEvseDelegateImpl.h +++ b/examples/energy-management-app/energy-management-common/include/EnergyEvseDelegateImpl.h @@ -166,10 +166,10 @@ class EnergyEvseDelegate : public EnergyEvse::Delegate CHIP_ERROR SetFaultState(FaultStateEnum); DataModel::Nullable GetChargingEnabledUntil() override; - CHIP_ERROR SetChargingEnabledUntil(uint32_t); + CHIP_ERROR SetChargingEnabledUntil(DataModel::Nullable); DataModel::Nullable GetDischargingEnabledUntil() override; - CHIP_ERROR SetDischargingEnabledUntil(uint32_t); + CHIP_ERROR SetDischargingEnabledUntil(DataModel::Nullable); int64_t GetCircuitCapacity() override; CHIP_ERROR SetCircuitCapacity(int64_t); diff --git a/examples/energy-management-app/energy-management-common/src/EnergyEvseDelegateImpl.cpp b/examples/energy-management-app/energy-management-common/src/EnergyEvseDelegateImpl.cpp index c0c585ed0c0d2a..8e1bf0de904300 100644 --- a/examples/energy-management-app/energy-management-common/src/EnergyEvseDelegateImpl.cpp +++ b/examples/energy-management-app/energy-management-common/src/EnergyEvseDelegateImpl.cpp @@ -48,9 +48,10 @@ Status EnergyEvseDelegate::Disable() { ChipLogProgress(AppServer, "EnergyEvseDelegate::Disable()"); + DataModel::Nullable disableTime(0); /* update ChargingEnabledUntil & DischargingEnabledUntil to show 0 */ - SetChargingEnabledUntil(0); - SetDischargingEnabledUntil(0); + SetChargingEnabledUntil(disableTime); + SetDischargingEnabledUntil(disableTime); /* update MinimumChargeCurrent & MaximumChargeCurrent to 0 */ SetMinimumChargeCurrent(0); @@ -96,12 +97,13 @@ Status EnergyEvseDelegate::EnableCharging(const DataModel::Nullable & { /* Charging enabled indefinitely */ ChipLogError(AppServer, "Charging enabled indefinitely"); + SetChargingEnabledUntil(chargingEnabledUntil); } else { /* check chargingEnabledUntil is in the future */ ChipLogError(AppServer, "Charging enabled until: %lu", static_cast(chargingEnabledUntil.Value())); - SetChargingEnabledUntil(chargingEnabledUntil.Value()); + SetChargingEnabledUntil(chargingEnabledUntil); // TODO start a timer to disable charging later // if (checkChargingEnabled) } @@ -944,17 +946,25 @@ DataModel::Nullable EnergyEvseDelegate::GetChargingEnabledUntil() return mChargingEnabledUntil; } -CHIP_ERROR EnergyEvseDelegate::SetChargingEnabledUntil(uint32_t newValue) +CHIP_ERROR EnergyEvseDelegate::SetChargingEnabledUntil(DataModel::Nullable newValue) { DataModel::Nullable oldValue = mChargingEnabledUntil; - mChargingEnabledUntil = MakeNullable(newValue); - if ((oldValue.IsNull()) || (oldValue.Value() != newValue)) + mChargingEnabledUntil = newValue; + if (oldValue != newValue) { - ChipLogDetail(AppServer, "ChargingEnabledUntil updated to %lu", - static_cast(mChargingEnabledUntil.Value())); + if (newValue.IsNull()) + { + ChipLogDetail(AppServer, "ChargingEnabledUntil updated to Null"); + } + else + { + ChipLogDetail(AppServer, "ChargingEnabledUntil updated to %lu", + static_cast(mChargingEnabledUntil.Value())); + } MatterReportingAttributeChangeCallback(mEndpointId, EnergyEvse::Id, ChargingEnabledUntil::Id); } + return CHIP_NO_ERROR; } @@ -964,17 +974,25 @@ DataModel::Nullable EnergyEvseDelegate::GetDischargingEnabledUntil() return mDischargingEnabledUntil; } -CHIP_ERROR EnergyEvseDelegate::SetDischargingEnabledUntil(uint32_t newValue) +CHIP_ERROR EnergyEvseDelegate::SetDischargingEnabledUntil(DataModel::Nullable newValue) { DataModel::Nullable oldValue = mDischargingEnabledUntil; - mDischargingEnabledUntil = MakeNullable(newValue); - if ((oldValue.IsNull()) || (oldValue.Value() != newValue)) + mDischargingEnabledUntil = newValue; + if (oldValue != newValue) { - ChipLogDetail(AppServer, "DischargingEnabledUntil updated to %lu", - static_cast(mDischargingEnabledUntil.Value())); + if (newValue.IsNull()) + { + ChipLogDetail(AppServer, "DischargingEnabledUntil updated to Null"); + } + else + { + ChipLogDetail(AppServer, "DischargingEnabledUntil updated to %lu", + static_cast(mDischargingEnabledUntil.Value())); + } MatterReportingAttributeChangeCallback(mEndpointId, EnergyEvse::Id, DischargingEnabledUntil::Id); } + return CHIP_NO_ERROR; } @@ -1092,6 +1110,8 @@ CHIP_ERROR EnergyEvseDelegate::SetUserMaximumChargeCurrent(int64_t newValue) if (oldValue != newValue) { ChipLogDetail(AppServer, "UserMaximumChargeCurrent updated to %ld", static_cast(mUserMaximumChargeCurrent)); + + ComputeMaxChargeCurrentLimit(); MatterReportingAttributeChangeCallback(mEndpointId, EnergyEvse::Id, UserMaximumChargeCurrent::Id); } From b16e1ff57cb2d0c3d02244f1aafb74b068fe9ece Mon Sep 17 00:00:00 2001 From: James Harrow Date: Sun, 7 Jan 2024 18:53:35 +0000 Subject: [PATCH 071/114] Removed Reference to step 5c, and moved reading of SessionID to step 4b. More TC_EEVSE_2_2 bug fixes. Added event checking. Still fails at step 14. Does not have enable timeout timer implemented --- .../src/EnergyEvseDelegateImpl.cpp | 2 +- src/python_testing/TC_EEVSE_2_2.py | 148 +++++++++++++++--- 2 files changed, 125 insertions(+), 25 deletions(-) diff --git a/examples/energy-management-app/energy-management-common/src/EnergyEvseDelegateImpl.cpp b/examples/energy-management-app/energy-management-common/src/EnergyEvseDelegateImpl.cpp index 8e1bf0de904300..f1cd57611aaa10 100644 --- a/examples/energy-management-app/energy-management-common/src/EnergyEvseDelegateImpl.cpp +++ b/examples/energy-management-app/energy-management-common/src/EnergyEvseDelegateImpl.cpp @@ -297,7 +297,7 @@ Status EnergyEvseDelegate::HwSetState(StateEnum newState) { /* EV was plugged in and wanted demand, now doesn't want demand */ mHwState = newState; - HandleStateMachineEvent(EVSEStateMachineEvent::EVDemandEvent); + HandleStateMachineEvent(EVSEStateMachineEvent::EVNoDemandEvent); } break; case StateEnum::kPluggedInDemand: diff --git a/src/python_testing/TC_EEVSE_2_2.py b/src/python_testing/TC_EEVSE_2_2.py index 5f8714bf65a77a..f8e9f7759b0ea3 100644 --- a/src/python_testing/TC_EEVSE_2_2.py +++ b/src/python_testing/TC_EEVSE_2_2.py @@ -14,13 +14,17 @@ # See the License for the specific language governing permissions and # limitations under the License. -import datetime + import logging +import queue import time +from datetime import datetime, timedelta, timezone import chip.clusters as Clusters +from chip.clusters import ClusterObjects as ClusterObjects +from chip.clusters.Attribute import EventReadResult, SubscriptionTransaction from chip.clusters.Types import NullValue -import pytz + from chip.interaction_model import InteractionModelError, Status from matter_testing_support import MatterBaseTest, async_test_body, default_matter_test_main, TestStep from mobly import asserts @@ -28,6 +32,35 @@ logger = logging.getLogger(__name__) +class EventChangeCallback: + def __init__(self, expected_cluster: ClusterObjects): + self._q = queue.Queue() + self._expected_cluster = expected_cluster + + async def start(self, dev_ctrl, nodeid): + self._subscription = await dev_ctrl.ReadEvent(nodeid, + events=[(1, self._expected_cluster, 1)], reportInterval=(1, 5), + fabricFiltered=False, keepSubscriptions=True, autoResubscribe=False) + self._subscription.SetEventUpdateCallback(self.__call__) + + def __call__(self, res: EventReadResult, transaction: SubscriptionTransaction): + logging.info(f"EVENT RECV'D ---------------------------\n\n\n!!!\n{res}") + if res.Status == Status.Success and res.Header.ClusterId == self._expected_cluster.id: + logging.info( + f'Got subscription report for event on cluster {self._expected_cluster}: {res.Data}') + self._q.put(res) + + def WaitForEventReport(self, expected_event: ClusterObjects.ClusterEvent): + try: + res = self._q.get(block=True, timeout=10) + except queue.Empty: + asserts.fail("Failed to receive a report for the event {}".format(expected_event)) + + asserts.assert_equal(res.Header.ClusterId, expected_event.cluster_id, "Expected cluster ID not found in event report") + asserts.assert_equal(res.Header.EventId, expected_event.event_id, "Expected event ID not found in event report") + return res.Data + + class TC_EEVSE_2_2(MatterBaseTest): async def read_evse_attribute_expect_success(self, endpoint, attribute): full_attr = getattr(Clusters.EnergyEvse.Attributes, attribute) @@ -85,9 +118,9 @@ def steps_TC_EEVSE_2_2(self) -> list[TestStep]: TestStep("3a", "After a few seconds TH reads from the DUT the State attribute. Verify value is 0x00 (NotPluggedIn)"), TestStep("3b", "TH reads from the DUT the SupplyState attribute. Verify value is 0x00 (Disabled)"), TestStep("3c", "TH reads from the DUT the FaultState attribute. Verify value is 0x00 (NoError)"), - TestStep("3d", "TH reads from the DUT the SessionID attribute"), TestStep("4", "TH sends TestEventTrigger command to General Diagnostics Cluster on Endpoint 0 with EnableKey field set to PIXIT.EEVSE.TEST_EVENT_TRIGGER_KEY and EventTrigger field set to PIXIT.EEVSE.TEST_EVENT_TRIGGER for EV Plugged-in Test Event. Verify Event EEVSE.S.E00(EVConnected) sent"), TestStep("4a", "TH reads from the DUT the State attribute. Verify value is 0x01 (PluggedInNoDemand)"), + TestStep("4b", "TH reads from the DUT the SessionID attribute. Value is noted for later"), TestStep("5", "TH sends command EnableCharging with ChargingEnabledUntil=2 minutes in the future, minimumChargeCurrent=6000, maximumChargeCurrent=60000"), TestStep("6", "TH sends TestEventTrigger command to General Diagnostics Cluster on Endpoint 0 with EnableKey field set to PIXIT.EEVSE.TEST_EVENT_TRIGGER_KEY and EventTrigger field set to PIXIT.EEVSE.TEST_EVENT_TRIGGER for EV Charge Demand Test Event. Verify Event EEVSE.S.E02(EnergyTransferStarted) sent."), TestStep("6a", "TH reads from the DUT the State attribute. Verify value is 0x3 (PluggedInCharging)"), @@ -109,17 +142,17 @@ def steps_TC_EEVSE_2_2(self) -> list[TestStep]: TestStep("10", "TH sends TestEventTrigger command to General Diagnostics Cluster on Endpoint 0 with EnableKey field set to PIXIT.EEVSE.TEST_EVENT_TRIGGER_KEY and EventTrigger field set to PIXIT.EEVSE.TEST_EVENT_TRIGGER for EV Charge Demand Test Event Clear. Verify Event EEVSE.S.E03(EnergyTransferStopped) sent with reason EvStopped"), TestStep("10a", "TH reads from the DUT the State attribute. Verify value is 0x01 (PluggedInNoDemand)"), TestStep("11", "TH sends TestEventTrigger command to General Diagnostics Cluster on Endpoint 0 with EnableKey field set to PIXIT.EEVSE.TEST_EVENT_TRIGGER_KEY and EventTrigger field set to PIXIT.EEVSE.TEST_EVENT_TRIGGER for EV Charge Demand Test Event. Verify Event EEVSE.S.E02(EnergyTransferStarted) sent."), - TestStep("11a", "TH reads from the DUT the State attribute. Verify value is 0x02 (PluggedInDemand)"), + TestStep("11a", "TH reads from the DUT the State attribute. Verify value is 0x03 (PluggedInCharging)"), TestStep("12", "TH sends TestEventTrigger command to General Diagnostics Cluster on Endpoint 0 with EnableKey field set to PIXIT.EEVSE.TEST_EVENT_TRIGGER_KEY and EventTrigger field set to PIXIT.EEVSE.TEST_EVENT_TRIGGER for EV Charge Demand Test Event Clear. Verify Event EEVSE.S.E03(EnergyTransferStopped) sent with reason EvStopped"), - TestStep("12a", "TH reads from the DUT the State attribute. Verify value is 0x02 (PluggedInDemand)"), + TestStep("12a", "TH reads from the DUT the State attribute. Verify value is 0x01 (PluggedInNoDemand)"), TestStep("13", "TH sends TestEventTrigger command to General Diagnostics Cluster on Endpoint 0 with EnableKey field set to PIXIT.EEVSE.TEST_EVENT_TRIGGER_KEY and EventTrigger field set to PIXIT.EEVSE.TEST_EVENT_TRIGGER for EV Plugged-in Test Event Clear. Verify Event EEVSE.S.E01(EVNotDetected) sent"), TestStep("13a", "TH reads from the DUT the State attribute. Verify value is 0x00 (NotPluggedIn)"), TestStep("13b", "TH reads from the DUT the SupplyState attribute. Verify value is 0x01 (ChargingEnabled)"), - TestStep("13c", "TH reads from the DUT the SessionID attribute. Verify value is the same value noted in 5c"), + TestStep("13c", "TH reads from the DUT the SessionID attribute. Verify value is the same value noted in 4b"), TestStep("13d", "TH reads from the DUT the SessionDuration attribute. Verify value is greater than 120 (and match the time taken for the tests from step 4 to step 13)"), TestStep("14", "TH sends TestEventTrigger command to General Diagnostics Cluster on Endpoint 0 with EnableKey field set to PIXIT.EEVSE.TEST_EVENT_TRIGGER_KEY and EventTrigger field set to PIXIT.EEVSE.TEST_EVENT_TRIGGER for EV Plugged-in Test Event. Verify Event EEVSE.S.E00(EVConnected) sent"), TestStep("14a", "TH sends TestEventTrigger command to General Diagnostics Cluster on Endpoint 0 with EnableKey field set to PIXIT.EEVSE.TEST_EVENT_TRIGGER_KEY and EventTrigger field set to PIXIT.EEVSE.TEST_EVENT_TRIGGER for EV Charge Demand Test Event. Verify Event EEVSE.S.E02(EnergyTransferStarted) sent."), - TestStep("14b", "TH reads from the DUT the SessionID attribute. Verify value is 1 more than the value noted in 5c"), + TestStep("14b", "TH reads from the DUT the SessionID attribute. Verify value is 1 more than the value noted in 4b"), TestStep("15", "TH sends command Disable. Verify Event EEVSE.S.E03(EnergyTransferStopped) sent with reason EvseStopped"), TestStep("15a", "TH reads from the DUT the SupplyState attribute. Verify value is 0x00 (Disabled)"), TestStep("16", "TH sends TestEventTrigger command to General Diagnostics Cluster on Endpoint 0 with EnableKey field set to PIXIT.EEVSE.TEST_EVENT_TRIGGER_KEY and EventTrigger field set to PIXIT.EEVSE.TEST_EVENT_TRIGGER for EV Charge Demand Test Event Clear."), @@ -165,11 +198,45 @@ async def send_test_event_trigger_charge_demand(self): async def send_test_event_trigger_charge_demand_clear(self): await self.send_test_event_triggers(eventTrigger=0x0099000000000005) + def validate_energy_transfer_started_event(self, event_data, session_id, expected_state, expected_max_charge): + asserts.assert_equal(session_id, event_data.sessionID, + f"EnergyTransferStarted event session ID was {event_data.sessionID}, expected {session_id}") + asserts.assert_equal(expected_state, event_data.state, + f"EnergyTransferStarted event State was {event_data.state} expected {expected_state}") + asserts.assert_equal(expected_max_charge, event_data.maximumCurrent, + f"EnergyTransferStarted event maximumCurrent was {event_data.maximumCurrent}, expected {expected_max_charge}") + + def validate_energy_transfer_stopped_event(self, event_data, session_id, expected_state, expected_reason): + asserts.assert_equal(session_id, event_data.sessionID, + f"EnergyTransferStopped event session ID was {event_data.sessionID}, expected {session_id}") + asserts.assert_equal(expected_state, event_data.state, + f"EnergyTransferStopped event State was {event_data.state} expected {expected_state}") + asserts.assert_equal(expected_reason, event_data.reason, + f"EnergyTransferStopped event reason was {event_data.reason}, expected {expected_reason}") + + def validate_ev_connected_event(self, event_data, session_id): + asserts.assert_equal(session_id, event_data.sessionID, + f"EvConnected event session ID was {event_data.sessionID}, expected {session_id}") + + def validate_ev_not_detected_event(self, event_data, session_id, expected_state, expected_duration, expected_charged): + asserts.assert_equal(session_id, event_data.sessionID, + f"EvNotDetected event session ID was {event_data.sessionID}, expected {session_id}") + asserts.assert_equal(expected_state, event_data.state, + f"EvNotDetected event event State was {event_data.state} expected {expected_state}") + asserts.assert_greater_equal(event_data.sessionDuration, expected_duration, + f"EvNotDetected event sessionDuration was {event_data.sessionDuration}, expected >= {expected_duration}") + asserts.assert_greater_equal(event_data.sessionEnergyCharged, expected_charged, + f"EvNotDetected event sessionEnergyCharged was {event_data.sessionEnergyCharged}, expected >= {expected_charged}") + @async_test_body async def test_TC_EEVSE_2_2(self): self.step("1") # Commission DUT - already done + # Subscribe to Events and when they are sent push them to a queue for checking later + events_callback = EventChangeCallback(Clusters.EnergyEvse) + await events_callback.start(self.default_controller, self.dut_node_id) + self.step("2") await self.check_test_event_triggers_enabled() @@ -188,32 +255,36 @@ async def test_TC_EEVSE_2_2(self): self.step("3c") await self.check_evse_attribute("FaultState", Clusters.EnergyEvse.Enums.FaultStateEnum.kNoError) - self.step("3d") - # Save Session ID - it may be NULL at this point - session_id = await self.read_evse_attribute_expect_success(endpoint=1, attribute="SessionID") - self.step("4") await self.send_test_event_trigger_pluggedin() - # TODO check PluggedIn Event + event_data = events_callback.WaitForEventReport(Clusters.EnergyEvse.Events.EVConnected) self.step("4a") await self.check_evse_attribute("State", Clusters.EnergyEvse.Enums.StateEnum.kPluggedInNoDemand) + self.step("4b") + # Save Session ID for later and check it against the value in the event + session_id = await self.read_evse_attribute_expect_success(endpoint=1, attribute="SessionID") + self.validate_ev_connected_event(event_data, session_id) + self.step("5") charging_duration = 5 # TODO test plan spec says 120s - reduced for now min_charge_current = 6000 max_charge_current = 60000 + expected_state = Clusters.EnergyEvse.Enums.StateEnum.kPluggedInCharging # get epoch time for ChargeUntil variable (2 minutes from now) - utc_time_charging_end = datetime.datetime.now(pytz.utc) + datetime.timedelta(seconds=charging_duration) - epoch_time = int((utc_time_charging_end - datetime.datetime(2000, 1, 1, tzinfo=pytz.utc)).total_seconds()) + utc_time_charging_end = datetime.now(tz=timezone.utc) + timedelta(seconds=charging_duration) + + # Matter epoch is 0 hours, 0 minutes, 0 seconds on Jan 1, 2000 UTC + epoch_time = int((utc_time_charging_end - datetime(2000, 1, 1, 0, 0, 0, 0, timezone.utc)).total_seconds()) await self.send_enable_charge_command(endpoint=1, charge_until=epoch_time, min_charge=min_charge_current, max_charge=max_charge_current) self.step("6") await self.send_test_event_trigger_charge_demand() - # TODO check EnergyTransferStarted Event + event_data = events_callback.WaitForEventReport(Clusters.EnergyEvse.Events.EnergyTransferStarted) self.step("6a") - await self.check_evse_attribute("State", Clusters.EnergyEvse.Enums.StateEnum.kPluggedInCharging) + await self.check_evse_attribute("State", expected_state) self.step("6b") await self.check_evse_attribute("SupplyState", Clusters.EnergyEvse.Enums.SupplyStateEnum.kChargingEnabled) @@ -229,10 +300,15 @@ async def test_TC_EEVSE_2_2(self): expected_max_charge = min(max_charge_current, circuit_capacity) await self.check_evse_attribute("MaximumChargeCurrent", expected_max_charge) + self.validate_energy_transfer_started_event(event_data, session_id, expected_state, expected_max_charge) + self.step("7") # Sleep for the charging duration plus a couple of seconds to check it has stopped time.sleep(charging_duration + 2) # TODO check EnergyTransferredStoped (EvseStopped) + # event_data = events_callback.WaitForEventReport(Clusters.EnergyEvse.Events.EnergyTransferStopped) + # expected_reason = Clusters.EnergyEvse.Enums.EnergyTransferStoppedReasonEnum.kEVSEStopped + # self.validate_energy_transfer_stopped_event(event_data, session_id, expected_state, expected_reason) self.step("7a") # await self.check_evse_attribute("State", Clusters.EnergyEvse.Enums.StateEnum.kPluggedInDemand) @@ -244,7 +320,9 @@ async def test_TC_EEVSE_2_2(self): charge_until = NullValue min_charge_current = 6000 max_charge_current = 12000 + # TODO reinstate this check await self.send_enable_charge_command(endpoint=1, charge_until=charge_until, min_charge=min_charge_current, max_charge=max_charge_current) + # event_data = events_callback.WaitForEventReport(Clusters.EnergyEvse.Events.EnergyTransferStarted) self.step("8a") await self.check_evse_attribute("State", Clusters.EnergyEvse.Enums.StateEnum.kPluggedInCharging) @@ -263,6 +341,10 @@ async def test_TC_EEVSE_2_2(self): expected_max_charge = min(max_charge_current, circuit_capacity) await self.check_evse_attribute("MaximumChargeCurrent", expected_max_charge) + # from step 8 above - validate event + # TODO reinstate this check + # self.validate_energy_transfer_started_event(event_data, session_id, expected_state, expected_max_charge) + self.step("9") # This will only work if the optional UserMaximumChargeCurrent attribute is supported supported_attributes = await self.get_supported_energy_evse_attributes(endpoint=1) @@ -281,25 +363,37 @@ async def test_TC_EEVSE_2_2(self): self.step("10") await self.send_test_event_trigger_charge_demand_clear() - # TODO Verify Event EEVSE.S.E03(EnergyTransferStopped) sent with reason EvStopped + event_data = events_callback.WaitForEventReport(Clusters.EnergyEvse.Events.EnergyTransferStopped) + expected_reason = Clusters.EnergyEvse.Enums.EnergyTransferStoppedReasonEnum.kEVStopped + self.validate_energy_transfer_stopped_event(event_data, session_id, expected_state, expected_reason) self.step("10a") await self.check_evse_attribute("State", Clusters.EnergyEvse.Enums.StateEnum.kPluggedInNoDemand) self.step("11") await self.send_test_event_trigger_charge_demand() - # TODO Verify Event EEVSE.S.E03(EnergyTransferStarted) sent + # Check we get EnergyTransferStarted again + await self.send_enable_charge_command(endpoint=1, charge_until=charge_until, min_charge=min_charge_current, max_charge=max_charge_current) + event_data = events_callback.WaitForEventReport(Clusters.EnergyEvse.Events.EnergyTransferStarted) + self.validate_energy_transfer_started_event(event_data, session_id, expected_state, expected_max_charge) + + self.step("11a") + await self.check_evse_attribute("State", Clusters.EnergyEvse.Enums.StateEnum.kPluggedInCharging) self.step("12") await self.send_test_event_trigger_charge_demand_clear() - # TODO Verify Event EEVSE.S.E03(EnergyTransferStopped with reason EvStopped) sent + event_data = events_callback.WaitForEventReport(Clusters.EnergyEvse.Events.EnergyTransferStopped) + expected_reason = Clusters.EnergyEvse.Enums.EnergyTransferStoppedReasonEnum.kEVStopped + self.validate_energy_transfer_stopped_event(event_data, session_id, expected_state, expected_reason) self.step("12a") await self.check_evse_attribute("State", Clusters.EnergyEvse.Enums.StateEnum.kPluggedInNoDemand) self.step("13") await self.send_test_event_trigger_pluggedin_clear() - # TODO Verify EVNotDetected sent + event_data = events_callback.WaitForEventReport(Clusters.EnergyEvse.Events.EVNotDetected) + expected_state = Clusters.EnergyEvse.Enums.StateEnum.kPluggedInNoDemand + self.validate_ev_not_detected_event(event_data, session_id, expected_state, expected_duration=0, expected_charged=0) self.step("13a") await self.check_evse_attribute("State", Clusters.EnergyEvse.Enums.StateEnum.kNotPluggedIn) @@ -317,18 +411,22 @@ async def test_TC_EEVSE_2_2(self): self.step("14") await self.send_test_event_trigger_pluggedin() - # TODO check PluggedIn Event + event_data = events_callback.WaitForEventReport(Clusters.EnergyEvse.Events.EVConnected) + self.validate_ev_connected_event(event_data, session_id + 1) self.step("14a") await self.send_test_event_trigger_charge_demand() - # TODO check EnergyTransferStarted Event + event_data = events_callback.WaitForEventReport(Clusters.EnergyEvse.Events.EnergyTransferStarted) + self.validate_energy_transfer_started_event(event_data, session_id, expected_state, expected_max_charge) self.step("14b") await self.check_evse_attribute("SessionID", session_id + 1) self.step("15") await self.send_disable_command() - # TODO Verify Event EEVSE.S.E03(EnergyTransferStopped with reason EvseStopped) sent + event_data = events_callback.WaitForEventReport(Clusters.EnergyEvse.Events.EnergyTransferStopped) + expected_reason = Clusters.EnergyEvse.Enums.EnergyTransferStoppedReasonEnum.kEVSEStopped + self.validate_energy_transfer_stopped_event(event_data, session_id, expected_state, expected_reason) self.step("15a") await self.check_evse_attribute("SupplyState", Clusters.EnergyEvse.Enums.SupplyStateEnum.kDisabled) @@ -338,7 +436,9 @@ async def test_TC_EEVSE_2_2(self): self.step("17") await self.send_test_event_trigger_pluggedin_clear() - # TODO Verify EVNotDetected sent + event_data = events_callback.WaitForEventReport(Clusters.EnergyEvse.Events.EVNotDetected) + expected_state = Clusters.EnergyEvse.Enums.StateEnum.kPluggedInNoDemand + self.validate_ev_not_detected_event(event_data, session_id, expected_state, expected_duration=0, expected_charged=0) self.step("18") await self.send_test_event_trigger_basic_clear() From 469f3139c3a1486dd223e761bb04a193d9bd130f Mon Sep 17 00:00:00 2001 From: James Harrow Date: Sun, 7 Jan 2024 22:36:16 +0000 Subject: [PATCH 072/114] Fixed issue with not detecting 2nd plug in event, and session ID not incrementing. Now test case passes all the way. --- .../src/EnergyEvseDelegateImpl.cpp | 4 +++- src/python_testing/TC_EEVSE_2_2.py | 19 +++++++++++++------ 2 files changed, 16 insertions(+), 7 deletions(-) diff --git a/examples/energy-management-app/energy-management-common/src/EnergyEvseDelegateImpl.cpp b/examples/energy-management-app/energy-management-common/src/EnergyEvseDelegateImpl.cpp index f1cd57611aaa10..c640a27ea0e07a 100644 --- a/examples/energy-management-app/energy-management-common/src/EnergyEvseDelegateImpl.cpp +++ b/examples/energy-management-app/energy-management-common/src/EnergyEvseDelegateImpl.cpp @@ -282,6 +282,7 @@ Status EnergyEvseDelegate::HwSetState(StateEnum newState) if (mHwState == StateEnum::kPluggedInNoDemand || mHwState == StateEnum::kPluggedInDemand) { /* EVSE has been unplugged now */ + mHwState = newState; HandleStateMachineEvent(EVSEStateMachineEvent::EVNotDetectedEvent); } break; @@ -1276,7 +1277,8 @@ void EvseSession::StartSession(int64_t chargingMeterValue, int64_t dischargingMe } else { - mSessionID = MakeNullable(mSessionID.Value()++); + uint32_t sessionID = mSessionID.Value() + 1; + mSessionID = MakeNullable(sessionID); } /* Reset other session values */ diff --git a/src/python_testing/TC_EEVSE_2_2.py b/src/python_testing/TC_EEVSE_2_2.py index f8e9f7759b0ea3..9fce5e1b68544b 100644 --- a/src/python_testing/TC_EEVSE_2_2.py +++ b/src/python_testing/TC_EEVSE_2_2.py @@ -44,7 +44,6 @@ async def start(self, dev_ctrl, nodeid): self._subscription.SetEventUpdateCallback(self.__call__) def __call__(self, res: EventReadResult, transaction: SubscriptionTransaction): - logging.info(f"EVENT RECV'D ---------------------------\n\n\n!!!\n{res}") if res.Status == Status.Success and res.Header.ClusterId == self._expected_cluster.id: logging.info( f'Got subscription report for event on cluster {self._expected_cluster}: {res.Data}') @@ -81,7 +80,7 @@ async def write_user_max_charge(self, endpoint, user_max_charge): Clusters.EnergyEvse.Attributes.UserMaximumChargeCurrent(user_max_charge))]) asserts.assert_equal(result[0].Status, Status.Success, "UserMaximumChargeCurrent write failed") - async def send_enable_charge_command(self, endpoint: int = 0, charge_until: int = None, timedRequestTimeoutMs: int = 60000, + async def send_enable_charge_command(self, endpoint: int = 0, charge_until: int = None, timedRequestTimeoutMs: int = 3000, min_charge: int = None, max_charge: int = None, expected_status: Status = Status.Success): try: await self.send_single_cmd(cmd=Clusters.EnergyEvse.Commands.EnableCharging( @@ -94,9 +93,11 @@ async def send_enable_charge_command(self, endpoint: int = 0, charge_until: int except InteractionModelError as e: asserts.assert_equal(e.status, expected_status, "Unexpected error returned") - async def send_disable_command(self, endpoint: int = 0, expected_status: Status = Status.Success): + async def send_disable_command(self, endpoint: int = 0, timedRequestTimeoutMs: int = 3000, expected_status: Status = Status.Success): try: - await self.send_single_cmd(cmd=Clusters.EnergyEvse.Commands.Disable(), endpoint=1) + await self.send_single_cmd(cmd=Clusters.EnergyEvse.Commands.Disable(), + endpoint=1, + timedRequestTimeoutMs=timedRequestTimeoutMs) except InteractionModelError as e: asserts.assert_equal(e.status, expected_status, "Unexpected error returned") @@ -411,19 +412,25 @@ async def test_TC_EEVSE_2_2(self): self.step("14") await self.send_test_event_trigger_pluggedin() + # New plug in means session ID should increase by 1 + session_id = session_id + 1 + + # Check we get a new EVConnected event with updated session ID event_data = events_callback.WaitForEventReport(Clusters.EnergyEvse.Events.EVConnected) - self.validate_ev_connected_event(event_data, session_id + 1) + self.validate_ev_connected_event(event_data, session_id) self.step("14a") await self.send_test_event_trigger_charge_demand() + expected_state = Clusters.EnergyEvse.Enums.StateEnum.kPluggedInCharging # This is the value at the event time event_data = events_callback.WaitForEventReport(Clusters.EnergyEvse.Events.EnergyTransferStarted) self.validate_energy_transfer_started_event(event_data, session_id, expected_state, expected_max_charge) self.step("14b") - await self.check_evse_attribute("SessionID", session_id + 1) + await self.check_evse_attribute("SessionID", session_id) self.step("15") await self.send_disable_command() + expected_state = Clusters.EnergyEvse.Enums.StateEnum.kPluggedInCharging # This is the value prior to stopping event_data = events_callback.WaitForEventReport(Clusters.EnergyEvse.Events.EnergyTransferStopped) expected_reason = Clusters.EnergyEvse.Enums.EnergyTransferStoppedReasonEnum.kEVSEStopped self.validate_energy_transfer_stopped_event(event_data, session_id, expected_state, expected_reason) From ec0a8762e464fcf4b6e93ab27a9e460a4bb10982 Mon Sep 17 00:00:00 2001 From: "Restyled.io" Date: Sun, 7 Jan 2024 23:05:30 +0000 Subject: [PATCH 073/114] Restyled by isort --- src/python_testing/TC_EEVSE_2_2.py | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/src/python_testing/TC_EEVSE_2_2.py b/src/python_testing/TC_EEVSE_2_2.py index 9fce5e1b68544b..faac9004e6909b 100644 --- a/src/python_testing/TC_EEVSE_2_2.py +++ b/src/python_testing/TC_EEVSE_2_2.py @@ -24,9 +24,8 @@ from chip.clusters import ClusterObjects as ClusterObjects from chip.clusters.Attribute import EventReadResult, SubscriptionTransaction from chip.clusters.Types import NullValue - from chip.interaction_model import InteractionModelError, Status -from matter_testing_support import MatterBaseTest, async_test_body, default_matter_test_main, TestStep +from matter_testing_support import MatterBaseTest, TestStep, async_test_body, default_matter_test_main from mobly import asserts logger = logging.getLogger(__name__) From e008095e4f57635684e23cfdb895403bdceb52d4 Mon Sep 17 00:00:00 2001 From: James Harrow Date: Mon, 8 Jan 2024 17:12:47 +0000 Subject: [PATCH 074/114] Made some attributes persisted per spec. --- .../include/EnergyEvseDelegateImpl.h | 2 +- .../include/EnergyEvseManager.h | 2 + .../src/EnergyEvseDelegateImpl.cpp | 46 ++++++++-- .../src/EnergyEvseManager.cpp | 89 ++++++++++++++++++- .../energy-evse-server/energy-evse-server.cpp | 3 +- .../energy-evse-server/energy-evse-server.h | 7 +- 6 files changed, 137 insertions(+), 12 deletions(-) diff --git a/examples/energy-management-app/energy-management-common/include/EnergyEvseDelegateImpl.h b/examples/energy-management-app/energy-management-common/include/EnergyEvseDelegateImpl.h index 34ccddfff83e01..6cd6dd37f8df34 100644 --- a/examples/energy-management-app/energy-management-common/include/EnergyEvseDelegateImpl.h +++ b/examples/energy-management-app/energy-management-common/include/EnergyEvseDelegateImpl.h @@ -198,7 +198,7 @@ class EnergyEvseDelegate : public EnergyEvse::Delegate DataModel::Nullable GetNextChargeTargetSoC() override; DataModel::Nullable GetApproximateEVEfficiency() override; - CHIP_ERROR SetApproximateEVEfficiency(uint16_t) override; + CHIP_ERROR SetApproximateEVEfficiency(DataModel::Nullable) override; /* SOC attributes */ DataModel::Nullable GetStateOfCharge() override; diff --git a/examples/energy-management-app/energy-management-common/include/EnergyEvseManager.h b/examples/energy-management-app/energy-management-common/include/EnergyEvseManager.h index 9875c397990ef2..a6a64f35ee9767 100644 --- a/examples/energy-management-app/energy-management-common/include/EnergyEvseManager.h +++ b/examples/energy-management-app/energy-management-common/include/EnergyEvseManager.h @@ -46,6 +46,8 @@ class EnergyEvseManager : public Instance CHIP_ERROR Init(); void Shutdown(); + CHIP_ERROR LoadPersistentAttributes(); + EnergyEvseDelegate * GetDelegate() { return mDelegate; }; private: diff --git a/examples/energy-management-app/energy-management-common/src/EnergyEvseDelegateImpl.cpp b/examples/energy-management-app/energy-management-common/src/EnergyEvseDelegateImpl.cpp index c640a27ea0e07a..d122de7921dac3 100644 --- a/examples/energy-management-app/energy-management-common/src/EnergyEvseDelegateImpl.cpp +++ b/examples/energy-management-app/energy-management-common/src/EnergyEvseDelegateImpl.cpp @@ -20,6 +20,7 @@ #include #include #include +#include using namespace chip; using namespace chip::app; @@ -122,7 +123,7 @@ Status EnergyEvseDelegate::EnableCharging(const DataModel::Nullable & * @brief Called when EVSE cluster receives EnableDischarging command * * @param dischargingEnabledUntil (can be null to indefinite discharging) - * @param maximumChargeCurrent (in mA) + * @param maximumDischargeCurrent (in mA) */ Status EnergyEvseDelegate::EnableDischarging(const DataModel::Nullable & dischargingEnabledUntil, const int64_t & maximumDischargeCurrent) @@ -963,6 +964,11 @@ CHIP_ERROR EnergyEvseDelegate::SetChargingEnabledUntil(DataModel::Nullable(mChargingEnabledUntil.Value())); } + + // Write new value to persistent storage. + ConcreteAttributePath path = ConcreteAttributePath(mEndpointId, EnergyEvse::Id, ChargingEnabledUntil::Id); + GetSafeAttributePersistenceProvider()->WriteScalarValue(path, mChargingEnabledUntil); + MatterReportingAttributeChangeCallback(mEndpointId, EnergyEvse::Id, ChargingEnabledUntil::Id); } @@ -991,6 +997,10 @@ CHIP_ERROR EnergyEvseDelegate::SetDischargingEnabledUntil(DataModel::Nullable(mDischargingEnabledUntil.Value())); } + // Write new value to persistent storage. + ConcreteAttributePath path = ConcreteAttributePath(mEndpointId, EnergyEvse::Id, DischargingEnabledUntil::Id); + GetSafeAttributePersistenceProvider()->WriteScalarValue(path, mDischargingEnabledUntil); + MatterReportingAttributeChangeCallback(mEndpointId, EnergyEvse::Id, DischargingEnabledUntil::Id); } @@ -1113,6 +1123,11 @@ CHIP_ERROR EnergyEvseDelegate::SetUserMaximumChargeCurrent(int64_t newValue) ChipLogDetail(AppServer, "UserMaximumChargeCurrent updated to %ld", static_cast(mUserMaximumChargeCurrent)); ComputeMaxChargeCurrentLimit(); + + // Write new value to persistent storage. + ConcreteAttributePath path = ConcreteAttributePath(mEndpointId, EnergyEvse::Id, UserMaximumChargeCurrent::Id); + GetSafeAttributePersistenceProvider()->WriteScalarValue(path, mUserMaximumChargeCurrent); + MatterReportingAttributeChangeCallback(mEndpointId, EnergyEvse::Id, UserMaximumChargeCurrent::Id); } @@ -1138,6 +1153,11 @@ CHIP_ERROR EnergyEvseDelegate::SetRandomizationDelayWindow(uint32_t newValue) { ChipLogDetail(AppServer, "RandomizationDelayWindow updated to %lu", static_cast(mRandomizationDelayWindow)); + + // Write new value to persistent storage. + ConcreteAttributePath path = ConcreteAttributePath(mEndpointId, EnergyEvse::Id, RandomizationDelayWindow::Id); + GetSafeAttributePersistenceProvider()->WriteScalarValue(path, mRandomizationDelayWindow); + MatterReportingAttributeChangeCallback(mEndpointId, EnergyEvse::Id, RandomizationDelayWindow::Id); } return CHIP_NO_ERROR; @@ -1175,14 +1195,25 @@ DataModel::Nullable EnergyEvseDelegate::GetApproximateEVEfficiency() return mApproximateEVEfficiency; } -CHIP_ERROR EnergyEvseDelegate::SetApproximateEVEfficiency(uint16_t newValue) +CHIP_ERROR EnergyEvseDelegate::SetApproximateEVEfficiency(DataModel::Nullable newValue) { DataModel::Nullable oldValue = mApproximateEVEfficiency; - mApproximateEVEfficiency = MakeNullable(newValue); - if ((oldValue.IsNull()) || (oldValue.Value() != newValue)) + mApproximateEVEfficiency = newValue; + if ((oldValue != newValue)) { - ChipLogDetail(AppServer, "ApproximateEVEfficiency updated to %d", mApproximateEVEfficiency.Value()); + if (newValue.IsNull()) + { + ChipLogDetail(AppServer, "ApproximateEVEfficiency updated to Null"); + } + else + { + ChipLogDetail(AppServer, "ApproximateEVEfficiency updated to %d", mApproximateEVEfficiency.Value()); + } + // Write new value to persistent storage. + ConcreteAttributePath path = ConcreteAttributePath(mEndpointId, EnergyEvse::Id, ApproximateEVEfficiency::Id); + GetSafeAttributePersistenceProvider()->WriteScalarValue(path, mApproximateEVEfficiency); + MatterReportingAttributeChangeCallback(mEndpointId, EnergyEvse::Id, ApproximateEVEfficiency::Id); } @@ -1291,7 +1322,10 @@ void EvseSession::StartSession(int64_t chargingMeterValue, int64_t dischargingMe MatterReportingAttributeChangeCallback(mEndpointId, EnergyEvse::Id, SessionEnergyCharged::Id); MatterReportingAttributeChangeCallback(mEndpointId, EnergyEvse::Id, SessionEnergyDischarged::Id); - // TODO persist mSessionID + // Write values to persistent storage. + ConcreteAttributePath path = ConcreteAttributePath(mEndpointId, EnergyEvse::Id, SessionID::Id); + GetSafeAttributePersistenceProvider()->WriteScalarValue(path, mSessionID); + // TODO persist mStartTime // TODO persist mSessionEnergyChargedAtStart // TODO persist mSessionEnergyDischargedAtStart diff --git a/examples/energy-management-app/energy-management-common/src/EnergyEvseManager.cpp b/examples/energy-management-app/energy-management-common/src/EnergyEvseManager.cpp index 0d84d8856212e0..389a830e8da759 100644 --- a/examples/energy-management-app/energy-management-common/src/EnergyEvseManager.cpp +++ b/examples/energy-management-app/energy-management-common/src/EnergyEvseManager.cpp @@ -17,14 +17,101 @@ */ #include +#include using namespace chip::app; using namespace chip::app::Clusters; using namespace chip::app::Clusters::EnergyEvse; +CHIP_ERROR EnergyEvseManager::LoadPersistentAttributes() +{ + + SafeAttributePersistenceProvider * aProvider = GetSafeAttributePersistenceProvider(); + EndpointId aEndpointId = mDelegate->GetEndpointId(); + CHIP_ERROR err; + + // Restore ChargingEnabledUntil value + DataModel::Nullable tempChargingEnabledUntil; + err = aProvider->ReadScalarValue(ConcreteAttributePath(aEndpointId, EnergyEvse::Id, Attributes::ChargingEnabledUntil::Id), + tempChargingEnabledUntil); + if (err == CHIP_NO_ERROR) + { + ChipLogDetail(AppServer, "EVSE: successfully loaded ChargingEnabledUntil from NVM"); + mDelegate->SetChargingEnabledUntil(tempChargingEnabledUntil); + } + else + { + ChipLogError(AppServer, "EVSE: Unable to restore persisted ChargingEnabledUntil value"); + } + + // Restore DischargingEnabledUntil value + DataModel::Nullable tempDischargingEnabledUntil; + err = aProvider->ReadScalarValue(ConcreteAttributePath(aEndpointId, EnergyEvse::Id, Attributes::DischargingEnabledUntil::Id), + tempDischargingEnabledUntil); + if (err == CHIP_NO_ERROR) + { + ChipLogDetail(AppServer, "EVSE: successfully loaded DischargingEnabledUntil from NVM"); + mDelegate->SetDischargingEnabledUntil(tempDischargingEnabledUntil); + } + else + { + ChipLogError(AppServer, "EVSE: Unable to restore persisted DischargingEnabledUntil value"); + } + + // Restore UserMaximumChargeCurrent value + uint64_t tempUserMaximumChargeCurrent; + err = aProvider->ReadScalarValue(ConcreteAttributePath(aEndpointId, EnergyEvse::Id, Attributes::UserMaximumChargeCurrent::Id), + tempUserMaximumChargeCurrent); + if (err == CHIP_NO_ERROR) + { + ChipLogDetail(AppServer, "EVSE: successfully loaded UserMaximumChargeCurrent from NVM"); + mDelegate->SetUserMaximumChargeCurrent(tempUserMaximumChargeCurrent); + } + else + { + ChipLogError(AppServer, "EVSE: Unable to restore persisted UserMaximumChargeCurrent value"); + } + + // Restore RandomizationDelayWindow value + uint32_t tempRandomizationDelayWindow; + err = aProvider->ReadScalarValue(ConcreteAttributePath(aEndpointId, EnergyEvse::Id, Attributes::RandomizationDelayWindow::Id), + tempRandomizationDelayWindow); + if (err == CHIP_NO_ERROR) + { + ChipLogDetail(AppServer, "EVSE: successfully loaded RandomizationDelayWindow from NVM"); + mDelegate->SetRandomizationDelayWindow(tempRandomizationDelayWindow); + } + else + { + ChipLogError(AppServer, "EVSE: Unable to restore persisted RandomizationDelayWindow value"); + } + + // Restore ApproximateEVEfficiency value + DataModel::Nullable tempApproxEVEfficiency; + err = aProvider->ReadScalarValue(ConcreteAttributePath(aEndpointId, EnergyEvse::Id, Attributes::ApproximateEVEfficiency::Id), + tempApproxEVEfficiency); + if (err == CHIP_NO_ERROR) + { + ChipLogDetail(AppServer, "EVSE: successfully loaded ApproximateEVEfficiency from NVM"); + mDelegate->SetApproximateEVEfficiency(tempApproxEVEfficiency); + } + else + { + ChipLogError(AppServer, "EVSE: Unable to restore persisted ApproximateEVEfficiency value"); + } + + return CHIP_NO_ERROR; // It is ok to have no value loaded here +} + CHIP_ERROR EnergyEvseManager::Init() { - return Instance::Init(); + CHIP_ERROR err = Instance::Init(); + if (err != CHIP_NO_ERROR) + { + return err; + } + + return LoadPersistentAttributes(); } void EnergyEvseManager::Shutdown() diff --git a/src/app/clusters/energy-evse-server/energy-evse-server.cpp b/src/app/clusters/energy-evse-server/energy-evse-server.cpp index 60f9e24be0f962..bc07ba07eef55a 100644 --- a/src/app/clusters/energy-evse-server/energy-evse-server.cpp +++ b/src/app/clusters/energy-evse-server/energy-evse-server.cpp @@ -23,6 +23,7 @@ using namespace chip; using namespace chip::app; +using namespace chip::app::DataModel; using namespace chip::app::Clusters; using namespace chip::app::Clusters::EnergyEvse; using namespace chip::app::Clusters::EnergyEvse::Attributes; @@ -166,7 +167,7 @@ CHIP_ERROR Instance::Write(const ConcreteDataAttributePath & aPath, AttributeVal } uint16_t newValue; ReturnErrorOnFailure(aDecoder.Decode(newValue)); - ReturnErrorOnFailure(mDelegate.SetApproximateEVEfficiency(newValue)); + ReturnErrorOnFailure(mDelegate.SetApproximateEVEfficiency(MakeNullable(newValue))); return CHIP_NO_ERROR; } diff --git a/src/app/clusters/energy-evse-server/energy-evse-server.h b/src/app/clusters/energy-evse-server/energy-evse-server.h index 5df2f0149eb1ed..a194551607c6f4 100644 --- a/src/app/clusters/energy-evse-server/energy-evse-server.h +++ b/src/app/clusters/energy-evse-server/energy-evse-server.h @@ -48,6 +48,7 @@ class Delegate virtual ~Delegate() = default; void SetEndpointId(EndpointId aEndpoint) { mEndpointId = aEndpoint; } + EndpointId GetEndpointId() { return mEndpointId; } /** * @brief Delegate should implement a handler to disable the EVSE. @@ -116,9 +117,9 @@ class Delegate // ------------------------------------------------------------------ // Set attribute methods - virtual CHIP_ERROR SetUserMaximumChargeCurrent(int64_t aNewValue) = 0; - virtual CHIP_ERROR SetRandomizationDelayWindow(uint32_t aNewValue) = 0; - virtual CHIP_ERROR SetApproximateEVEfficiency(uint16_t aNewValue) = 0; + virtual CHIP_ERROR SetUserMaximumChargeCurrent(int64_t aNewValue) = 0; + virtual CHIP_ERROR SetRandomizationDelayWindow(uint32_t aNewValue) = 0; + virtual CHIP_ERROR SetApproximateEVEfficiency(DataModel::Nullable aNewValue) = 0; protected: EndpointId mEndpointId = 0; From 165af4cc0693bcf8245d60aa6ed10b5278a5e73e Mon Sep 17 00:00:00 2001 From: James Harrow Date: Mon, 8 Jan 2024 18:26:14 +0000 Subject: [PATCH 075/114] Added attributes to zcl.json to mark them as implemented in attributeAccessInterfaceAttributes --- .../zcl/zcl-with-test-extensions.json | 37 ++++++++++++++++++- src/app/zap-templates/zcl/zcl.json | 37 ++++++++++++++++++- 2 files changed, 72 insertions(+), 2 deletions(-) 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 634f66606f6a60..c6d13646750a36 100644 --- a/src/app/zap-templates/zcl/zcl-with-test-extensions.json +++ b/src/app/zap-templates/zcl/zcl-with-test-extensions.json @@ -178,7 +178,42 @@ ], "Bridged Device Basic Information": ["ProductAppearance"], "Descriptor": ["ClusterRevision"], - "Device Energy Management": ["Forecast"], + "Device Energy Management": [ + "ESAType", + "ESACanGenerate", + "ESAState", + "AbsMinPower", + "AbsMaxPower", + "PowerAdjustmentCapability", + "Forecast", + "FeatureMap" + ], + "Energy EVSE": [ + "State", + "SupplyState", + "FaultState", + "ChargingEnabledUntil", + "DischargingEnabledUntil", + "CircuitCapacity", + "MinimumChargeCurrent", + "MaximumChargeCurrent", + "MaximumDischargeCurrent", + "UserMaximumChargeCurrent", + "RandomizationDelayWindow", + "NextChargeStartTime", + "NextChargeTargetTime", + "NextChargeRequiredEnergy", + "NextChargeTargetSoC", + "ApproximateEVEfficiency", + "StateOfCharge", + "BatteryCapacity", + "VehicleID", + "SessionID", + "SessionDuration", + "SessionEnergyCharged", + "SessionEnergyDischarged", + "FeatureMap" + ], "Ethernet Network Diagnostics": [ "PHYRate", "FullDuplex", diff --git a/src/app/zap-templates/zcl/zcl.json b/src/app/zap-templates/zcl/zcl.json index a0556e6da7ebb2..99f3b0cfa2dfcf 100644 --- a/src/app/zap-templates/zcl/zcl.json +++ b/src/app/zap-templates/zcl/zcl.json @@ -176,7 +176,42 @@ ], "Bridged Device Basic Information": ["ProductAppearance"], "Descriptor": ["ClusterRevision"], - "Device Energy Management": ["Forecast"], + "Device Energy Management": [ + "ESAType", + "ESACanGenerate", + "ESAState", + "AbsMinPower", + "AbsMaxPower", + "PowerAdjustmentCapability", + "Forecast", + "FeatureMap" + ], + "Energy EVSE": [ + "State", + "SupplyState", + "FaultState", + "ChargingEnabledUntil", + "DischargingEnabledUntil", + "CircuitCapacity", + "MinimumChargeCurrent", + "MaximumChargeCurrent", + "MaximumDischargeCurrent", + "UserMaximumChargeCurrent", + "RandomizationDelayWindow", + "NextChargeStartTime", + "NextChargeTargetTime", + "NextChargeRequiredEnergy", + "NextChargeTargetSoC", + "ApproximateEVEfficiency", + "StateOfCharge", + "BatteryCapacity", + "VehicleID", + "SessionID", + "SessionDuration", + "SessionEnergyCharged", + "SessionEnergyDischarged", + "FeatureMap" + ], "Ethernet Network Diagnostics": [ "PHYRate", "FullDuplex", From d7b6b08e01720ab7779c55095ead57ae3cab961b Mon Sep 17 00:00:00 2001 From: James Harrow Date: Mon, 8 Jan 2024 18:50:14 +0000 Subject: [PATCH 076/114] Ran regen_all.py after changing zcl.json --- .../all-clusters-app.matter | 40 +- .../energy-management-app.matter | 42 +- .../zap-generated/CHIPInvokeCallbacks.cpp | 64 +- .../java/zap-generated/CHIPReadCallbacks.cpp | 879 ++++++----- .../zap-generated/attributes/Accessors.cpp | 1285 +---------------- .../zap-generated/attributes/Accessors.h | 181 --- 6 files changed, 525 insertions(+), 1966 deletions(-) diff --git a/examples/all-clusters-app/all-clusters-common/all-clusters-app.matter b/examples/all-clusters-app/all-clusters-common/all-clusters-app.matter index a01335ad28aa89..c91760fb018d10 100644 --- a/examples/all-clusters-app/all-clusters-common/all-clusters-app.matter +++ b/examples/all-clusters-app/all-clusters-common/all-clusters-app.matter @@ -3741,7 +3741,7 @@ provisional cluster ElectricalEnergyMeasurement = 145 { /** This cluster allows a client to manage the power draw of a device. An example of such a client could be an Energy Management System (EMS) which controls an Energy Smart Appliance (ESA). */ provisional cluster DeviceEnergyManagement = 152 { - revision 1; // NOTE: Default/not specifically set + revision 2; enum CauseEnum : enum8 { kNormalCompletion = 0; @@ -7559,18 +7559,18 @@ endpoint 1 { emits event PowerAdjustEnd; emits event Paused; emits event Resumed; - callback attribute ESAType default = 0; - callback attribute ESACanGenerate default = 0; - callback attribute ESAState default = 0; - callback attribute absMinPower default = 0; - callback attribute absMaxPower default = 0; + callback attribute ESAType; + callback attribute ESACanGenerate; + callback attribute ESAState; + callback attribute absMinPower; + callback attribute absMaxPower; callback attribute powerAdjustmentCapability; callback attribute forecast; callback attribute generatedCommandList; callback attribute acceptedCommandList; callback attribute eventList; callback attribute attributeList; - callback attribute featureMap default = 0; + callback attribute featureMap; ram attribute clusterRevision default = 2; handle command PowerAdjustRequest; @@ -7583,24 +7583,24 @@ endpoint 1 { } server cluster EnergyEvse { - callback attribute state default = 0; - callback attribute supplyState default = 0; - callback attribute faultState default = 0; - callback attribute chargingEnabledUntil default = 0; - callback attribute dischargingEnabledUntil default = 0; - callback attribute circuitCapacity default = 0; - callback attribute minimumChargeCurrent default = 6000; - callback attribute maximumChargeCurrent default = 0; - callback attribute maximumDischargeCurrent default = 0; - callback attribute userMaximumChargeCurrent default = 0; - callback attribute randomizationDelayWindow default = 600; + callback attribute state; + callback attribute supplyState; + callback attribute faultState; + callback attribute chargingEnabledUntil; + callback attribute dischargingEnabledUntil; + callback attribute circuitCapacity; + callback attribute minimumChargeCurrent; + callback attribute maximumChargeCurrent; + callback attribute maximumDischargeCurrent; + callback attribute userMaximumChargeCurrent; + callback attribute randomizationDelayWindow; callback attribute numberOfWeeklyTargets default = 0; callback attribute numberOfDailyTargets default = 1; callback attribute nextChargeStartTime; callback attribute nextChargeTargetTime; callback attribute nextChargeRequiredEnergy; callback attribute nextChargeTargetSoC; - callback attribute approximateEVEfficiency default = 0xFFFF; + callback attribute approximateEVEfficiency; callback attribute stateOfCharge; callback attribute batteryCapacity; callback attribute vehicleID; @@ -7612,7 +7612,7 @@ endpoint 1 { callback attribute acceptedCommandList; callback attribute eventList; callback attribute attributeList; - callback attribute featureMap default = 0; + callback attribute featureMap; ram attribute clusterRevision default = 2; handle command GetTargetsResponse; diff --git a/examples/energy-management-app/energy-management-common/energy-management-app.matter b/examples/energy-management-app/energy-management-common/energy-management-app.matter index 4063980ea9bda9..753c428234a038 100644 --- a/examples/energy-management-app/energy-management-common/energy-management-app.matter +++ b/examples/energy-management-app/energy-management-common/energy-management-app.matter @@ -902,7 +902,7 @@ cluster GroupKeyManagement = 63 { /** This cluster allows a client to manage the power draw of a device. An example of such a client could be an Energy Management System (EMS) which controls an Energy Smart Appliance (ESA). */ provisional cluster DeviceEnergyManagement = 152 { - revision 1; // NOTE: Default/not specifically set + revision 2; enum CauseEnum : enum8 { kNormalCompletion = 0; @@ -1474,18 +1474,18 @@ endpoint 1 { emits event PowerAdjustEnd; emits event Paused; emits event Resumed; - callback attribute ESAType default = 0; - callback attribute ESACanGenerate default = 0; - callback attribute ESAState default = 0; - callback attribute absMinPower default = 0; - callback attribute absMaxPower default = 0; + callback attribute ESAType; + callback attribute ESACanGenerate; + callback attribute ESAState; + callback attribute absMinPower; + callback attribute absMaxPower; callback attribute powerAdjustmentCapability; callback attribute forecast; callback attribute generatedCommandList; callback attribute acceptedCommandList; callback attribute eventList; callback attribute attributeList; - callback attribute featureMap default = 0; + callback attribute featureMap; ram attribute clusterRevision default = 2; handle command PowerAdjustRequest; @@ -1507,33 +1507,33 @@ endpoint 1 { callback attribute state; callback attribute supplyState; callback attribute faultState; - callback attribute chargingEnabledUntil default = 0; - callback attribute dischargingEnabledUntil default = 0; - callback attribute circuitCapacity default = 0; - callback attribute minimumChargeCurrent default = 6000; - callback attribute maximumChargeCurrent default = 0; - callback attribute maximumDischargeCurrent default = 0; - callback attribute userMaximumChargeCurrent default = 0; - callback attribute randomizationDelayWindow default = 600; + callback attribute chargingEnabledUntil; + callback attribute dischargingEnabledUntil; + callback attribute circuitCapacity; + callback attribute minimumChargeCurrent; + callback attribute maximumChargeCurrent; + callback attribute maximumDischargeCurrent; + callback attribute userMaximumChargeCurrent; + callback attribute randomizationDelayWindow; callback attribute numberOfWeeklyTargets default = 0; callback attribute numberOfDailyTargets default = 1; callback attribute nextChargeStartTime; callback attribute nextChargeTargetTime; callback attribute nextChargeRequiredEnergy; callback attribute nextChargeTargetSoC; - callback attribute approximateEVEfficiency default = 0xFFFF; + callback attribute approximateEVEfficiency; callback attribute stateOfCharge; callback attribute batteryCapacity; callback attribute vehicleID; - callback attribute sessionID default = 0; - callback attribute sessionDuration default = 0; - callback attribute sessionEnergyCharged default = 0; - callback attribute sessionEnergyDischarged default = 0; + callback attribute sessionID; + callback attribute sessionDuration; + callback attribute sessionEnergyCharged; + callback attribute sessionEnergyDischarged; callback attribute generatedCommandList; callback attribute acceptedCommandList; callback attribute eventList; callback attribute attributeList; - callback attribute featureMap default = 1; + callback attribute featureMap; ram attribute clusterRevision default = 2; handle command GetTargetsResponse; diff --git a/src/controller/java/zap-generated/CHIPInvokeCallbacks.cpp b/src/controller/java/zap-generated/CHIPInvokeCallbacks.cpp index 8c3deacae5abaf..3c2c132eec3246 100644 --- a/src/controller/java/zap-generated/CHIPInvokeCallbacks.cpp +++ b/src/controller/java/zap-generated/CHIPInvokeCallbacks.cpp @@ -1545,7 +1545,7 @@ void CHIPGeneralCommissioningClusterArmFailSafeResponseCallback::CallbackFn( env->CallVoidMethod(javaCallbackRef, javaMethod, ErrorCode, DebugText); } CHIPGeneralCommissioningClusterSetRegulatoryConfigResponseCallback:: - CHIPGeneralCommissioningClusterSetRegulatoryConfigResponseCallback(jobject javaCallback) : +CHIPGeneralCommissioningClusterSetRegulatoryConfigResponseCallback(jobject javaCallback) : Callback::Callback(CallbackFn, this) { JNIEnv * env = JniReferences::GetInstance().GetEnvForCurrentThread(); @@ -1562,8 +1562,8 @@ CHIPGeneralCommissioningClusterSetRegulatoryConfigResponseCallback:: } } -CHIPGeneralCommissioningClusterSetRegulatoryConfigResponseCallback:: - ~CHIPGeneralCommissioningClusterSetRegulatoryConfigResponseCallback() +CHIPGeneralCommissioningClusterSetRegulatoryConfigResponseCallback::~ +CHIPGeneralCommissioningClusterSetRegulatoryConfigResponseCallback() { JNIEnv * env = JniReferences::GetInstance().GetEnvForCurrentThread(); if (env == nullptr) @@ -1612,7 +1612,7 @@ void CHIPGeneralCommissioningClusterSetRegulatoryConfigResponseCallback::Callbac env->CallVoidMethod(javaCallbackRef, javaMethod, ErrorCode, DebugText); } CHIPGeneralCommissioningClusterCommissioningCompleteResponseCallback:: - CHIPGeneralCommissioningClusterCommissioningCompleteResponseCallback(jobject javaCallback) : +CHIPGeneralCommissioningClusterCommissioningCompleteResponseCallback(jobject javaCallback) : Callback::Callback(CallbackFn, this) { JNIEnv * env = JniReferences::GetInstance().GetEnvForCurrentThread(); @@ -1629,8 +1629,8 @@ CHIPGeneralCommissioningClusterCommissioningCompleteResponseCallback:: } } -CHIPGeneralCommissioningClusterCommissioningCompleteResponseCallback:: - ~CHIPGeneralCommissioningClusterCommissioningCompleteResponseCallback() +CHIPGeneralCommissioningClusterCommissioningCompleteResponseCallback::~ +CHIPGeneralCommissioningClusterCommissioningCompleteResponseCallback() { JNIEnv * env = JniReferences::GetInstance().GetEnvForCurrentThread(); if (env == nullptr) @@ -2514,7 +2514,7 @@ void CHIPOperationalCredentialsClusterAttestationResponseCallback::CallbackFn( env->CallVoidMethod(javaCallbackRef, javaMethod, AttestationElements, AttestationSignature); } CHIPOperationalCredentialsClusterCertificateChainResponseCallback:: - CHIPOperationalCredentialsClusterCertificateChainResponseCallback(jobject javaCallback) : +CHIPOperationalCredentialsClusterCertificateChainResponseCallback(jobject javaCallback) : Callback::Callback(CallbackFn, this) { JNIEnv * env = JniReferences::GetInstance().GetEnvForCurrentThread(); @@ -2531,8 +2531,8 @@ CHIPOperationalCredentialsClusterCertificateChainResponseCallback:: } } -CHIPOperationalCredentialsClusterCertificateChainResponseCallback:: - ~CHIPOperationalCredentialsClusterCertificateChainResponseCallback() +CHIPOperationalCredentialsClusterCertificateChainResponseCallback::~ +CHIPOperationalCredentialsClusterCertificateChainResponseCallback() { JNIEnv * env = JniReferences::GetInstance().GetEnvForCurrentThread(); if (env == nullptr) @@ -2910,7 +2910,7 @@ void CHIPGroupKeyManagementClusterKeySetReadResponseCallback::CallbackFn( env->CallVoidMethod(javaCallbackRef, javaMethod, GroupKeySet); } CHIPGroupKeyManagementClusterKeySetReadAllIndicesResponseCallback:: - CHIPGroupKeyManagementClusterKeySetReadAllIndicesResponseCallback(jobject javaCallback) : +CHIPGroupKeyManagementClusterKeySetReadAllIndicesResponseCallback(jobject javaCallback) : Callback::Callback(CallbackFn, this) { JNIEnv * env = JniReferences::GetInstance().GetEnvForCurrentThread(); @@ -2927,8 +2927,8 @@ CHIPGroupKeyManagementClusterKeySetReadAllIndicesResponseCallback:: } } -CHIPGroupKeyManagementClusterKeySetReadAllIndicesResponseCallback:: - ~CHIPGroupKeyManagementClusterKeySetReadAllIndicesResponseCallback() +CHIPGroupKeyManagementClusterKeySetReadAllIndicesResponseCallback::~ +CHIPGroupKeyManagementClusterKeySetReadAllIndicesResponseCallback() { JNIEnv * env = JniReferences::GetInstance().GetEnvForCurrentThread(); if (env == nullptr) @@ -3106,7 +3106,7 @@ void CHIPIcdManagementClusterStayActiveResponseCallback::CallbackFn( env->CallVoidMethod(javaCallbackRef, javaMethod, PromisedActiveDuration); } CHIPOvenCavityOperationalStateClusterOperationalCommandResponseCallback:: - CHIPOvenCavityOperationalStateClusterOperationalCommandResponseCallback(jobject javaCallback) : +CHIPOvenCavityOperationalStateClusterOperationalCommandResponseCallback(jobject javaCallback) : Callback::Callback(CallbackFn, this) { JNIEnv * env = JniReferences::GetInstance().GetEnvForCurrentThread(); @@ -3123,8 +3123,8 @@ CHIPOvenCavityOperationalStateClusterOperationalCommandResponseCallback:: } } -CHIPOvenCavityOperationalStateClusterOperationalCommandResponseCallback:: - ~CHIPOvenCavityOperationalStateClusterOperationalCommandResponseCallback() +CHIPOvenCavityOperationalStateClusterOperationalCommandResponseCallback::~ +CHIPOvenCavityOperationalStateClusterOperationalCommandResponseCallback() { JNIEnv * env = JniReferences::GetInstance().GetEnvForCurrentThread(); if (env == nullptr) @@ -3367,7 +3367,7 @@ void CHIPLaundryWasherModeClusterChangeToModeResponseCallback::CallbackFn( env->CallVoidMethod(javaCallbackRef, javaMethod, Status, StatusText); } CHIPRefrigeratorAndTemperatureControlledCabinetModeClusterChangeToModeResponseCallback:: - CHIPRefrigeratorAndTemperatureControlledCabinetModeClusterChangeToModeResponseCallback(jobject javaCallback) : +CHIPRefrigeratorAndTemperatureControlledCabinetModeClusterChangeToModeResponseCallback(jobject javaCallback) : Callback::Callback(CallbackFn, this) { JNIEnv * env = JniReferences::GetInstance().GetEnvForCurrentThread(); @@ -3384,8 +3384,8 @@ CHIPRefrigeratorAndTemperatureControlledCabinetModeClusterChangeToModeResponseCa } } -CHIPRefrigeratorAndTemperatureControlledCabinetModeClusterChangeToModeResponseCallback:: - ~CHIPRefrigeratorAndTemperatureControlledCabinetModeClusterChangeToModeResponseCallback() +CHIPRefrigeratorAndTemperatureControlledCabinetModeClusterChangeToModeResponseCallback::~ +CHIPRefrigeratorAndTemperatureControlledCabinetModeClusterChangeToModeResponseCallback() { JNIEnv * env = JniReferences::GetInstance().GetEnvForCurrentThread(); if (env == nullptr) @@ -3796,8 +3796,8 @@ CHIPRvcOperationalStateClusterOperationalCommandResponseCallback::CHIPRvcOperati } } -CHIPRvcOperationalStateClusterOperationalCommandResponseCallback:: - ~CHIPRvcOperationalStateClusterOperationalCommandResponseCallback() +CHIPRvcOperationalStateClusterOperationalCommandResponseCallback::~ +CHIPRvcOperationalStateClusterOperationalCommandResponseCallback() { JNIEnv * env = JniReferences::GetInstance().GetEnvForCurrentThread(); if (env == nullptr) @@ -6331,7 +6331,7 @@ void CHIPContentAppObserverClusterContentAppMessageResponseCallback::CallbackFn( env->CallVoidMethod(javaCallbackRef, javaMethod, Status, Data, EncodingHint); } CHIPElectricalMeasurementClusterGetProfileInfoResponseCommandCallback:: - CHIPElectricalMeasurementClusterGetProfileInfoResponseCommandCallback(jobject javaCallback) : +CHIPElectricalMeasurementClusterGetProfileInfoResponseCommandCallback(jobject javaCallback) : Callback::Callback(CallbackFn, this) { JNIEnv * env = JniReferences::GetInstance().GetEnvForCurrentThread(); @@ -6348,8 +6348,8 @@ CHIPElectricalMeasurementClusterGetProfileInfoResponseCommandCallback:: } } -CHIPElectricalMeasurementClusterGetProfileInfoResponseCommandCallback:: - ~CHIPElectricalMeasurementClusterGetProfileInfoResponseCommandCallback() +CHIPElectricalMeasurementClusterGetProfileInfoResponseCommandCallback::~ +CHIPElectricalMeasurementClusterGetProfileInfoResponseCommandCallback() { JNIEnv * env = JniReferences::GetInstance().GetEnvForCurrentThread(); if (env == nullptr) @@ -6426,7 +6426,7 @@ void CHIPElectricalMeasurementClusterGetProfileInfoResponseCommandCallback::Call env->CallVoidMethod(javaCallbackRef, javaMethod, profileCount, profileIntervalPeriod, maxNumberOfIntervals, listOfAttributes); } CHIPElectricalMeasurementClusterGetMeasurementProfileResponseCommandCallback:: - CHIPElectricalMeasurementClusterGetMeasurementProfileResponseCommandCallback(jobject javaCallback) : +CHIPElectricalMeasurementClusterGetMeasurementProfileResponseCommandCallback(jobject javaCallback) : Callback::Callback(CallbackFn, this) { JNIEnv * env = JniReferences::GetInstance().GetEnvForCurrentThread(); @@ -6443,8 +6443,8 @@ CHIPElectricalMeasurementClusterGetMeasurementProfileResponseCommandCallback:: } } -CHIPElectricalMeasurementClusterGetMeasurementProfileResponseCommandCallback:: - ~CHIPElectricalMeasurementClusterGetMeasurementProfileResponseCommandCallback() +CHIPElectricalMeasurementClusterGetMeasurementProfileResponseCommandCallback::~ +CHIPElectricalMeasurementClusterGetMeasurementProfileResponseCommandCallback() { JNIEnv * env = JniReferences::GetInstance().GetEnvForCurrentThread(); if (env == nullptr) @@ -7372,7 +7372,7 @@ void CHIPUnitTestingClusterTestNullableOptionalResponseCallback::CallbackFn( env->CallVoidMethod(javaCallbackRef, javaMethod, wasPresent, wasNull, value, originalValue); } CHIPUnitTestingClusterTestComplexNullableOptionalResponseCallback:: - CHIPUnitTestingClusterTestComplexNullableOptionalResponseCallback(jobject javaCallback) : +CHIPUnitTestingClusterTestComplexNullableOptionalResponseCallback(jobject javaCallback) : Callback::Callback(CallbackFn, this) { JNIEnv * env = JniReferences::GetInstance().GetEnvForCurrentThread(); @@ -7389,8 +7389,8 @@ CHIPUnitTestingClusterTestComplexNullableOptionalResponseCallback:: } } -CHIPUnitTestingClusterTestComplexNullableOptionalResponseCallback:: - ~CHIPUnitTestingClusterTestComplexNullableOptionalResponseCallback() +CHIPUnitTestingClusterTestComplexNullableOptionalResponseCallback::~ +CHIPUnitTestingClusterTestComplexNullableOptionalResponseCallback() { JNIEnv * env = JniReferences::GetInstance().GetEnvForCurrentThread(); if (env == nullptr) @@ -8267,7 +8267,7 @@ void CHIPUnitTestingClusterTestEmitTestEventResponseCallback::CallbackFn( env->CallVoidMethod(javaCallbackRef, javaMethod, value); } CHIPUnitTestingClusterTestEmitTestFabricScopedEventResponseCallback:: - CHIPUnitTestingClusterTestEmitTestFabricScopedEventResponseCallback(jobject javaCallback) : +CHIPUnitTestingClusterTestEmitTestFabricScopedEventResponseCallback(jobject javaCallback) : Callback::Callback(CallbackFn, this) { JNIEnv * env = JniReferences::GetInstance().GetEnvForCurrentThread(); @@ -8284,8 +8284,8 @@ CHIPUnitTestingClusterTestEmitTestFabricScopedEventResponseCallback:: } } -CHIPUnitTestingClusterTestEmitTestFabricScopedEventResponseCallback:: - ~CHIPUnitTestingClusterTestEmitTestFabricScopedEventResponseCallback() +CHIPUnitTestingClusterTestEmitTestFabricScopedEventResponseCallback::~ +CHIPUnitTestingClusterTestEmitTestFabricScopedEventResponseCallback() { JNIEnv * env = JniReferences::GetInstance().GetEnvForCurrentThread(); if (env == nullptr) diff --git a/src/controller/java/zap-generated/CHIPReadCallbacks.cpp b/src/controller/java/zap-generated/CHIPReadCallbacks.cpp index 9b9c6dbf5b84a8..5a72bbb8f90669 100644 --- a/src/controller/java/zap-generated/CHIPReadCallbacks.cpp +++ b/src/controller/java/zap-generated/CHIPReadCallbacks.cpp @@ -1416,7 +1416,7 @@ void CHIPOnOffAttributeListAttributeCallback::CallbackFn(void * context, } CHIPOnOffSwitchConfigurationGeneratedCommandListAttributeCallback:: - CHIPOnOffSwitchConfigurationGeneratedCommandListAttributeCallback(jobject javaCallback, bool keepAlive) : +CHIPOnOffSwitchConfigurationGeneratedCommandListAttributeCallback(jobject javaCallback, bool keepAlive) : chip::Callback::Callback(CallbackFn, this), keepAlive(keepAlive) { @@ -1434,8 +1434,8 @@ CHIPOnOffSwitchConfigurationGeneratedCommandListAttributeCallback:: } } -CHIPOnOffSwitchConfigurationGeneratedCommandListAttributeCallback:: - ~CHIPOnOffSwitchConfigurationGeneratedCommandListAttributeCallback() +CHIPOnOffSwitchConfigurationGeneratedCommandListAttributeCallback::~ +CHIPOnOffSwitchConfigurationGeneratedCommandListAttributeCallback() { JNIEnv * env = chip::JniReferences::GetInstance().GetEnvForCurrentThread(); if (env == nullptr) @@ -1507,8 +1507,8 @@ CHIPOnOffSwitchConfigurationAcceptedCommandListAttributeCallback::CHIPOnOffSwitc } } -CHIPOnOffSwitchConfigurationAcceptedCommandListAttributeCallback:: - ~CHIPOnOffSwitchConfigurationAcceptedCommandListAttributeCallback() +CHIPOnOffSwitchConfigurationAcceptedCommandListAttributeCallback::~ +CHIPOnOffSwitchConfigurationAcceptedCommandListAttributeCallback() { JNIEnv * env = chip::JniReferences::GetInstance().GetEnvForCurrentThread(); if (env == nullptr) @@ -5528,7 +5528,7 @@ void CHIPBasicInformationAttributeListAttributeCallback::CallbackFn( } CHIPOtaSoftwareUpdateProviderGeneratedCommandListAttributeCallback:: - CHIPOtaSoftwareUpdateProviderGeneratedCommandListAttributeCallback(jobject javaCallback, bool keepAlive) : +CHIPOtaSoftwareUpdateProviderGeneratedCommandListAttributeCallback(jobject javaCallback, bool keepAlive) : chip::Callback::Callback(CallbackFn, this), keepAlive(keepAlive) { @@ -5546,8 +5546,8 @@ CHIPOtaSoftwareUpdateProviderGeneratedCommandListAttributeCallback:: } } -CHIPOtaSoftwareUpdateProviderGeneratedCommandListAttributeCallback:: - ~CHIPOtaSoftwareUpdateProviderGeneratedCommandListAttributeCallback() +CHIPOtaSoftwareUpdateProviderGeneratedCommandListAttributeCallback::~ +CHIPOtaSoftwareUpdateProviderGeneratedCommandListAttributeCallback() { JNIEnv * env = chip::JniReferences::GetInstance().GetEnvForCurrentThread(); if (env == nullptr) @@ -5601,7 +5601,7 @@ void CHIPOtaSoftwareUpdateProviderGeneratedCommandListAttributeCallback::Callbac } CHIPOtaSoftwareUpdateProviderAcceptedCommandListAttributeCallback:: - CHIPOtaSoftwareUpdateProviderAcceptedCommandListAttributeCallback(jobject javaCallback, bool keepAlive) : +CHIPOtaSoftwareUpdateProviderAcceptedCommandListAttributeCallback(jobject javaCallback, bool keepAlive) : chip::Callback::Callback(CallbackFn, this), keepAlive(keepAlive) { @@ -5619,8 +5619,8 @@ CHIPOtaSoftwareUpdateProviderAcceptedCommandListAttributeCallback:: } } -CHIPOtaSoftwareUpdateProviderAcceptedCommandListAttributeCallback:: - ~CHIPOtaSoftwareUpdateProviderAcceptedCommandListAttributeCallback() +CHIPOtaSoftwareUpdateProviderAcceptedCommandListAttributeCallback::~ +CHIPOtaSoftwareUpdateProviderAcceptedCommandListAttributeCallback() { JNIEnv * env = chip::JniReferences::GetInstance().GetEnvForCurrentThread(); if (env == nullptr) @@ -5818,7 +5818,7 @@ void CHIPOtaSoftwareUpdateProviderAttributeListAttributeCallback::CallbackFn( } CHIPOtaSoftwareUpdateRequestorDefaultOTAProvidersAttributeCallback:: - CHIPOtaSoftwareUpdateRequestorDefaultOTAProvidersAttributeCallback(jobject javaCallback, bool keepAlive) : +CHIPOtaSoftwareUpdateRequestorDefaultOTAProvidersAttributeCallback(jobject javaCallback, bool keepAlive) : chip::Callback::Callback(CallbackFn, this), keepAlive(keepAlive) { @@ -5836,8 +5836,8 @@ CHIPOtaSoftwareUpdateRequestorDefaultOTAProvidersAttributeCallback:: } } -CHIPOtaSoftwareUpdateRequestorDefaultOTAProvidersAttributeCallback:: - ~CHIPOtaSoftwareUpdateRequestorDefaultOTAProvidersAttributeCallback() +CHIPOtaSoftwareUpdateRequestorDefaultOTAProvidersAttributeCallback::~ +CHIPOtaSoftwareUpdateRequestorDefaultOTAProvidersAttributeCallback() { JNIEnv * env = chip::JniReferences::GetInstance().GetEnvForCurrentThread(); if (env == nullptr) @@ -5929,7 +5929,7 @@ void CHIPOtaSoftwareUpdateRequestorDefaultOTAProvidersAttributeCallback::Callbac } CHIPOtaSoftwareUpdateRequestorUpdateStateProgressAttributeCallback:: - CHIPOtaSoftwareUpdateRequestorUpdateStateProgressAttributeCallback(jobject javaCallback, bool keepAlive) : +CHIPOtaSoftwareUpdateRequestorUpdateStateProgressAttributeCallback(jobject javaCallback, bool keepAlive) : chip::Callback::Callback(CallbackFn, this), keepAlive(keepAlive) { @@ -5947,8 +5947,8 @@ CHIPOtaSoftwareUpdateRequestorUpdateStateProgressAttributeCallback:: } } -CHIPOtaSoftwareUpdateRequestorUpdateStateProgressAttributeCallback:: - ~CHIPOtaSoftwareUpdateRequestorUpdateStateProgressAttributeCallback() +CHIPOtaSoftwareUpdateRequestorUpdateStateProgressAttributeCallback::~ +CHIPOtaSoftwareUpdateRequestorUpdateStateProgressAttributeCallback() { JNIEnv * env = chip::JniReferences::GetInstance().GetEnvForCurrentThread(); if (env == nullptr) @@ -5998,7 +5998,7 @@ void CHIPOtaSoftwareUpdateRequestorUpdateStateProgressAttributeCallback::Callbac } CHIPOtaSoftwareUpdateRequestorGeneratedCommandListAttributeCallback:: - CHIPOtaSoftwareUpdateRequestorGeneratedCommandListAttributeCallback(jobject javaCallback, bool keepAlive) : +CHIPOtaSoftwareUpdateRequestorGeneratedCommandListAttributeCallback(jobject javaCallback, bool keepAlive) : chip::Callback::Callback(CallbackFn, this), keepAlive(keepAlive) { @@ -6016,8 +6016,8 @@ CHIPOtaSoftwareUpdateRequestorGeneratedCommandListAttributeCallback:: } } -CHIPOtaSoftwareUpdateRequestorGeneratedCommandListAttributeCallback:: - ~CHIPOtaSoftwareUpdateRequestorGeneratedCommandListAttributeCallback() +CHIPOtaSoftwareUpdateRequestorGeneratedCommandListAttributeCallback::~ +CHIPOtaSoftwareUpdateRequestorGeneratedCommandListAttributeCallback() { JNIEnv * env = chip::JniReferences::GetInstance().GetEnvForCurrentThread(); if (env == nullptr) @@ -6071,7 +6071,7 @@ void CHIPOtaSoftwareUpdateRequestorGeneratedCommandListAttributeCallback::Callba } CHIPOtaSoftwareUpdateRequestorAcceptedCommandListAttributeCallback:: - CHIPOtaSoftwareUpdateRequestorAcceptedCommandListAttributeCallback(jobject javaCallback, bool keepAlive) : +CHIPOtaSoftwareUpdateRequestorAcceptedCommandListAttributeCallback(jobject javaCallback, bool keepAlive) : chip::Callback::Callback(CallbackFn, this), keepAlive(keepAlive) { @@ -6089,8 +6089,8 @@ CHIPOtaSoftwareUpdateRequestorAcceptedCommandListAttributeCallback:: } } -CHIPOtaSoftwareUpdateRequestorAcceptedCommandListAttributeCallback:: - ~CHIPOtaSoftwareUpdateRequestorAcceptedCommandListAttributeCallback() +CHIPOtaSoftwareUpdateRequestorAcceptedCommandListAttributeCallback::~ +CHIPOtaSoftwareUpdateRequestorAcceptedCommandListAttributeCallback() { JNIEnv * env = chip::JniReferences::GetInstance().GetEnvForCurrentThread(); if (env == nullptr) @@ -6356,7 +6356,7 @@ void CHIPLocalizationConfigurationSupportedLocalesAttributeCallback::CallbackFn( } CHIPLocalizationConfigurationGeneratedCommandListAttributeCallback:: - CHIPLocalizationConfigurationGeneratedCommandListAttributeCallback(jobject javaCallback, bool keepAlive) : +CHIPLocalizationConfigurationGeneratedCommandListAttributeCallback(jobject javaCallback, bool keepAlive) : chip::Callback::Callback(CallbackFn, this), keepAlive(keepAlive) { @@ -6374,8 +6374,8 @@ CHIPLocalizationConfigurationGeneratedCommandListAttributeCallback:: } } -CHIPLocalizationConfigurationGeneratedCommandListAttributeCallback:: - ~CHIPLocalizationConfigurationGeneratedCommandListAttributeCallback() +CHIPLocalizationConfigurationGeneratedCommandListAttributeCallback::~ +CHIPLocalizationConfigurationGeneratedCommandListAttributeCallback() { JNIEnv * env = chip::JniReferences::GetInstance().GetEnvForCurrentThread(); if (env == nullptr) @@ -6429,7 +6429,7 @@ void CHIPLocalizationConfigurationGeneratedCommandListAttributeCallback::Callbac } CHIPLocalizationConfigurationAcceptedCommandListAttributeCallback:: - CHIPLocalizationConfigurationAcceptedCommandListAttributeCallback(jobject javaCallback, bool keepAlive) : +CHIPLocalizationConfigurationAcceptedCommandListAttributeCallback(jobject javaCallback, bool keepAlive) : chip::Callback::Callback(CallbackFn, this), keepAlive(keepAlive) { @@ -6447,8 +6447,8 @@ CHIPLocalizationConfigurationAcceptedCommandListAttributeCallback:: } } -CHIPLocalizationConfigurationAcceptedCommandListAttributeCallback:: - ~CHIPLocalizationConfigurationAcceptedCommandListAttributeCallback() +CHIPLocalizationConfigurationAcceptedCommandListAttributeCallback::~ +CHIPLocalizationConfigurationAcceptedCommandListAttributeCallback() { JNIEnv * env = chip::JniReferences::GetInstance().GetEnvForCurrentThread(); if (env == nullptr) @@ -6646,7 +6646,7 @@ void CHIPLocalizationConfigurationAttributeListAttributeCallback::CallbackFn( } CHIPTimeFormatLocalizationSupportedCalendarTypesAttributeCallback:: - CHIPTimeFormatLocalizationSupportedCalendarTypesAttributeCallback(jobject javaCallback, bool keepAlive) : +CHIPTimeFormatLocalizationSupportedCalendarTypesAttributeCallback(jobject javaCallback, bool keepAlive) : chip::Callback::Callback(CallbackFn, this), keepAlive(keepAlive) { @@ -6664,8 +6664,8 @@ CHIPTimeFormatLocalizationSupportedCalendarTypesAttributeCallback:: } } -CHIPTimeFormatLocalizationSupportedCalendarTypesAttributeCallback:: - ~CHIPTimeFormatLocalizationSupportedCalendarTypesAttributeCallback() +CHIPTimeFormatLocalizationSupportedCalendarTypesAttributeCallback::~ +CHIPTimeFormatLocalizationSupportedCalendarTypesAttributeCallback() { JNIEnv * env = chip::JniReferences::GetInstance().GetEnvForCurrentThread(); if (env == nullptr) @@ -7365,7 +7365,7 @@ void CHIPPowerSourceConfigurationSourcesAttributeCallback::CallbackFn( } CHIPPowerSourceConfigurationGeneratedCommandListAttributeCallback:: - CHIPPowerSourceConfigurationGeneratedCommandListAttributeCallback(jobject javaCallback, bool keepAlive) : +CHIPPowerSourceConfigurationGeneratedCommandListAttributeCallback(jobject javaCallback, bool keepAlive) : chip::Callback::Callback(CallbackFn, this), keepAlive(keepAlive) { @@ -7383,8 +7383,8 @@ CHIPPowerSourceConfigurationGeneratedCommandListAttributeCallback:: } } -CHIPPowerSourceConfigurationGeneratedCommandListAttributeCallback:: - ~CHIPPowerSourceConfigurationGeneratedCommandListAttributeCallback() +CHIPPowerSourceConfigurationGeneratedCommandListAttributeCallback::~ +CHIPPowerSourceConfigurationGeneratedCommandListAttributeCallback() { JNIEnv * env = chip::JniReferences::GetInstance().GetEnvForCurrentThread(); if (env == nullptr) @@ -7456,8 +7456,8 @@ CHIPPowerSourceConfigurationAcceptedCommandListAttributeCallback::CHIPPowerSourc } } -CHIPPowerSourceConfigurationAcceptedCommandListAttributeCallback:: - ~CHIPPowerSourceConfigurationAcceptedCommandListAttributeCallback() +CHIPPowerSourceConfigurationAcceptedCommandListAttributeCallback::~ +CHIPPowerSourceConfigurationAcceptedCommandListAttributeCallback() { JNIEnv * env = chip::JniReferences::GetInstance().GetEnvForCurrentThread(); if (env == nullptr) @@ -12543,7 +12543,7 @@ void CHIPThreadNetworkDiagnosticsChannelPage0MaskAttributeCallback::CallbackFn( } CHIPThreadNetworkDiagnosticsActiveNetworkFaultsListAttributeCallback:: - CHIPThreadNetworkDiagnosticsActiveNetworkFaultsListAttributeCallback(jobject javaCallback, bool keepAlive) : +CHIPThreadNetworkDiagnosticsActiveNetworkFaultsListAttributeCallback(jobject javaCallback, bool keepAlive) : chip::Callback::Callback(CallbackFn, this), keepAlive(keepAlive) { @@ -12561,8 +12561,8 @@ CHIPThreadNetworkDiagnosticsActiveNetworkFaultsListAttributeCallback:: } } -CHIPThreadNetworkDiagnosticsActiveNetworkFaultsListAttributeCallback:: - ~CHIPThreadNetworkDiagnosticsActiveNetworkFaultsListAttributeCallback() +CHIPThreadNetworkDiagnosticsActiveNetworkFaultsListAttributeCallback::~ +CHIPThreadNetworkDiagnosticsActiveNetworkFaultsListAttributeCallback() { JNIEnv * env = chip::JniReferences::GetInstance().GetEnvForCurrentThread(); if (env == nullptr) @@ -12617,7 +12617,7 @@ void CHIPThreadNetworkDiagnosticsActiveNetworkFaultsListAttributeCallback::Callb } CHIPThreadNetworkDiagnosticsGeneratedCommandListAttributeCallback:: - CHIPThreadNetworkDiagnosticsGeneratedCommandListAttributeCallback(jobject javaCallback, bool keepAlive) : +CHIPThreadNetworkDiagnosticsGeneratedCommandListAttributeCallback(jobject javaCallback, bool keepAlive) : chip::Callback::Callback(CallbackFn, this), keepAlive(keepAlive) { @@ -12635,8 +12635,8 @@ CHIPThreadNetworkDiagnosticsGeneratedCommandListAttributeCallback:: } } -CHIPThreadNetworkDiagnosticsGeneratedCommandListAttributeCallback:: - ~CHIPThreadNetworkDiagnosticsGeneratedCommandListAttributeCallback() +CHIPThreadNetworkDiagnosticsGeneratedCommandListAttributeCallback::~ +CHIPThreadNetworkDiagnosticsGeneratedCommandListAttributeCallback() { JNIEnv * env = chip::JniReferences::GetInstance().GetEnvForCurrentThread(); if (env == nullptr) @@ -12708,8 +12708,8 @@ CHIPThreadNetworkDiagnosticsAcceptedCommandListAttributeCallback::CHIPThreadNetw } } -CHIPThreadNetworkDiagnosticsAcceptedCommandListAttributeCallback:: - ~CHIPThreadNetworkDiagnosticsAcceptedCommandListAttributeCallback() +CHIPThreadNetworkDiagnosticsAcceptedCommandListAttributeCallback::~ +CHIPThreadNetworkDiagnosticsAcceptedCommandListAttributeCallback() { JNIEnv * env = chip::JniReferences::GetInstance().GetEnvForCurrentThread(); if (env == nullptr) @@ -13380,7 +13380,7 @@ void CHIPWiFiNetworkDiagnosticsBeaconRxCountAttributeCallback::CallbackFn(void * } CHIPWiFiNetworkDiagnosticsPacketMulticastRxCountAttributeCallback:: - CHIPWiFiNetworkDiagnosticsPacketMulticastRxCountAttributeCallback(jobject javaCallback, bool keepAlive) : +CHIPWiFiNetworkDiagnosticsPacketMulticastRxCountAttributeCallback(jobject javaCallback, bool keepAlive) : chip::Callback::Callback(CallbackFn, this), keepAlive(keepAlive) { @@ -13398,8 +13398,8 @@ CHIPWiFiNetworkDiagnosticsPacketMulticastRxCountAttributeCallback:: } } -CHIPWiFiNetworkDiagnosticsPacketMulticastRxCountAttributeCallback:: - ~CHIPWiFiNetworkDiagnosticsPacketMulticastRxCountAttributeCallback() +CHIPWiFiNetworkDiagnosticsPacketMulticastRxCountAttributeCallback::~ +CHIPWiFiNetworkDiagnosticsPacketMulticastRxCountAttributeCallback() { JNIEnv * env = chip::JniReferences::GetInstance().GetEnvForCurrentThread(); if (env == nullptr) @@ -13449,7 +13449,7 @@ void CHIPWiFiNetworkDiagnosticsPacketMulticastRxCountAttributeCallback::Callback } CHIPWiFiNetworkDiagnosticsPacketMulticastTxCountAttributeCallback:: - CHIPWiFiNetworkDiagnosticsPacketMulticastTxCountAttributeCallback(jobject javaCallback, bool keepAlive) : +CHIPWiFiNetworkDiagnosticsPacketMulticastTxCountAttributeCallback(jobject javaCallback, bool keepAlive) : chip::Callback::Callback(CallbackFn, this), keepAlive(keepAlive) { @@ -13467,8 +13467,8 @@ CHIPWiFiNetworkDiagnosticsPacketMulticastTxCountAttributeCallback:: } } -CHIPWiFiNetworkDiagnosticsPacketMulticastTxCountAttributeCallback:: - ~CHIPWiFiNetworkDiagnosticsPacketMulticastTxCountAttributeCallback() +CHIPWiFiNetworkDiagnosticsPacketMulticastTxCountAttributeCallback::~ +CHIPWiFiNetworkDiagnosticsPacketMulticastTxCountAttributeCallback() { JNIEnv * env = chip::JniReferences::GetInstance().GetEnvForCurrentThread(); if (env == nullptr) @@ -14282,7 +14282,7 @@ void CHIPEthernetNetworkDiagnosticsCarrierDetectAttributeCallback::CallbackFn(vo } CHIPEthernetNetworkDiagnosticsGeneratedCommandListAttributeCallback:: - CHIPEthernetNetworkDiagnosticsGeneratedCommandListAttributeCallback(jobject javaCallback, bool keepAlive) : +CHIPEthernetNetworkDiagnosticsGeneratedCommandListAttributeCallback(jobject javaCallback, bool keepAlive) : chip::Callback::Callback(CallbackFn, this), keepAlive(keepAlive) { @@ -14300,8 +14300,8 @@ CHIPEthernetNetworkDiagnosticsGeneratedCommandListAttributeCallback:: } } -CHIPEthernetNetworkDiagnosticsGeneratedCommandListAttributeCallback:: - ~CHIPEthernetNetworkDiagnosticsGeneratedCommandListAttributeCallback() +CHIPEthernetNetworkDiagnosticsGeneratedCommandListAttributeCallback::~ +CHIPEthernetNetworkDiagnosticsGeneratedCommandListAttributeCallback() { JNIEnv * env = chip::JniReferences::GetInstance().GetEnvForCurrentThread(); if (env == nullptr) @@ -14355,7 +14355,7 @@ void CHIPEthernetNetworkDiagnosticsGeneratedCommandListAttributeCallback::Callba } CHIPEthernetNetworkDiagnosticsAcceptedCommandListAttributeCallback:: - CHIPEthernetNetworkDiagnosticsAcceptedCommandListAttributeCallback(jobject javaCallback, bool keepAlive) : +CHIPEthernetNetworkDiagnosticsAcceptedCommandListAttributeCallback(jobject javaCallback, bool keepAlive) : chip::Callback::Callback(CallbackFn, this), keepAlive(keepAlive) { @@ -14373,8 +14373,8 @@ CHIPEthernetNetworkDiagnosticsAcceptedCommandListAttributeCallback:: } } -CHIPEthernetNetworkDiagnosticsAcceptedCommandListAttributeCallback:: - ~CHIPEthernetNetworkDiagnosticsAcceptedCommandListAttributeCallback() +CHIPEthernetNetworkDiagnosticsAcceptedCommandListAttributeCallback::~ +CHIPEthernetNetworkDiagnosticsAcceptedCommandListAttributeCallback() { JNIEnv * env = chip::JniReferences::GetInstance().GetEnvForCurrentThread(); if (env == nullptr) @@ -15284,7 +15284,7 @@ void CHIPTimeSynchronizationAttributeListAttributeCallback::CallbackFn( } CHIPBridgedDeviceBasicInformationGeneratedCommandListAttributeCallback:: - CHIPBridgedDeviceBasicInformationGeneratedCommandListAttributeCallback(jobject javaCallback, bool keepAlive) : +CHIPBridgedDeviceBasicInformationGeneratedCommandListAttributeCallback(jobject javaCallback, bool keepAlive) : chip::Callback::Callback(CallbackFn, this), keepAlive(keepAlive) { @@ -15302,8 +15302,8 @@ CHIPBridgedDeviceBasicInformationGeneratedCommandListAttributeCallback:: } } -CHIPBridgedDeviceBasicInformationGeneratedCommandListAttributeCallback:: - ~CHIPBridgedDeviceBasicInformationGeneratedCommandListAttributeCallback() +CHIPBridgedDeviceBasicInformationGeneratedCommandListAttributeCallback::~ +CHIPBridgedDeviceBasicInformationGeneratedCommandListAttributeCallback() { JNIEnv * env = chip::JniReferences::GetInstance().GetEnvForCurrentThread(); if (env == nullptr) @@ -15357,7 +15357,7 @@ void CHIPBridgedDeviceBasicInformationGeneratedCommandListAttributeCallback::Cal } CHIPBridgedDeviceBasicInformationAcceptedCommandListAttributeCallback:: - CHIPBridgedDeviceBasicInformationAcceptedCommandListAttributeCallback(jobject javaCallback, bool keepAlive) : +CHIPBridgedDeviceBasicInformationAcceptedCommandListAttributeCallback(jobject javaCallback, bool keepAlive) : chip::Callback::Callback(CallbackFn, this), keepAlive(keepAlive) { @@ -15375,8 +15375,8 @@ CHIPBridgedDeviceBasicInformationAcceptedCommandListAttributeCallback:: } } -CHIPBridgedDeviceBasicInformationAcceptedCommandListAttributeCallback:: - ~CHIPBridgedDeviceBasicInformationAcceptedCommandListAttributeCallback() +CHIPBridgedDeviceBasicInformationAcceptedCommandListAttributeCallback::~ +CHIPBridgedDeviceBasicInformationAcceptedCommandListAttributeCallback() { JNIEnv * env = chip::JniReferences::GetInstance().GetEnvForCurrentThread(); if (env == nullptr) @@ -15992,7 +15992,7 @@ void CHIPAdministratorCommissioningAdminVendorIdAttributeCallback::CallbackFn( } CHIPAdministratorCommissioningGeneratedCommandListAttributeCallback:: - CHIPAdministratorCommissioningGeneratedCommandListAttributeCallback(jobject javaCallback, bool keepAlive) : +CHIPAdministratorCommissioningGeneratedCommandListAttributeCallback(jobject javaCallback, bool keepAlive) : chip::Callback::Callback(CallbackFn, this), keepAlive(keepAlive) { @@ -16010,8 +16010,8 @@ CHIPAdministratorCommissioningGeneratedCommandListAttributeCallback:: } } -CHIPAdministratorCommissioningGeneratedCommandListAttributeCallback:: - ~CHIPAdministratorCommissioningGeneratedCommandListAttributeCallback() +CHIPAdministratorCommissioningGeneratedCommandListAttributeCallback::~ +CHIPAdministratorCommissioningGeneratedCommandListAttributeCallback() { JNIEnv * env = chip::JniReferences::GetInstance().GetEnvForCurrentThread(); if (env == nullptr) @@ -16065,7 +16065,7 @@ void CHIPAdministratorCommissioningGeneratedCommandListAttributeCallback::Callba } CHIPAdministratorCommissioningAcceptedCommandListAttributeCallback:: - CHIPAdministratorCommissioningAcceptedCommandListAttributeCallback(jobject javaCallback, bool keepAlive) : +CHIPAdministratorCommissioningAcceptedCommandListAttributeCallback(jobject javaCallback, bool keepAlive) : chip::Callback::Callback(CallbackFn, this), keepAlive(keepAlive) { @@ -16083,8 +16083,8 @@ CHIPAdministratorCommissioningAcceptedCommandListAttributeCallback:: } } -CHIPAdministratorCommissioningAcceptedCommandListAttributeCallback:: - ~CHIPAdministratorCommissioningAcceptedCommandListAttributeCallback() +CHIPAdministratorCommissioningAcceptedCommandListAttributeCallback::~ +CHIPAdministratorCommissioningAcceptedCommandListAttributeCallback() { JNIEnv * env = chip::JniReferences::GetInstance().GetEnvForCurrentThread(); if (env == nullptr) @@ -16517,7 +16517,7 @@ void CHIPOperationalCredentialsFabricsAttributeCallback::CallbackFn( } CHIPOperationalCredentialsTrustedRootCertificatesAttributeCallback:: - CHIPOperationalCredentialsTrustedRootCertificatesAttributeCallback(jobject javaCallback, bool keepAlive) : +CHIPOperationalCredentialsTrustedRootCertificatesAttributeCallback(jobject javaCallback, bool keepAlive) : chip::Callback::Callback(CallbackFn, this), keepAlive(keepAlive) { @@ -16535,8 +16535,8 @@ CHIPOperationalCredentialsTrustedRootCertificatesAttributeCallback:: } } -CHIPOperationalCredentialsTrustedRootCertificatesAttributeCallback:: - ~CHIPOperationalCredentialsTrustedRootCertificatesAttributeCallback() +CHIPOperationalCredentialsTrustedRootCertificatesAttributeCallback::~ +CHIPOperationalCredentialsTrustedRootCertificatesAttributeCallback() { JNIEnv * env = chip::JniReferences::GetInstance().GetEnvForCurrentThread(); if (env == nullptr) @@ -20166,7 +20166,7 @@ void CHIPOvenCavityOperationalStateCountdownTimeAttributeCallback::CallbackFn( } CHIPOvenCavityOperationalStateOperationalStateListAttributeCallback:: - CHIPOvenCavityOperationalStateOperationalStateListAttributeCallback(jobject javaCallback, bool keepAlive) : +CHIPOvenCavityOperationalStateOperationalStateListAttributeCallback(jobject javaCallback, bool keepAlive) : chip::Callback::Callback(CallbackFn, this), keepAlive(keepAlive) { @@ -20184,8 +20184,8 @@ CHIPOvenCavityOperationalStateOperationalStateListAttributeCallback:: } } -CHIPOvenCavityOperationalStateOperationalStateListAttributeCallback:: - ~CHIPOvenCavityOperationalStateOperationalStateListAttributeCallback() +CHIPOvenCavityOperationalStateOperationalStateListAttributeCallback::~ +CHIPOvenCavityOperationalStateOperationalStateListAttributeCallback() { JNIEnv * env = chip::JniReferences::GetInstance().GetEnvForCurrentThread(); if (env == nullptr) @@ -20276,7 +20276,7 @@ void CHIPOvenCavityOperationalStateOperationalStateListAttributeCallback::Callba } CHIPOvenCavityOperationalStateGeneratedCommandListAttributeCallback:: - CHIPOvenCavityOperationalStateGeneratedCommandListAttributeCallback(jobject javaCallback, bool keepAlive) : +CHIPOvenCavityOperationalStateGeneratedCommandListAttributeCallback(jobject javaCallback, bool keepAlive) : chip::Callback::Callback(CallbackFn, this), keepAlive(keepAlive) { @@ -20294,8 +20294,8 @@ CHIPOvenCavityOperationalStateGeneratedCommandListAttributeCallback:: } } -CHIPOvenCavityOperationalStateGeneratedCommandListAttributeCallback:: - ~CHIPOvenCavityOperationalStateGeneratedCommandListAttributeCallback() +CHIPOvenCavityOperationalStateGeneratedCommandListAttributeCallback::~ +CHIPOvenCavityOperationalStateGeneratedCommandListAttributeCallback() { JNIEnv * env = chip::JniReferences::GetInstance().GetEnvForCurrentThread(); if (env == nullptr) @@ -20349,7 +20349,7 @@ void CHIPOvenCavityOperationalStateGeneratedCommandListAttributeCallback::Callba } CHIPOvenCavityOperationalStateAcceptedCommandListAttributeCallback:: - CHIPOvenCavityOperationalStateAcceptedCommandListAttributeCallback(jobject javaCallback, bool keepAlive) : +CHIPOvenCavityOperationalStateAcceptedCommandListAttributeCallback(jobject javaCallback, bool keepAlive) : chip::Callback::Callback(CallbackFn, this), keepAlive(keepAlive) { @@ -20367,8 +20367,8 @@ CHIPOvenCavityOperationalStateAcceptedCommandListAttributeCallback:: } } -CHIPOvenCavityOperationalStateAcceptedCommandListAttributeCallback:: - ~CHIPOvenCavityOperationalStateAcceptedCommandListAttributeCallback() +CHIPOvenCavityOperationalStateAcceptedCommandListAttributeCallback::~ +CHIPOvenCavityOperationalStateAcceptedCommandListAttributeCallback() { JNIEnv * env = chip::JniReferences::GetInstance().GetEnvForCurrentThread(); if (env == nullptr) @@ -22731,7 +22731,7 @@ void CHIPLaundryWasherModeAttributeListAttributeCallback::CallbackFn( } CHIPRefrigeratorAndTemperatureControlledCabinetModeSupportedModesAttributeCallback:: - CHIPRefrigeratorAndTemperatureControlledCabinetModeSupportedModesAttributeCallback(jobject javaCallback, bool keepAlive) : +CHIPRefrigeratorAndTemperatureControlledCabinetModeSupportedModesAttributeCallback(jobject javaCallback, bool keepAlive) : chip::Callback::Callback( CallbackFn, this), keepAlive(keepAlive) @@ -22750,8 +22750,8 @@ CHIPRefrigeratorAndTemperatureControlledCabinetModeSupportedModesAttributeCallba } } -CHIPRefrigeratorAndTemperatureControlledCabinetModeSupportedModesAttributeCallback:: - ~CHIPRefrigeratorAndTemperatureControlledCabinetModeSupportedModesAttributeCallback() +CHIPRefrigeratorAndTemperatureControlledCabinetModeSupportedModesAttributeCallback::~ +CHIPRefrigeratorAndTemperatureControlledCabinetModeSupportedModesAttributeCallback() { JNIEnv * env = chip::JniReferences::GetInstance().GetEnvForCurrentThread(); if (env == nullptr) @@ -22890,7 +22890,7 @@ void CHIPRefrigeratorAndTemperatureControlledCabinetModeSupportedModesAttributeC } CHIPRefrigeratorAndTemperatureControlledCabinetModeStartUpModeAttributeCallback:: - CHIPRefrigeratorAndTemperatureControlledCabinetModeStartUpModeAttributeCallback(jobject javaCallback, bool keepAlive) : +CHIPRefrigeratorAndTemperatureControlledCabinetModeStartUpModeAttributeCallback(jobject javaCallback, bool keepAlive) : chip::Callback::Callback(CallbackFn, this), keepAlive(keepAlive) @@ -22909,8 +22909,8 @@ CHIPRefrigeratorAndTemperatureControlledCabinetModeStartUpModeAttributeCallback: } } -CHIPRefrigeratorAndTemperatureControlledCabinetModeStartUpModeAttributeCallback:: - ~CHIPRefrigeratorAndTemperatureControlledCabinetModeStartUpModeAttributeCallback() +CHIPRefrigeratorAndTemperatureControlledCabinetModeStartUpModeAttributeCallback::~ +CHIPRefrigeratorAndTemperatureControlledCabinetModeStartUpModeAttributeCallback() { JNIEnv * env = chip::JniReferences::GetInstance().GetEnvForCurrentThread(); if (env == nullptr) @@ -22961,7 +22961,7 @@ void CHIPRefrigeratorAndTemperatureControlledCabinetModeStartUpModeAttributeCall } CHIPRefrigeratorAndTemperatureControlledCabinetModeOnModeAttributeCallback:: - CHIPRefrigeratorAndTemperatureControlledCabinetModeOnModeAttributeCallback(jobject javaCallback, bool keepAlive) : +CHIPRefrigeratorAndTemperatureControlledCabinetModeOnModeAttributeCallback(jobject javaCallback, bool keepAlive) : chip::Callback::Callback(CallbackFn, this), keepAlive(keepAlive) @@ -22980,8 +22980,8 @@ CHIPRefrigeratorAndTemperatureControlledCabinetModeOnModeAttributeCallback:: } } -CHIPRefrigeratorAndTemperatureControlledCabinetModeOnModeAttributeCallback:: - ~CHIPRefrigeratorAndTemperatureControlledCabinetModeOnModeAttributeCallback() +CHIPRefrigeratorAndTemperatureControlledCabinetModeOnModeAttributeCallback::~ +CHIPRefrigeratorAndTemperatureControlledCabinetModeOnModeAttributeCallback() { JNIEnv * env = chip::JniReferences::GetInstance().GetEnvForCurrentThread(); if (env == nullptr) @@ -23032,7 +23032,7 @@ void CHIPRefrigeratorAndTemperatureControlledCabinetModeOnModeAttributeCallback: } CHIPRefrigeratorAndTemperatureControlledCabinetModeGeneratedCommandListAttributeCallback:: - CHIPRefrigeratorAndTemperatureControlledCabinetModeGeneratedCommandListAttributeCallback(jobject javaCallback, bool keepAlive) : +CHIPRefrigeratorAndTemperatureControlledCabinetModeGeneratedCommandListAttributeCallback(jobject javaCallback, bool keepAlive) : chip::Callback::Callback( CallbackFn, this), keepAlive(keepAlive) @@ -23051,8 +23051,8 @@ CHIPRefrigeratorAndTemperatureControlledCabinetModeGeneratedCommandListAttribute } } -CHIPRefrigeratorAndTemperatureControlledCabinetModeGeneratedCommandListAttributeCallback:: - ~CHIPRefrigeratorAndTemperatureControlledCabinetModeGeneratedCommandListAttributeCallback() +CHIPRefrigeratorAndTemperatureControlledCabinetModeGeneratedCommandListAttributeCallback::~ +CHIPRefrigeratorAndTemperatureControlledCabinetModeGeneratedCommandListAttributeCallback() { JNIEnv * env = chip::JniReferences::GetInstance().GetEnvForCurrentThread(); if (env == nullptr) @@ -23109,7 +23109,7 @@ void CHIPRefrigeratorAndTemperatureControlledCabinetModeGeneratedCommandListAttr } CHIPRefrigeratorAndTemperatureControlledCabinetModeAcceptedCommandListAttributeCallback:: - CHIPRefrigeratorAndTemperatureControlledCabinetModeAcceptedCommandListAttributeCallback(jobject javaCallback, bool keepAlive) : +CHIPRefrigeratorAndTemperatureControlledCabinetModeAcceptedCommandListAttributeCallback(jobject javaCallback, bool keepAlive) : chip::Callback::Callback( CallbackFn, this), keepAlive(keepAlive) @@ -23128,8 +23128,8 @@ CHIPRefrigeratorAndTemperatureControlledCabinetModeAcceptedCommandListAttributeC } } -CHIPRefrigeratorAndTemperatureControlledCabinetModeAcceptedCommandListAttributeCallback:: - ~CHIPRefrigeratorAndTemperatureControlledCabinetModeAcceptedCommandListAttributeCallback() +CHIPRefrigeratorAndTemperatureControlledCabinetModeAcceptedCommandListAttributeCallback::~ +CHIPRefrigeratorAndTemperatureControlledCabinetModeAcceptedCommandListAttributeCallback() { JNIEnv * env = chip::JniReferences::GetInstance().GetEnvForCurrentThread(); if (env == nullptr) @@ -23186,7 +23186,7 @@ void CHIPRefrigeratorAndTemperatureControlledCabinetModeAcceptedCommandListAttri } CHIPRefrigeratorAndTemperatureControlledCabinetModeEventListAttributeCallback:: - CHIPRefrigeratorAndTemperatureControlledCabinetModeEventListAttributeCallback(jobject javaCallback, bool keepAlive) : +CHIPRefrigeratorAndTemperatureControlledCabinetModeEventListAttributeCallback(jobject javaCallback, bool keepAlive) : chip::Callback::Callback(CallbackFn, this), keepAlive(keepAlive) @@ -23205,8 +23205,8 @@ CHIPRefrigeratorAndTemperatureControlledCabinetModeEventListAttributeCallback:: } } -CHIPRefrigeratorAndTemperatureControlledCabinetModeEventListAttributeCallback:: - ~CHIPRefrigeratorAndTemperatureControlledCabinetModeEventListAttributeCallback() +CHIPRefrigeratorAndTemperatureControlledCabinetModeEventListAttributeCallback::~ +CHIPRefrigeratorAndTemperatureControlledCabinetModeEventListAttributeCallback() { JNIEnv * env = chip::JniReferences::GetInstance().GetEnvForCurrentThread(); if (env == nullptr) @@ -23261,7 +23261,7 @@ void CHIPRefrigeratorAndTemperatureControlledCabinetModeEventListAttributeCallba } CHIPRefrigeratorAndTemperatureControlledCabinetModeAttributeListAttributeCallback:: - CHIPRefrigeratorAndTemperatureControlledCabinetModeAttributeListAttributeCallback(jobject javaCallback, bool keepAlive) : +CHIPRefrigeratorAndTemperatureControlledCabinetModeAttributeListAttributeCallback(jobject javaCallback, bool keepAlive) : chip::Callback::Callback( CallbackFn, this), keepAlive(keepAlive) @@ -23280,8 +23280,8 @@ CHIPRefrigeratorAndTemperatureControlledCabinetModeAttributeListAttributeCallbac } } -CHIPRefrigeratorAndTemperatureControlledCabinetModeAttributeListAttributeCallback:: - ~CHIPRefrigeratorAndTemperatureControlledCabinetModeAttributeListAttributeCallback() +CHIPRefrigeratorAndTemperatureControlledCabinetModeAttributeListAttributeCallback::~ +CHIPRefrigeratorAndTemperatureControlledCabinetModeAttributeListAttributeCallback() { JNIEnv * env = chip::JniReferences::GetInstance().GetEnvForCurrentThread(); if (env == nullptr) @@ -24820,7 +24820,7 @@ void CHIPRvcCleanModeAttributeListAttributeCallback::CallbackFn(void * context, } CHIPTemperatureControlSupportedTemperatureLevelsAttributeCallback:: - CHIPTemperatureControlSupportedTemperatureLevelsAttributeCallback(jobject javaCallback, bool keepAlive) : +CHIPTemperatureControlSupportedTemperatureLevelsAttributeCallback(jobject javaCallback, bool keepAlive) : chip::Callback::Callback(CallbackFn, this), keepAlive(keepAlive) { @@ -24838,8 +24838,8 @@ CHIPTemperatureControlSupportedTemperatureLevelsAttributeCallback:: } } -CHIPTemperatureControlSupportedTemperatureLevelsAttributeCallback:: - ~CHIPTemperatureControlSupportedTemperatureLevelsAttributeCallback() +CHIPTemperatureControlSupportedTemperatureLevelsAttributeCallback::~ +CHIPTemperatureControlSupportedTemperatureLevelsAttributeCallback() { JNIEnv * env = chip::JniReferences::GetInstance().GetEnvForCurrentThread(); if (env == nullptr) @@ -29261,7 +29261,7 @@ void CHIPHepaFilterMonitoringAttributeListAttributeCallback::CallbackFn( } CHIPActivatedCarbonFilterMonitoringLastChangedTimeAttributeCallback:: - CHIPActivatedCarbonFilterMonitoringLastChangedTimeAttributeCallback(jobject javaCallback, bool keepAlive) : +CHIPActivatedCarbonFilterMonitoringLastChangedTimeAttributeCallback(jobject javaCallback, bool keepAlive) : chip::Callback::Callback(CallbackFn, this), keepAlive(keepAlive) { @@ -29279,8 +29279,8 @@ CHIPActivatedCarbonFilterMonitoringLastChangedTimeAttributeCallback:: } } -CHIPActivatedCarbonFilterMonitoringLastChangedTimeAttributeCallback:: - ~CHIPActivatedCarbonFilterMonitoringLastChangedTimeAttributeCallback() +CHIPActivatedCarbonFilterMonitoringLastChangedTimeAttributeCallback::~ +CHIPActivatedCarbonFilterMonitoringLastChangedTimeAttributeCallback() { JNIEnv * env = chip::JniReferences::GetInstance().GetEnvForCurrentThread(); if (env == nullptr) @@ -29330,7 +29330,7 @@ void CHIPActivatedCarbonFilterMonitoringLastChangedTimeAttributeCallback::Callba } CHIPActivatedCarbonFilterMonitoringReplacementProductListAttributeCallback:: - CHIPActivatedCarbonFilterMonitoringReplacementProductListAttributeCallback(jobject javaCallback, bool keepAlive) : +CHIPActivatedCarbonFilterMonitoringReplacementProductListAttributeCallback(jobject javaCallback, bool keepAlive) : chip::Callback::Callback(CallbackFn, this), keepAlive(keepAlive) @@ -29349,8 +29349,8 @@ CHIPActivatedCarbonFilterMonitoringReplacementProductListAttributeCallback:: } } -CHIPActivatedCarbonFilterMonitoringReplacementProductListAttributeCallback:: - ~CHIPActivatedCarbonFilterMonitoringReplacementProductListAttributeCallback() +CHIPActivatedCarbonFilterMonitoringReplacementProductListAttributeCallback::~ +CHIPActivatedCarbonFilterMonitoringReplacementProductListAttributeCallback() { JNIEnv * env = chip::JniReferences::GetInstance().GetEnvForCurrentThread(); if (env == nullptr) @@ -29433,7 +29433,7 @@ void CHIPActivatedCarbonFilterMonitoringReplacementProductListAttributeCallback: } CHIPActivatedCarbonFilterMonitoringGeneratedCommandListAttributeCallback:: - CHIPActivatedCarbonFilterMonitoringGeneratedCommandListAttributeCallback(jobject javaCallback, bool keepAlive) : +CHIPActivatedCarbonFilterMonitoringGeneratedCommandListAttributeCallback(jobject javaCallback, bool keepAlive) : chip::Callback::Callback(CallbackFn, this), keepAlive(keepAlive) { @@ -29451,8 +29451,8 @@ CHIPActivatedCarbonFilterMonitoringGeneratedCommandListAttributeCallback:: } } -CHIPActivatedCarbonFilterMonitoringGeneratedCommandListAttributeCallback:: - ~CHIPActivatedCarbonFilterMonitoringGeneratedCommandListAttributeCallback() +CHIPActivatedCarbonFilterMonitoringGeneratedCommandListAttributeCallback::~ +CHIPActivatedCarbonFilterMonitoringGeneratedCommandListAttributeCallback() { JNIEnv * env = chip::JniReferences::GetInstance().GetEnvForCurrentThread(); if (env == nullptr) @@ -29506,7 +29506,7 @@ void CHIPActivatedCarbonFilterMonitoringGeneratedCommandListAttributeCallback::C } CHIPActivatedCarbonFilterMonitoringAcceptedCommandListAttributeCallback:: - CHIPActivatedCarbonFilterMonitoringAcceptedCommandListAttributeCallback(jobject javaCallback, bool keepAlive) : +CHIPActivatedCarbonFilterMonitoringAcceptedCommandListAttributeCallback(jobject javaCallback, bool keepAlive) : chip::Callback::Callback(CallbackFn, this), keepAlive(keepAlive) { @@ -29524,8 +29524,8 @@ CHIPActivatedCarbonFilterMonitoringAcceptedCommandListAttributeCallback:: } } -CHIPActivatedCarbonFilterMonitoringAcceptedCommandListAttributeCallback:: - ~CHIPActivatedCarbonFilterMonitoringAcceptedCommandListAttributeCallback() +CHIPActivatedCarbonFilterMonitoringAcceptedCommandListAttributeCallback::~ +CHIPActivatedCarbonFilterMonitoringAcceptedCommandListAttributeCallback() { JNIEnv * env = chip::JniReferences::GetInstance().GetEnvForCurrentThread(); if (env == nullptr) @@ -29651,7 +29651,7 @@ void CHIPActivatedCarbonFilterMonitoringEventListAttributeCallback::CallbackFn( } CHIPActivatedCarbonFilterMonitoringAttributeListAttributeCallback:: - CHIPActivatedCarbonFilterMonitoringAttributeListAttributeCallback(jobject javaCallback, bool keepAlive) : +CHIPActivatedCarbonFilterMonitoringAttributeListAttributeCallback(jobject javaCallback, bool keepAlive) : chip::Callback::Callback(CallbackFn, this), keepAlive(keepAlive) { @@ -29669,8 +29669,8 @@ CHIPActivatedCarbonFilterMonitoringAttributeListAttributeCallback:: } } -CHIPActivatedCarbonFilterMonitoringAttributeListAttributeCallback:: - ~CHIPActivatedCarbonFilterMonitoringAttributeListAttributeCallback() +CHIPActivatedCarbonFilterMonitoringAttributeListAttributeCallback::~ +CHIPActivatedCarbonFilterMonitoringAttributeListAttributeCallback() { JNIEnv * env = chip::JniReferences::GetInstance().GetEnvForCurrentThread(); if (env == nullptr) @@ -29724,7 +29724,7 @@ void CHIPActivatedCarbonFilterMonitoringAttributeListAttributeCallback::Callback } CHIPBooleanStateConfigurationGeneratedCommandListAttributeCallback:: - CHIPBooleanStateConfigurationGeneratedCommandListAttributeCallback(jobject javaCallback, bool keepAlive) : +CHIPBooleanStateConfigurationGeneratedCommandListAttributeCallback(jobject javaCallback, bool keepAlive) : chip::Callback::Callback(CallbackFn, this), keepAlive(keepAlive) { @@ -29742,8 +29742,8 @@ CHIPBooleanStateConfigurationGeneratedCommandListAttributeCallback:: } } -CHIPBooleanStateConfigurationGeneratedCommandListAttributeCallback:: - ~CHIPBooleanStateConfigurationGeneratedCommandListAttributeCallback() +CHIPBooleanStateConfigurationGeneratedCommandListAttributeCallback::~ +CHIPBooleanStateConfigurationGeneratedCommandListAttributeCallback() { JNIEnv * env = chip::JniReferences::GetInstance().GetEnvForCurrentThread(); if (env == nullptr) @@ -29797,7 +29797,7 @@ void CHIPBooleanStateConfigurationGeneratedCommandListAttributeCallback::Callbac } CHIPBooleanStateConfigurationAcceptedCommandListAttributeCallback:: - CHIPBooleanStateConfigurationAcceptedCommandListAttributeCallback(jobject javaCallback, bool keepAlive) : +CHIPBooleanStateConfigurationAcceptedCommandListAttributeCallback(jobject javaCallback, bool keepAlive) : chip::Callback::Callback(CallbackFn, this), keepAlive(keepAlive) { @@ -29815,8 +29815,8 @@ CHIPBooleanStateConfigurationAcceptedCommandListAttributeCallback:: } } -CHIPBooleanStateConfigurationAcceptedCommandListAttributeCallback:: - ~CHIPBooleanStateConfigurationAcceptedCommandListAttributeCallback() +CHIPBooleanStateConfigurationAcceptedCommandListAttributeCallback::~ +CHIPBooleanStateConfigurationAcceptedCommandListAttributeCallback() { JNIEnv * env = chip::JniReferences::GetInstance().GetEnvForCurrentThread(); if (env == nullptr) @@ -30082,7 +30082,7 @@ void CHIPValveConfigurationAndControlOpenDurationAttributeCallback::CallbackFn( } CHIPValveConfigurationAndControlDefaultOpenDurationAttributeCallback:: - CHIPValveConfigurationAndControlDefaultOpenDurationAttributeCallback(jobject javaCallback, bool keepAlive) : +CHIPValveConfigurationAndControlDefaultOpenDurationAttributeCallback(jobject javaCallback, bool keepAlive) : chip::Callback::Callback(CallbackFn, this), keepAlive(keepAlive) { @@ -30100,8 +30100,8 @@ CHIPValveConfigurationAndControlDefaultOpenDurationAttributeCallback:: } } -CHIPValveConfigurationAndControlDefaultOpenDurationAttributeCallback:: - ~CHIPValveConfigurationAndControlDefaultOpenDurationAttributeCallback() +CHIPValveConfigurationAndControlDefaultOpenDurationAttributeCallback::~ +CHIPValveConfigurationAndControlDefaultOpenDurationAttributeCallback() { JNIEnv * env = chip::JniReferences::GetInstance().GetEnvForCurrentThread(); if (env == nullptr) @@ -30219,7 +30219,7 @@ void CHIPValveConfigurationAndControlAutoCloseTimeAttributeCallback::CallbackFn( } CHIPValveConfigurationAndControlRemainingDurationAttributeCallback:: - CHIPValveConfigurationAndControlRemainingDurationAttributeCallback(jobject javaCallback, bool keepAlive) : +CHIPValveConfigurationAndControlRemainingDurationAttributeCallback(jobject javaCallback, bool keepAlive) : chip::Callback::Callback(CallbackFn, this), keepAlive(keepAlive) { @@ -30237,8 +30237,8 @@ CHIPValveConfigurationAndControlRemainingDurationAttributeCallback:: } } -CHIPValveConfigurationAndControlRemainingDurationAttributeCallback:: - ~CHIPValveConfigurationAndControlRemainingDurationAttributeCallback() +CHIPValveConfigurationAndControlRemainingDurationAttributeCallback::~ +CHIPValveConfigurationAndControlRemainingDurationAttributeCallback() { JNIEnv * env = chip::JniReferences::GetInstance().GetEnvForCurrentThread(); if (env == nullptr) @@ -30560,7 +30560,7 @@ void CHIPValveConfigurationAndControlTargetLevelAttributeCallback::CallbackFn( } CHIPValveConfigurationAndControlGeneratedCommandListAttributeCallback:: - CHIPValveConfigurationAndControlGeneratedCommandListAttributeCallback(jobject javaCallback, bool keepAlive) : +CHIPValveConfigurationAndControlGeneratedCommandListAttributeCallback(jobject javaCallback, bool keepAlive) : chip::Callback::Callback(CallbackFn, this), keepAlive(keepAlive) { @@ -30578,8 +30578,8 @@ CHIPValveConfigurationAndControlGeneratedCommandListAttributeCallback:: } } -CHIPValveConfigurationAndControlGeneratedCommandListAttributeCallback:: - ~CHIPValveConfigurationAndControlGeneratedCommandListAttributeCallback() +CHIPValveConfigurationAndControlGeneratedCommandListAttributeCallback::~ +CHIPValveConfigurationAndControlGeneratedCommandListAttributeCallback() { JNIEnv * env = chip::JniReferences::GetInstance().GetEnvForCurrentThread(); if (env == nullptr) @@ -30633,7 +30633,7 @@ void CHIPValveConfigurationAndControlGeneratedCommandListAttributeCallback::Call } CHIPValveConfigurationAndControlAcceptedCommandListAttributeCallback:: - CHIPValveConfigurationAndControlAcceptedCommandListAttributeCallback(jobject javaCallback, bool keepAlive) : +CHIPValveConfigurationAndControlAcceptedCommandListAttributeCallback(jobject javaCallback, bool keepAlive) : chip::Callback::Callback(CallbackFn, this), keepAlive(keepAlive) { @@ -30651,8 +30651,8 @@ CHIPValveConfigurationAndControlAcceptedCommandListAttributeCallback:: } } -CHIPValveConfigurationAndControlAcceptedCommandListAttributeCallback:: - ~CHIPValveConfigurationAndControlAcceptedCommandListAttributeCallback() +CHIPValveConfigurationAndControlAcceptedCommandListAttributeCallback::~ +CHIPValveConfigurationAndControlAcceptedCommandListAttributeCallback() { JNIEnv * env = chip::JniReferences::GetInstance().GetEnvForCurrentThread(); if (env == nullptr) @@ -30850,7 +30850,7 @@ void CHIPValveConfigurationAndControlAttributeListAttributeCallback::CallbackFn( } CHIPElectricalEnergyMeasurementGeneratedCommandListAttributeCallback:: - CHIPElectricalEnergyMeasurementGeneratedCommandListAttributeCallback(jobject javaCallback, bool keepAlive) : +CHIPElectricalEnergyMeasurementGeneratedCommandListAttributeCallback(jobject javaCallback, bool keepAlive) : chip::Callback::Callback(CallbackFn, this), keepAlive(keepAlive) { @@ -30868,8 +30868,8 @@ CHIPElectricalEnergyMeasurementGeneratedCommandListAttributeCallback:: } } -CHIPElectricalEnergyMeasurementGeneratedCommandListAttributeCallback:: - ~CHIPElectricalEnergyMeasurementGeneratedCommandListAttributeCallback() +CHIPElectricalEnergyMeasurementGeneratedCommandListAttributeCallback::~ +CHIPElectricalEnergyMeasurementGeneratedCommandListAttributeCallback() { JNIEnv * env = chip::JniReferences::GetInstance().GetEnvForCurrentThread(); if (env == nullptr) @@ -30923,7 +30923,7 @@ void CHIPElectricalEnergyMeasurementGeneratedCommandListAttributeCallback::Callb } CHIPElectricalEnergyMeasurementAcceptedCommandListAttributeCallback:: - CHIPElectricalEnergyMeasurementAcceptedCommandListAttributeCallback(jobject javaCallback, bool keepAlive) : +CHIPElectricalEnergyMeasurementAcceptedCommandListAttributeCallback(jobject javaCallback, bool keepAlive) : chip::Callback::Callback(CallbackFn, this), keepAlive(keepAlive) { @@ -30941,8 +30941,8 @@ CHIPElectricalEnergyMeasurementAcceptedCommandListAttributeCallback:: } } -CHIPElectricalEnergyMeasurementAcceptedCommandListAttributeCallback:: - ~CHIPElectricalEnergyMeasurementAcceptedCommandListAttributeCallback() +CHIPElectricalEnergyMeasurementAcceptedCommandListAttributeCallback::~ +CHIPElectricalEnergyMeasurementAcceptedCommandListAttributeCallback() { JNIEnv * env = chip::JniReferences::GetInstance().GetEnvForCurrentThread(); if (env == nullptr) @@ -31140,7 +31140,7 @@ void CHIPElectricalEnergyMeasurementAttributeListAttributeCallback::CallbackFn( } CHIPDemandResponseLoadControlLoadControlProgramsAttributeCallback:: - CHIPDemandResponseLoadControlLoadControlProgramsAttributeCallback(jobject javaCallback, bool keepAlive) : +CHIPDemandResponseLoadControlLoadControlProgramsAttributeCallback(jobject javaCallback, bool keepAlive) : chip::Callback::Callback(CallbackFn, this), keepAlive(keepAlive) { @@ -31158,8 +31158,8 @@ CHIPDemandResponseLoadControlLoadControlProgramsAttributeCallback:: } } -CHIPDemandResponseLoadControlLoadControlProgramsAttributeCallback:: - ~CHIPDemandResponseLoadControlLoadControlProgramsAttributeCallback() +CHIPDemandResponseLoadControlLoadControlProgramsAttributeCallback::~ +CHIPDemandResponseLoadControlLoadControlProgramsAttributeCallback() { JNIEnv * env = chip::JniReferences::GetInstance().GetEnvForCurrentThread(); if (env == nullptr) @@ -32375,7 +32375,7 @@ void CHIPDemandResponseLoadControlActiveEventsAttributeCallback::CallbackFn( } CHIPDemandResponseLoadControlGeneratedCommandListAttributeCallback:: - CHIPDemandResponseLoadControlGeneratedCommandListAttributeCallback(jobject javaCallback, bool keepAlive) : +CHIPDemandResponseLoadControlGeneratedCommandListAttributeCallback(jobject javaCallback, bool keepAlive) : chip::Callback::Callback(CallbackFn, this), keepAlive(keepAlive) { @@ -32393,8 +32393,8 @@ CHIPDemandResponseLoadControlGeneratedCommandListAttributeCallback:: } } -CHIPDemandResponseLoadControlGeneratedCommandListAttributeCallback:: - ~CHIPDemandResponseLoadControlGeneratedCommandListAttributeCallback() +CHIPDemandResponseLoadControlGeneratedCommandListAttributeCallback::~ +CHIPDemandResponseLoadControlGeneratedCommandListAttributeCallback() { JNIEnv * env = chip::JniReferences::GetInstance().GetEnvForCurrentThread(); if (env == nullptr) @@ -32448,7 +32448,7 @@ void CHIPDemandResponseLoadControlGeneratedCommandListAttributeCallback::Callbac } CHIPDemandResponseLoadControlAcceptedCommandListAttributeCallback:: - CHIPDemandResponseLoadControlAcceptedCommandListAttributeCallback(jobject javaCallback, bool keepAlive) : +CHIPDemandResponseLoadControlAcceptedCommandListAttributeCallback(jobject javaCallback, bool keepAlive) : chip::Callback::Callback(CallbackFn, this), keepAlive(keepAlive) { @@ -32466,8 +32466,8 @@ CHIPDemandResponseLoadControlAcceptedCommandListAttributeCallback:: } } -CHIPDemandResponseLoadControlAcceptedCommandListAttributeCallback:: - ~CHIPDemandResponseLoadControlAcceptedCommandListAttributeCallback() +CHIPDemandResponseLoadControlAcceptedCommandListAttributeCallback::~ +CHIPDemandResponseLoadControlAcceptedCommandListAttributeCallback() { JNIEnv * env = chip::JniReferences::GetInstance().GetEnvForCurrentThread(); if (env == nullptr) @@ -32665,7 +32665,7 @@ void CHIPDemandResponseLoadControlAttributeListAttributeCallback::CallbackFn( } CHIPDeviceEnergyManagementPowerAdjustmentCapabilityAttributeCallback:: - CHIPDeviceEnergyManagementPowerAdjustmentCapabilityAttributeCallback(jobject javaCallback, bool keepAlive) : +CHIPDeviceEnergyManagementPowerAdjustmentCapabilityAttributeCallback(jobject javaCallback, bool keepAlive) : chip::Callback::Callback(CallbackFn, this), keepAlive(keepAlive) { @@ -32683,8 +32683,8 @@ CHIPDeviceEnergyManagementPowerAdjustmentCapabilityAttributeCallback:: } } -CHIPDeviceEnergyManagementPowerAdjustmentCapabilityAttributeCallback:: - ~CHIPDeviceEnergyManagementPowerAdjustmentCapabilityAttributeCallback() +CHIPDeviceEnergyManagementPowerAdjustmentCapabilityAttributeCallback::~ +CHIPDeviceEnergyManagementPowerAdjustmentCapabilityAttributeCallback() { JNIEnv * env = chip::JniReferences::GetInstance().GetEnvForCurrentThread(); if (env == nullptr) @@ -35493,8 +35493,8 @@ CHIPWindowCoveringCurrentPositionLiftPercentageAttributeCallback::CHIPWindowCove } } -CHIPWindowCoveringCurrentPositionLiftPercentageAttributeCallback:: - ~CHIPWindowCoveringCurrentPositionLiftPercentageAttributeCallback() +CHIPWindowCoveringCurrentPositionLiftPercentageAttributeCallback::~ +CHIPWindowCoveringCurrentPositionLiftPercentageAttributeCallback() { JNIEnv * env = chip::JniReferences::GetInstance().GetEnvForCurrentThread(); if (env == nullptr) @@ -35562,8 +35562,8 @@ CHIPWindowCoveringCurrentPositionTiltPercentageAttributeCallback::CHIPWindowCove } } -CHIPWindowCoveringCurrentPositionTiltPercentageAttributeCallback:: - ~CHIPWindowCoveringCurrentPositionTiltPercentageAttributeCallback() +CHIPWindowCoveringCurrentPositionTiltPercentageAttributeCallback::~ +CHIPWindowCoveringCurrentPositionTiltPercentageAttributeCallback() { JNIEnv * env = chip::JniReferences::GetInstance().GetEnvForCurrentThread(); if (env == nullptr) @@ -35613,7 +35613,7 @@ void CHIPWindowCoveringCurrentPositionTiltPercentageAttributeCallback::CallbackF } CHIPWindowCoveringTargetPositionLiftPercent100thsAttributeCallback:: - CHIPWindowCoveringTargetPositionLiftPercent100thsAttributeCallback(jobject javaCallback, bool keepAlive) : +CHIPWindowCoveringTargetPositionLiftPercent100thsAttributeCallback(jobject javaCallback, bool keepAlive) : chip::Callback::Callback(CallbackFn, this), keepAlive(keepAlive) { @@ -35631,8 +35631,8 @@ CHIPWindowCoveringTargetPositionLiftPercent100thsAttributeCallback:: } } -CHIPWindowCoveringTargetPositionLiftPercent100thsAttributeCallback:: - ~CHIPWindowCoveringTargetPositionLiftPercent100thsAttributeCallback() +CHIPWindowCoveringTargetPositionLiftPercent100thsAttributeCallback::~ +CHIPWindowCoveringTargetPositionLiftPercent100thsAttributeCallback() { JNIEnv * env = chip::JniReferences::GetInstance().GetEnvForCurrentThread(); if (env == nullptr) @@ -35682,7 +35682,7 @@ void CHIPWindowCoveringTargetPositionLiftPercent100thsAttributeCallback::Callbac } CHIPWindowCoveringTargetPositionTiltPercent100thsAttributeCallback:: - CHIPWindowCoveringTargetPositionTiltPercent100thsAttributeCallback(jobject javaCallback, bool keepAlive) : +CHIPWindowCoveringTargetPositionTiltPercent100thsAttributeCallback(jobject javaCallback, bool keepAlive) : chip::Callback::Callback(CallbackFn, this), keepAlive(keepAlive) { @@ -35700,8 +35700,8 @@ CHIPWindowCoveringTargetPositionTiltPercent100thsAttributeCallback:: } } -CHIPWindowCoveringTargetPositionTiltPercent100thsAttributeCallback:: - ~CHIPWindowCoveringTargetPositionTiltPercent100thsAttributeCallback() +CHIPWindowCoveringTargetPositionTiltPercent100thsAttributeCallback::~ +CHIPWindowCoveringTargetPositionTiltPercent100thsAttributeCallback() { JNIEnv * env = chip::JniReferences::GetInstance().GetEnvForCurrentThread(); if (env == nullptr) @@ -35751,7 +35751,7 @@ void CHIPWindowCoveringTargetPositionTiltPercent100thsAttributeCallback::Callbac } CHIPWindowCoveringCurrentPositionLiftPercent100thsAttributeCallback:: - CHIPWindowCoveringCurrentPositionLiftPercent100thsAttributeCallback(jobject javaCallback, bool keepAlive) : +CHIPWindowCoveringCurrentPositionLiftPercent100thsAttributeCallback(jobject javaCallback, bool keepAlive) : chip::Callback::Callback(CallbackFn, this), keepAlive(keepAlive) { @@ -35769,8 +35769,8 @@ CHIPWindowCoveringCurrentPositionLiftPercent100thsAttributeCallback:: } } -CHIPWindowCoveringCurrentPositionLiftPercent100thsAttributeCallback:: - ~CHIPWindowCoveringCurrentPositionLiftPercent100thsAttributeCallback() +CHIPWindowCoveringCurrentPositionLiftPercent100thsAttributeCallback::~ +CHIPWindowCoveringCurrentPositionLiftPercent100thsAttributeCallback() { JNIEnv * env = chip::JniReferences::GetInstance().GetEnvForCurrentThread(); if (env == nullptr) @@ -35820,7 +35820,7 @@ void CHIPWindowCoveringCurrentPositionLiftPercent100thsAttributeCallback::Callba } CHIPWindowCoveringCurrentPositionTiltPercent100thsAttributeCallback:: - CHIPWindowCoveringCurrentPositionTiltPercent100thsAttributeCallback(jobject javaCallback, bool keepAlive) : +CHIPWindowCoveringCurrentPositionTiltPercent100thsAttributeCallback(jobject javaCallback, bool keepAlive) : chip::Callback::Callback(CallbackFn, this), keepAlive(keepAlive) { @@ -35838,8 +35838,8 @@ CHIPWindowCoveringCurrentPositionTiltPercent100thsAttributeCallback:: } } -CHIPWindowCoveringCurrentPositionTiltPercent100thsAttributeCallback:: - ~CHIPWindowCoveringCurrentPositionTiltPercent100thsAttributeCallback() +CHIPWindowCoveringCurrentPositionTiltPercent100thsAttributeCallback::~ +CHIPWindowCoveringCurrentPositionTiltPercent100thsAttributeCallback() { JNIEnv * env = chip::JniReferences::GetInstance().GetEnvForCurrentThread(); if (env == nullptr) @@ -36681,8 +36681,8 @@ CHIPPumpConfigurationAndControlMinConstPressureAttributeCallback::CHIPPumpConfig } } -CHIPPumpConfigurationAndControlMinConstPressureAttributeCallback:: - ~CHIPPumpConfigurationAndControlMinConstPressureAttributeCallback() +CHIPPumpConfigurationAndControlMinConstPressureAttributeCallback::~ +CHIPPumpConfigurationAndControlMinConstPressureAttributeCallback() { JNIEnv * env = chip::JniReferences::GetInstance().GetEnvForCurrentThread(); if (env == nullptr) @@ -36750,8 +36750,8 @@ CHIPPumpConfigurationAndControlMaxConstPressureAttributeCallback::CHIPPumpConfig } } -CHIPPumpConfigurationAndControlMaxConstPressureAttributeCallback:: - ~CHIPPumpConfigurationAndControlMaxConstPressureAttributeCallback() +CHIPPumpConfigurationAndControlMaxConstPressureAttributeCallback::~ +CHIPPumpConfigurationAndControlMaxConstPressureAttributeCallback() { JNIEnv * env = chip::JniReferences::GetInstance().GetEnvForCurrentThread(); if (env == nullptr) @@ -37481,7 +37481,7 @@ void CHIPPumpConfigurationAndControlSpeedAttributeCallback::CallbackFn(void * co } CHIPPumpConfigurationAndControlLifetimeRunningHoursAttributeCallback:: - CHIPPumpConfigurationAndControlLifetimeRunningHoursAttributeCallback(jobject javaCallback, bool keepAlive) : +CHIPPumpConfigurationAndControlLifetimeRunningHoursAttributeCallback(jobject javaCallback, bool keepAlive) : chip::Callback::Callback(CallbackFn, this), keepAlive(keepAlive) { @@ -37499,8 +37499,8 @@ CHIPPumpConfigurationAndControlLifetimeRunningHoursAttributeCallback:: } } -CHIPPumpConfigurationAndControlLifetimeRunningHoursAttributeCallback:: - ~CHIPPumpConfigurationAndControlLifetimeRunningHoursAttributeCallback() +CHIPPumpConfigurationAndControlLifetimeRunningHoursAttributeCallback::~ +CHIPPumpConfigurationAndControlLifetimeRunningHoursAttributeCallback() { JNIEnv * env = chip::JniReferences::GetInstance().GetEnvForCurrentThread(); if (env == nullptr) @@ -37618,7 +37618,7 @@ void CHIPPumpConfigurationAndControlPowerAttributeCallback::CallbackFn(void * co } CHIPPumpConfigurationAndControlLifetimeEnergyConsumedAttributeCallback:: - CHIPPumpConfigurationAndControlLifetimeEnergyConsumedAttributeCallback(jobject javaCallback, bool keepAlive) : +CHIPPumpConfigurationAndControlLifetimeEnergyConsumedAttributeCallback(jobject javaCallback, bool keepAlive) : chip::Callback::Callback(CallbackFn, this), keepAlive(keepAlive) { @@ -37636,8 +37636,8 @@ CHIPPumpConfigurationAndControlLifetimeEnergyConsumedAttributeCallback:: } } -CHIPPumpConfigurationAndControlLifetimeEnergyConsumedAttributeCallback:: - ~CHIPPumpConfigurationAndControlLifetimeEnergyConsumedAttributeCallback() +CHIPPumpConfigurationAndControlLifetimeEnergyConsumedAttributeCallback::~ +CHIPPumpConfigurationAndControlLifetimeEnergyConsumedAttributeCallback() { JNIEnv * env = chip::JniReferences::GetInstance().GetEnvForCurrentThread(); if (env == nullptr) @@ -37687,7 +37687,7 @@ void CHIPPumpConfigurationAndControlLifetimeEnergyConsumedAttributeCallback::Cal } CHIPPumpConfigurationAndControlGeneratedCommandListAttributeCallback:: - CHIPPumpConfigurationAndControlGeneratedCommandListAttributeCallback(jobject javaCallback, bool keepAlive) : +CHIPPumpConfigurationAndControlGeneratedCommandListAttributeCallback(jobject javaCallback, bool keepAlive) : chip::Callback::Callback(CallbackFn, this), keepAlive(keepAlive) { @@ -37705,8 +37705,8 @@ CHIPPumpConfigurationAndControlGeneratedCommandListAttributeCallback:: } } -CHIPPumpConfigurationAndControlGeneratedCommandListAttributeCallback:: - ~CHIPPumpConfigurationAndControlGeneratedCommandListAttributeCallback() +CHIPPumpConfigurationAndControlGeneratedCommandListAttributeCallback::~ +CHIPPumpConfigurationAndControlGeneratedCommandListAttributeCallback() { JNIEnv * env = chip::JniReferences::GetInstance().GetEnvForCurrentThread(); if (env == nullptr) @@ -37760,7 +37760,7 @@ void CHIPPumpConfigurationAndControlGeneratedCommandListAttributeCallback::Callb } CHIPPumpConfigurationAndControlAcceptedCommandListAttributeCallback:: - CHIPPumpConfigurationAndControlAcceptedCommandListAttributeCallback(jobject javaCallback, bool keepAlive) : +CHIPPumpConfigurationAndControlAcceptedCommandListAttributeCallback(jobject javaCallback, bool keepAlive) : chip::Callback::Callback(CallbackFn, this), keepAlive(keepAlive) { @@ -37778,8 +37778,8 @@ CHIPPumpConfigurationAndControlAcceptedCommandListAttributeCallback:: } } -CHIPPumpConfigurationAndControlAcceptedCommandListAttributeCallback:: - ~CHIPPumpConfigurationAndControlAcceptedCommandListAttributeCallback() +CHIPPumpConfigurationAndControlAcceptedCommandListAttributeCallback::~ +CHIPPumpConfigurationAndControlAcceptedCommandListAttributeCallback() { JNIEnv * env = chip::JniReferences::GetInstance().GetEnvForCurrentThread(); if (env == nullptr) @@ -39410,7 +39410,7 @@ void CHIPFanControlAttributeListAttributeCallback::CallbackFn(void * context, } CHIPThermostatUserInterfaceConfigurationGeneratedCommandListAttributeCallback:: - CHIPThermostatUserInterfaceConfigurationGeneratedCommandListAttributeCallback(jobject javaCallback, bool keepAlive) : +CHIPThermostatUserInterfaceConfigurationGeneratedCommandListAttributeCallback(jobject javaCallback, bool keepAlive) : chip::Callback::Callback(CallbackFn, this), keepAlive(keepAlive) @@ -39429,8 +39429,8 @@ CHIPThermostatUserInterfaceConfigurationGeneratedCommandListAttributeCallback:: } } -CHIPThermostatUserInterfaceConfigurationGeneratedCommandListAttributeCallback:: - ~CHIPThermostatUserInterfaceConfigurationGeneratedCommandListAttributeCallback() +CHIPThermostatUserInterfaceConfigurationGeneratedCommandListAttributeCallback::~ +CHIPThermostatUserInterfaceConfigurationGeneratedCommandListAttributeCallback() { JNIEnv * env = chip::JniReferences::GetInstance().GetEnvForCurrentThread(); if (env == nullptr) @@ -39485,7 +39485,7 @@ void CHIPThermostatUserInterfaceConfigurationGeneratedCommandListAttributeCallba } CHIPThermostatUserInterfaceConfigurationAcceptedCommandListAttributeCallback:: - CHIPThermostatUserInterfaceConfigurationAcceptedCommandListAttributeCallback(jobject javaCallback, bool keepAlive) : +CHIPThermostatUserInterfaceConfigurationAcceptedCommandListAttributeCallback(jobject javaCallback, bool keepAlive) : chip::Callback::Callback(CallbackFn, this), keepAlive(keepAlive) @@ -39504,8 +39504,8 @@ CHIPThermostatUserInterfaceConfigurationAcceptedCommandListAttributeCallback:: } } -CHIPThermostatUserInterfaceConfigurationAcceptedCommandListAttributeCallback:: - ~CHIPThermostatUserInterfaceConfigurationAcceptedCommandListAttributeCallback() +CHIPThermostatUserInterfaceConfigurationAcceptedCommandListAttributeCallback::~ +CHIPThermostatUserInterfaceConfigurationAcceptedCommandListAttributeCallback() { JNIEnv * env = chip::JniReferences::GetInstance().GetEnvForCurrentThread(); if (env == nullptr) @@ -39560,7 +39560,7 @@ void CHIPThermostatUserInterfaceConfigurationAcceptedCommandListAttributeCallbac } CHIPThermostatUserInterfaceConfigurationEventListAttributeCallback:: - CHIPThermostatUserInterfaceConfigurationEventListAttributeCallback(jobject javaCallback, bool keepAlive) : +CHIPThermostatUserInterfaceConfigurationEventListAttributeCallback(jobject javaCallback, bool keepAlive) : chip::Callback::Callback(CallbackFn, this), keepAlive(keepAlive) { @@ -39578,8 +39578,8 @@ CHIPThermostatUserInterfaceConfigurationEventListAttributeCallback:: } } -CHIPThermostatUserInterfaceConfigurationEventListAttributeCallback:: - ~CHIPThermostatUserInterfaceConfigurationEventListAttributeCallback() +CHIPThermostatUserInterfaceConfigurationEventListAttributeCallback::~ +CHIPThermostatUserInterfaceConfigurationEventListAttributeCallback() { JNIEnv * env = chip::JniReferences::GetInstance().GetEnvForCurrentThread(); if (env == nullptr) @@ -39633,7 +39633,7 @@ void CHIPThermostatUserInterfaceConfigurationEventListAttributeCallback::Callbac } CHIPThermostatUserInterfaceConfigurationAttributeListAttributeCallback:: - CHIPThermostatUserInterfaceConfigurationAttributeListAttributeCallback(jobject javaCallback, bool keepAlive) : +CHIPThermostatUserInterfaceConfigurationAttributeListAttributeCallback(jobject javaCallback, bool keepAlive) : chip::Callback::Callback(CallbackFn, this), keepAlive(keepAlive) { @@ -39651,8 +39651,8 @@ CHIPThermostatUserInterfaceConfigurationAttributeListAttributeCallback:: } } -CHIPThermostatUserInterfaceConfigurationAttributeListAttributeCallback:: - ~CHIPThermostatUserInterfaceConfigurationAttributeListAttributeCallback() +CHIPThermostatUserInterfaceConfigurationAttributeListAttributeCallback::~ +CHIPThermostatUserInterfaceConfigurationAttributeListAttributeCallback() { JNIEnv * env = chip::JniReferences::GetInstance().GetEnvForCurrentThread(); if (env == nullptr) @@ -40818,8 +40818,8 @@ CHIPBallastConfigurationBallastFactorAdjustmentAttributeCallback::CHIPBallastCon } } -CHIPBallastConfigurationBallastFactorAdjustmentAttributeCallback:: - ~CHIPBallastConfigurationBallastFactorAdjustmentAttributeCallback() +CHIPBallastConfigurationBallastFactorAdjustmentAttributeCallback::~ +CHIPBallastConfigurationBallastFactorAdjustmentAttributeCallback() { JNIEnv * env = chip::JniReferences::GetInstance().GetEnvForCurrentThread(); if (env == nullptr) @@ -43680,8 +43680,8 @@ CHIPRelativeHumidityMeasurementMinMeasuredValueAttributeCallback::CHIPRelativeHu } } -CHIPRelativeHumidityMeasurementMinMeasuredValueAttributeCallback:: - ~CHIPRelativeHumidityMeasurementMinMeasuredValueAttributeCallback() +CHIPRelativeHumidityMeasurementMinMeasuredValueAttributeCallback::~ +CHIPRelativeHumidityMeasurementMinMeasuredValueAttributeCallback() { JNIEnv * env = chip::JniReferences::GetInstance().GetEnvForCurrentThread(); if (env == nullptr) @@ -43749,8 +43749,8 @@ CHIPRelativeHumidityMeasurementMaxMeasuredValueAttributeCallback::CHIPRelativeHu } } -CHIPRelativeHumidityMeasurementMaxMeasuredValueAttributeCallback:: - ~CHIPRelativeHumidityMeasurementMaxMeasuredValueAttributeCallback() +CHIPRelativeHumidityMeasurementMaxMeasuredValueAttributeCallback::~ +CHIPRelativeHumidityMeasurementMaxMeasuredValueAttributeCallback() { JNIEnv * env = chip::JniReferences::GetInstance().GetEnvForCurrentThread(); if (env == nullptr) @@ -43800,7 +43800,7 @@ void CHIPRelativeHumidityMeasurementMaxMeasuredValueAttributeCallback::CallbackF } CHIPRelativeHumidityMeasurementGeneratedCommandListAttributeCallback:: - CHIPRelativeHumidityMeasurementGeneratedCommandListAttributeCallback(jobject javaCallback, bool keepAlive) : +CHIPRelativeHumidityMeasurementGeneratedCommandListAttributeCallback(jobject javaCallback, bool keepAlive) : chip::Callback::Callback(CallbackFn, this), keepAlive(keepAlive) { @@ -43818,8 +43818,8 @@ CHIPRelativeHumidityMeasurementGeneratedCommandListAttributeCallback:: } } -CHIPRelativeHumidityMeasurementGeneratedCommandListAttributeCallback:: - ~CHIPRelativeHumidityMeasurementGeneratedCommandListAttributeCallback() +CHIPRelativeHumidityMeasurementGeneratedCommandListAttributeCallback::~ +CHIPRelativeHumidityMeasurementGeneratedCommandListAttributeCallback() { JNIEnv * env = chip::JniReferences::GetInstance().GetEnvForCurrentThread(); if (env == nullptr) @@ -43873,7 +43873,7 @@ void CHIPRelativeHumidityMeasurementGeneratedCommandListAttributeCallback::Callb } CHIPRelativeHumidityMeasurementAcceptedCommandListAttributeCallback:: - CHIPRelativeHumidityMeasurementAcceptedCommandListAttributeCallback(jobject javaCallback, bool keepAlive) : +CHIPRelativeHumidityMeasurementAcceptedCommandListAttributeCallback(jobject javaCallback, bool keepAlive) : chip::Callback::Callback(CallbackFn, this), keepAlive(keepAlive) { @@ -43891,8 +43891,8 @@ CHIPRelativeHumidityMeasurementAcceptedCommandListAttributeCallback:: } } -CHIPRelativeHumidityMeasurementAcceptedCommandListAttributeCallback:: - ~CHIPRelativeHumidityMeasurementAcceptedCommandListAttributeCallback() +CHIPRelativeHumidityMeasurementAcceptedCommandListAttributeCallback::~ +CHIPRelativeHumidityMeasurementAcceptedCommandListAttributeCallback() { JNIEnv * env = chip::JniReferences::GetInstance().GetEnvForCurrentThread(); if (env == nullptr) @@ -44376,7 +44376,7 @@ void CHIPOccupancySensingAttributeListAttributeCallback::CallbackFn( } CHIPCarbonMonoxideConcentrationMeasurementMeasuredValueAttributeCallback:: - CHIPCarbonMonoxideConcentrationMeasurementMeasuredValueAttributeCallback(jobject javaCallback, bool keepAlive) : +CHIPCarbonMonoxideConcentrationMeasurementMeasuredValueAttributeCallback(jobject javaCallback, bool keepAlive) : chip::Callback::Callback(CallbackFn, this), keepAlive(keepAlive) { @@ -44394,8 +44394,8 @@ CHIPCarbonMonoxideConcentrationMeasurementMeasuredValueAttributeCallback:: } } -CHIPCarbonMonoxideConcentrationMeasurementMeasuredValueAttributeCallback:: - ~CHIPCarbonMonoxideConcentrationMeasurementMeasuredValueAttributeCallback() +CHIPCarbonMonoxideConcentrationMeasurementMeasuredValueAttributeCallback::~ +CHIPCarbonMonoxideConcentrationMeasurementMeasuredValueAttributeCallback() { JNIEnv * env = chip::JniReferences::GetInstance().GetEnvForCurrentThread(); if (env == nullptr) @@ -44445,7 +44445,7 @@ void CHIPCarbonMonoxideConcentrationMeasurementMeasuredValueAttributeCallback::C } CHIPCarbonMonoxideConcentrationMeasurementMinMeasuredValueAttributeCallback:: - CHIPCarbonMonoxideConcentrationMeasurementMinMeasuredValueAttributeCallback(jobject javaCallback, bool keepAlive) : +CHIPCarbonMonoxideConcentrationMeasurementMinMeasuredValueAttributeCallback(jobject javaCallback, bool keepAlive) : chip::Callback::Callback(CallbackFn, this), keepAlive(keepAlive) @@ -44464,8 +44464,8 @@ CHIPCarbonMonoxideConcentrationMeasurementMinMeasuredValueAttributeCallback:: } } -CHIPCarbonMonoxideConcentrationMeasurementMinMeasuredValueAttributeCallback:: - ~CHIPCarbonMonoxideConcentrationMeasurementMinMeasuredValueAttributeCallback() +CHIPCarbonMonoxideConcentrationMeasurementMinMeasuredValueAttributeCallback::~ +CHIPCarbonMonoxideConcentrationMeasurementMinMeasuredValueAttributeCallback() { JNIEnv * env = chip::JniReferences::GetInstance().GetEnvForCurrentThread(); if (env == nullptr) @@ -44516,7 +44516,7 @@ void CHIPCarbonMonoxideConcentrationMeasurementMinMeasuredValueAttributeCallback } CHIPCarbonMonoxideConcentrationMeasurementMaxMeasuredValueAttributeCallback:: - CHIPCarbonMonoxideConcentrationMeasurementMaxMeasuredValueAttributeCallback(jobject javaCallback, bool keepAlive) : +CHIPCarbonMonoxideConcentrationMeasurementMaxMeasuredValueAttributeCallback(jobject javaCallback, bool keepAlive) : chip::Callback::Callback(CallbackFn, this), keepAlive(keepAlive) @@ -44535,8 +44535,8 @@ CHIPCarbonMonoxideConcentrationMeasurementMaxMeasuredValueAttributeCallback:: } } -CHIPCarbonMonoxideConcentrationMeasurementMaxMeasuredValueAttributeCallback:: - ~CHIPCarbonMonoxideConcentrationMeasurementMaxMeasuredValueAttributeCallback() +CHIPCarbonMonoxideConcentrationMeasurementMaxMeasuredValueAttributeCallback::~ +CHIPCarbonMonoxideConcentrationMeasurementMaxMeasuredValueAttributeCallback() { JNIEnv * env = chip::JniReferences::GetInstance().GetEnvForCurrentThread(); if (env == nullptr) @@ -44587,7 +44587,7 @@ void CHIPCarbonMonoxideConcentrationMeasurementMaxMeasuredValueAttributeCallback } CHIPCarbonMonoxideConcentrationMeasurementPeakMeasuredValueAttributeCallback:: - CHIPCarbonMonoxideConcentrationMeasurementPeakMeasuredValueAttributeCallback(jobject javaCallback, bool keepAlive) : +CHIPCarbonMonoxideConcentrationMeasurementPeakMeasuredValueAttributeCallback(jobject javaCallback, bool keepAlive) : chip::Callback::Callback(CallbackFn, this), keepAlive(keepAlive) @@ -44606,8 +44606,8 @@ CHIPCarbonMonoxideConcentrationMeasurementPeakMeasuredValueAttributeCallback:: } } -CHIPCarbonMonoxideConcentrationMeasurementPeakMeasuredValueAttributeCallback:: - ~CHIPCarbonMonoxideConcentrationMeasurementPeakMeasuredValueAttributeCallback() +CHIPCarbonMonoxideConcentrationMeasurementPeakMeasuredValueAttributeCallback::~ +CHIPCarbonMonoxideConcentrationMeasurementPeakMeasuredValueAttributeCallback() { JNIEnv * env = chip::JniReferences::GetInstance().GetEnvForCurrentThread(); if (env == nullptr) @@ -44658,7 +44658,7 @@ void CHIPCarbonMonoxideConcentrationMeasurementPeakMeasuredValueAttributeCallbac } CHIPCarbonMonoxideConcentrationMeasurementAverageMeasuredValueAttributeCallback:: - CHIPCarbonMonoxideConcentrationMeasurementAverageMeasuredValueAttributeCallback(jobject javaCallback, bool keepAlive) : +CHIPCarbonMonoxideConcentrationMeasurementAverageMeasuredValueAttributeCallback(jobject javaCallback, bool keepAlive) : chip::Callback::Callback(CallbackFn, this), keepAlive(keepAlive) @@ -44677,8 +44677,8 @@ CHIPCarbonMonoxideConcentrationMeasurementAverageMeasuredValueAttributeCallback: } } -CHIPCarbonMonoxideConcentrationMeasurementAverageMeasuredValueAttributeCallback:: - ~CHIPCarbonMonoxideConcentrationMeasurementAverageMeasuredValueAttributeCallback() +CHIPCarbonMonoxideConcentrationMeasurementAverageMeasuredValueAttributeCallback::~ +CHIPCarbonMonoxideConcentrationMeasurementAverageMeasuredValueAttributeCallback() { JNIEnv * env = chip::JniReferences::GetInstance().GetEnvForCurrentThread(); if (env == nullptr) @@ -44729,7 +44729,7 @@ void CHIPCarbonMonoxideConcentrationMeasurementAverageMeasuredValueAttributeCall } CHIPCarbonMonoxideConcentrationMeasurementGeneratedCommandListAttributeCallback:: - CHIPCarbonMonoxideConcentrationMeasurementGeneratedCommandListAttributeCallback(jobject javaCallback, bool keepAlive) : +CHIPCarbonMonoxideConcentrationMeasurementGeneratedCommandListAttributeCallback(jobject javaCallback, bool keepAlive) : chip::Callback::Callback(CallbackFn, this), keepAlive(keepAlive) @@ -44748,8 +44748,8 @@ CHIPCarbonMonoxideConcentrationMeasurementGeneratedCommandListAttributeCallback: } } -CHIPCarbonMonoxideConcentrationMeasurementGeneratedCommandListAttributeCallback:: - ~CHIPCarbonMonoxideConcentrationMeasurementGeneratedCommandListAttributeCallback() +CHIPCarbonMonoxideConcentrationMeasurementGeneratedCommandListAttributeCallback::~ +CHIPCarbonMonoxideConcentrationMeasurementGeneratedCommandListAttributeCallback() { JNIEnv * env = chip::JniReferences::GetInstance().GetEnvForCurrentThread(); if (env == nullptr) @@ -44804,7 +44804,7 @@ void CHIPCarbonMonoxideConcentrationMeasurementGeneratedCommandListAttributeCall } CHIPCarbonMonoxideConcentrationMeasurementAcceptedCommandListAttributeCallback:: - CHIPCarbonMonoxideConcentrationMeasurementAcceptedCommandListAttributeCallback(jobject javaCallback, bool keepAlive) : +CHIPCarbonMonoxideConcentrationMeasurementAcceptedCommandListAttributeCallback(jobject javaCallback, bool keepAlive) : chip::Callback::Callback(CallbackFn, this), keepAlive(keepAlive) @@ -44823,8 +44823,8 @@ CHIPCarbonMonoxideConcentrationMeasurementAcceptedCommandListAttributeCallback:: } } -CHIPCarbonMonoxideConcentrationMeasurementAcceptedCommandListAttributeCallback:: - ~CHIPCarbonMonoxideConcentrationMeasurementAcceptedCommandListAttributeCallback() +CHIPCarbonMonoxideConcentrationMeasurementAcceptedCommandListAttributeCallback::~ +CHIPCarbonMonoxideConcentrationMeasurementAcceptedCommandListAttributeCallback() { JNIEnv * env = chip::JniReferences::GetInstance().GetEnvForCurrentThread(); if (env == nullptr) @@ -44879,7 +44879,7 @@ void CHIPCarbonMonoxideConcentrationMeasurementAcceptedCommandListAttributeCallb } CHIPCarbonMonoxideConcentrationMeasurementEventListAttributeCallback:: - CHIPCarbonMonoxideConcentrationMeasurementEventListAttributeCallback(jobject javaCallback, bool keepAlive) : +CHIPCarbonMonoxideConcentrationMeasurementEventListAttributeCallback(jobject javaCallback, bool keepAlive) : chip::Callback::Callback(CallbackFn, this), keepAlive(keepAlive) { @@ -44897,8 +44897,8 @@ CHIPCarbonMonoxideConcentrationMeasurementEventListAttributeCallback:: } } -CHIPCarbonMonoxideConcentrationMeasurementEventListAttributeCallback:: - ~CHIPCarbonMonoxideConcentrationMeasurementEventListAttributeCallback() +CHIPCarbonMonoxideConcentrationMeasurementEventListAttributeCallback::~ +CHIPCarbonMonoxideConcentrationMeasurementEventListAttributeCallback() { JNIEnv * env = chip::JniReferences::GetInstance().GetEnvForCurrentThread(); if (env == nullptr) @@ -44952,7 +44952,7 @@ void CHIPCarbonMonoxideConcentrationMeasurementEventListAttributeCallback::Callb } CHIPCarbonMonoxideConcentrationMeasurementAttributeListAttributeCallback:: - CHIPCarbonMonoxideConcentrationMeasurementAttributeListAttributeCallback(jobject javaCallback, bool keepAlive) : +CHIPCarbonMonoxideConcentrationMeasurementAttributeListAttributeCallback(jobject javaCallback, bool keepAlive) : chip::Callback::Callback(CallbackFn, this), keepAlive(keepAlive) { @@ -44970,8 +44970,8 @@ CHIPCarbonMonoxideConcentrationMeasurementAttributeListAttributeCallback:: } } -CHIPCarbonMonoxideConcentrationMeasurementAttributeListAttributeCallback:: - ~CHIPCarbonMonoxideConcentrationMeasurementAttributeListAttributeCallback() +CHIPCarbonMonoxideConcentrationMeasurementAttributeListAttributeCallback::~ +CHIPCarbonMonoxideConcentrationMeasurementAttributeListAttributeCallback() { JNIEnv * env = chip::JniReferences::GetInstance().GetEnvForCurrentThread(); if (env == nullptr) @@ -45025,7 +45025,7 @@ void CHIPCarbonMonoxideConcentrationMeasurementAttributeListAttributeCallback::C } CHIPCarbonDioxideConcentrationMeasurementMeasuredValueAttributeCallback:: - CHIPCarbonDioxideConcentrationMeasurementMeasuredValueAttributeCallback(jobject javaCallback, bool keepAlive) : +CHIPCarbonDioxideConcentrationMeasurementMeasuredValueAttributeCallback(jobject javaCallback, bool keepAlive) : chip::Callback::Callback(CallbackFn, this), keepAlive(keepAlive) { @@ -45043,8 +45043,8 @@ CHIPCarbonDioxideConcentrationMeasurementMeasuredValueAttributeCallback:: } } -CHIPCarbonDioxideConcentrationMeasurementMeasuredValueAttributeCallback:: - ~CHIPCarbonDioxideConcentrationMeasurementMeasuredValueAttributeCallback() +CHIPCarbonDioxideConcentrationMeasurementMeasuredValueAttributeCallback::~ +CHIPCarbonDioxideConcentrationMeasurementMeasuredValueAttributeCallback() { JNIEnv * env = chip::JniReferences::GetInstance().GetEnvForCurrentThread(); if (env == nullptr) @@ -45094,7 +45094,7 @@ void CHIPCarbonDioxideConcentrationMeasurementMeasuredValueAttributeCallback::Ca } CHIPCarbonDioxideConcentrationMeasurementMinMeasuredValueAttributeCallback:: - CHIPCarbonDioxideConcentrationMeasurementMinMeasuredValueAttributeCallback(jobject javaCallback, bool keepAlive) : +CHIPCarbonDioxideConcentrationMeasurementMinMeasuredValueAttributeCallback(jobject javaCallback, bool keepAlive) : chip::Callback::Callback(CallbackFn, this), keepAlive(keepAlive) @@ -45113,8 +45113,8 @@ CHIPCarbonDioxideConcentrationMeasurementMinMeasuredValueAttributeCallback:: } } -CHIPCarbonDioxideConcentrationMeasurementMinMeasuredValueAttributeCallback:: - ~CHIPCarbonDioxideConcentrationMeasurementMinMeasuredValueAttributeCallback() +CHIPCarbonDioxideConcentrationMeasurementMinMeasuredValueAttributeCallback::~ +CHIPCarbonDioxideConcentrationMeasurementMinMeasuredValueAttributeCallback() { JNIEnv * env = chip::JniReferences::GetInstance().GetEnvForCurrentThread(); if (env == nullptr) @@ -45165,7 +45165,7 @@ void CHIPCarbonDioxideConcentrationMeasurementMinMeasuredValueAttributeCallback: } CHIPCarbonDioxideConcentrationMeasurementMaxMeasuredValueAttributeCallback:: - CHIPCarbonDioxideConcentrationMeasurementMaxMeasuredValueAttributeCallback(jobject javaCallback, bool keepAlive) : +CHIPCarbonDioxideConcentrationMeasurementMaxMeasuredValueAttributeCallback(jobject javaCallback, bool keepAlive) : chip::Callback::Callback(CallbackFn, this), keepAlive(keepAlive) @@ -45184,8 +45184,8 @@ CHIPCarbonDioxideConcentrationMeasurementMaxMeasuredValueAttributeCallback:: } } -CHIPCarbonDioxideConcentrationMeasurementMaxMeasuredValueAttributeCallback:: - ~CHIPCarbonDioxideConcentrationMeasurementMaxMeasuredValueAttributeCallback() +CHIPCarbonDioxideConcentrationMeasurementMaxMeasuredValueAttributeCallback::~ +CHIPCarbonDioxideConcentrationMeasurementMaxMeasuredValueAttributeCallback() { JNIEnv * env = chip::JniReferences::GetInstance().GetEnvForCurrentThread(); if (env == nullptr) @@ -45236,7 +45236,7 @@ void CHIPCarbonDioxideConcentrationMeasurementMaxMeasuredValueAttributeCallback: } CHIPCarbonDioxideConcentrationMeasurementPeakMeasuredValueAttributeCallback:: - CHIPCarbonDioxideConcentrationMeasurementPeakMeasuredValueAttributeCallback(jobject javaCallback, bool keepAlive) : +CHIPCarbonDioxideConcentrationMeasurementPeakMeasuredValueAttributeCallback(jobject javaCallback, bool keepAlive) : chip::Callback::Callback(CallbackFn, this), keepAlive(keepAlive) @@ -45255,8 +45255,8 @@ CHIPCarbonDioxideConcentrationMeasurementPeakMeasuredValueAttributeCallback:: } } -CHIPCarbonDioxideConcentrationMeasurementPeakMeasuredValueAttributeCallback:: - ~CHIPCarbonDioxideConcentrationMeasurementPeakMeasuredValueAttributeCallback() +CHIPCarbonDioxideConcentrationMeasurementPeakMeasuredValueAttributeCallback::~ +CHIPCarbonDioxideConcentrationMeasurementPeakMeasuredValueAttributeCallback() { JNIEnv * env = chip::JniReferences::GetInstance().GetEnvForCurrentThread(); if (env == nullptr) @@ -45307,7 +45307,7 @@ void CHIPCarbonDioxideConcentrationMeasurementPeakMeasuredValueAttributeCallback } CHIPCarbonDioxideConcentrationMeasurementAverageMeasuredValueAttributeCallback:: - CHIPCarbonDioxideConcentrationMeasurementAverageMeasuredValueAttributeCallback(jobject javaCallback, bool keepAlive) : +CHIPCarbonDioxideConcentrationMeasurementAverageMeasuredValueAttributeCallback(jobject javaCallback, bool keepAlive) : chip::Callback::Callback(CallbackFn, this), keepAlive(keepAlive) @@ -45326,8 +45326,8 @@ CHIPCarbonDioxideConcentrationMeasurementAverageMeasuredValueAttributeCallback:: } } -CHIPCarbonDioxideConcentrationMeasurementAverageMeasuredValueAttributeCallback:: - ~CHIPCarbonDioxideConcentrationMeasurementAverageMeasuredValueAttributeCallback() +CHIPCarbonDioxideConcentrationMeasurementAverageMeasuredValueAttributeCallback::~ +CHIPCarbonDioxideConcentrationMeasurementAverageMeasuredValueAttributeCallback() { JNIEnv * env = chip::JniReferences::GetInstance().GetEnvForCurrentThread(); if (env == nullptr) @@ -45378,7 +45378,7 @@ void CHIPCarbonDioxideConcentrationMeasurementAverageMeasuredValueAttributeCallb } CHIPCarbonDioxideConcentrationMeasurementGeneratedCommandListAttributeCallback:: - CHIPCarbonDioxideConcentrationMeasurementGeneratedCommandListAttributeCallback(jobject javaCallback, bool keepAlive) : +CHIPCarbonDioxideConcentrationMeasurementGeneratedCommandListAttributeCallback(jobject javaCallback, bool keepAlive) : chip::Callback::Callback(CallbackFn, this), keepAlive(keepAlive) @@ -45397,8 +45397,8 @@ CHIPCarbonDioxideConcentrationMeasurementGeneratedCommandListAttributeCallback:: } } -CHIPCarbonDioxideConcentrationMeasurementGeneratedCommandListAttributeCallback:: - ~CHIPCarbonDioxideConcentrationMeasurementGeneratedCommandListAttributeCallback() +CHIPCarbonDioxideConcentrationMeasurementGeneratedCommandListAttributeCallback::~ +CHIPCarbonDioxideConcentrationMeasurementGeneratedCommandListAttributeCallback() { JNIEnv * env = chip::JniReferences::GetInstance().GetEnvForCurrentThread(); if (env == nullptr) @@ -45453,7 +45453,7 @@ void CHIPCarbonDioxideConcentrationMeasurementGeneratedCommandListAttributeCallb } CHIPCarbonDioxideConcentrationMeasurementAcceptedCommandListAttributeCallback:: - CHIPCarbonDioxideConcentrationMeasurementAcceptedCommandListAttributeCallback(jobject javaCallback, bool keepAlive) : +CHIPCarbonDioxideConcentrationMeasurementAcceptedCommandListAttributeCallback(jobject javaCallback, bool keepAlive) : chip::Callback::Callback(CallbackFn, this), keepAlive(keepAlive) @@ -45472,8 +45472,8 @@ CHIPCarbonDioxideConcentrationMeasurementAcceptedCommandListAttributeCallback:: } } -CHIPCarbonDioxideConcentrationMeasurementAcceptedCommandListAttributeCallback:: - ~CHIPCarbonDioxideConcentrationMeasurementAcceptedCommandListAttributeCallback() +CHIPCarbonDioxideConcentrationMeasurementAcceptedCommandListAttributeCallback::~ +CHIPCarbonDioxideConcentrationMeasurementAcceptedCommandListAttributeCallback() { JNIEnv * env = chip::JniReferences::GetInstance().GetEnvForCurrentThread(); if (env == nullptr) @@ -45528,7 +45528,7 @@ void CHIPCarbonDioxideConcentrationMeasurementAcceptedCommandListAttributeCallba } CHIPCarbonDioxideConcentrationMeasurementEventListAttributeCallback:: - CHIPCarbonDioxideConcentrationMeasurementEventListAttributeCallback(jobject javaCallback, bool keepAlive) : +CHIPCarbonDioxideConcentrationMeasurementEventListAttributeCallback(jobject javaCallback, bool keepAlive) : chip::Callback::Callback(CallbackFn, this), keepAlive(keepAlive) { @@ -45546,8 +45546,8 @@ CHIPCarbonDioxideConcentrationMeasurementEventListAttributeCallback:: } } -CHIPCarbonDioxideConcentrationMeasurementEventListAttributeCallback:: - ~CHIPCarbonDioxideConcentrationMeasurementEventListAttributeCallback() +CHIPCarbonDioxideConcentrationMeasurementEventListAttributeCallback::~ +CHIPCarbonDioxideConcentrationMeasurementEventListAttributeCallback() { JNIEnv * env = chip::JniReferences::GetInstance().GetEnvForCurrentThread(); if (env == nullptr) @@ -45601,7 +45601,7 @@ void CHIPCarbonDioxideConcentrationMeasurementEventListAttributeCallback::Callba } CHIPCarbonDioxideConcentrationMeasurementAttributeListAttributeCallback:: - CHIPCarbonDioxideConcentrationMeasurementAttributeListAttributeCallback(jobject javaCallback, bool keepAlive) : +CHIPCarbonDioxideConcentrationMeasurementAttributeListAttributeCallback(jobject javaCallback, bool keepAlive) : chip::Callback::Callback(CallbackFn, this), keepAlive(keepAlive) { @@ -45619,8 +45619,8 @@ CHIPCarbonDioxideConcentrationMeasurementAttributeListAttributeCallback:: } } -CHIPCarbonDioxideConcentrationMeasurementAttributeListAttributeCallback:: - ~CHIPCarbonDioxideConcentrationMeasurementAttributeListAttributeCallback() +CHIPCarbonDioxideConcentrationMeasurementAttributeListAttributeCallback::~ +CHIPCarbonDioxideConcentrationMeasurementAttributeListAttributeCallback() { JNIEnv * env = chip::JniReferences::GetInstance().GetEnvForCurrentThread(); if (env == nullptr) @@ -45674,7 +45674,7 @@ void CHIPCarbonDioxideConcentrationMeasurementAttributeListAttributeCallback::Ca } CHIPNitrogenDioxideConcentrationMeasurementMeasuredValueAttributeCallback:: - CHIPNitrogenDioxideConcentrationMeasurementMeasuredValueAttributeCallback(jobject javaCallback, bool keepAlive) : +CHIPNitrogenDioxideConcentrationMeasurementMeasuredValueAttributeCallback(jobject javaCallback, bool keepAlive) : chip::Callback::Callback(CallbackFn, this), keepAlive(keepAlive) @@ -45693,8 +45693,8 @@ CHIPNitrogenDioxideConcentrationMeasurementMeasuredValueAttributeCallback:: } } -CHIPNitrogenDioxideConcentrationMeasurementMeasuredValueAttributeCallback:: - ~CHIPNitrogenDioxideConcentrationMeasurementMeasuredValueAttributeCallback() +CHIPNitrogenDioxideConcentrationMeasurementMeasuredValueAttributeCallback::~ +CHIPNitrogenDioxideConcentrationMeasurementMeasuredValueAttributeCallback() { JNIEnv * env = chip::JniReferences::GetInstance().GetEnvForCurrentThread(); if (env == nullptr) @@ -45744,7 +45744,7 @@ void CHIPNitrogenDioxideConcentrationMeasurementMeasuredValueAttributeCallback:: } CHIPNitrogenDioxideConcentrationMeasurementMinMeasuredValueAttributeCallback:: - CHIPNitrogenDioxideConcentrationMeasurementMinMeasuredValueAttributeCallback(jobject javaCallback, bool keepAlive) : +CHIPNitrogenDioxideConcentrationMeasurementMinMeasuredValueAttributeCallback(jobject javaCallback, bool keepAlive) : chip::Callback::Callback(CallbackFn, this), keepAlive(keepAlive) @@ -45763,8 +45763,8 @@ CHIPNitrogenDioxideConcentrationMeasurementMinMeasuredValueAttributeCallback:: } } -CHIPNitrogenDioxideConcentrationMeasurementMinMeasuredValueAttributeCallback:: - ~CHIPNitrogenDioxideConcentrationMeasurementMinMeasuredValueAttributeCallback() +CHIPNitrogenDioxideConcentrationMeasurementMinMeasuredValueAttributeCallback::~ +CHIPNitrogenDioxideConcentrationMeasurementMinMeasuredValueAttributeCallback() { JNIEnv * env = chip::JniReferences::GetInstance().GetEnvForCurrentThread(); if (env == nullptr) @@ -45815,7 +45815,7 @@ void CHIPNitrogenDioxideConcentrationMeasurementMinMeasuredValueAttributeCallbac } CHIPNitrogenDioxideConcentrationMeasurementMaxMeasuredValueAttributeCallback:: - CHIPNitrogenDioxideConcentrationMeasurementMaxMeasuredValueAttributeCallback(jobject javaCallback, bool keepAlive) : +CHIPNitrogenDioxideConcentrationMeasurementMaxMeasuredValueAttributeCallback(jobject javaCallback, bool keepAlive) : chip::Callback::Callback(CallbackFn, this), keepAlive(keepAlive) @@ -45834,8 +45834,8 @@ CHIPNitrogenDioxideConcentrationMeasurementMaxMeasuredValueAttributeCallback:: } } -CHIPNitrogenDioxideConcentrationMeasurementMaxMeasuredValueAttributeCallback:: - ~CHIPNitrogenDioxideConcentrationMeasurementMaxMeasuredValueAttributeCallback() +CHIPNitrogenDioxideConcentrationMeasurementMaxMeasuredValueAttributeCallback::~ +CHIPNitrogenDioxideConcentrationMeasurementMaxMeasuredValueAttributeCallback() { JNIEnv * env = chip::JniReferences::GetInstance().GetEnvForCurrentThread(); if (env == nullptr) @@ -45886,7 +45886,7 @@ void CHIPNitrogenDioxideConcentrationMeasurementMaxMeasuredValueAttributeCallbac } CHIPNitrogenDioxideConcentrationMeasurementPeakMeasuredValueAttributeCallback:: - CHIPNitrogenDioxideConcentrationMeasurementPeakMeasuredValueAttributeCallback(jobject javaCallback, bool keepAlive) : +CHIPNitrogenDioxideConcentrationMeasurementPeakMeasuredValueAttributeCallback(jobject javaCallback, bool keepAlive) : chip::Callback::Callback(CallbackFn, this), keepAlive(keepAlive) @@ -45905,8 +45905,8 @@ CHIPNitrogenDioxideConcentrationMeasurementPeakMeasuredValueAttributeCallback:: } } -CHIPNitrogenDioxideConcentrationMeasurementPeakMeasuredValueAttributeCallback:: - ~CHIPNitrogenDioxideConcentrationMeasurementPeakMeasuredValueAttributeCallback() +CHIPNitrogenDioxideConcentrationMeasurementPeakMeasuredValueAttributeCallback::~ +CHIPNitrogenDioxideConcentrationMeasurementPeakMeasuredValueAttributeCallback() { JNIEnv * env = chip::JniReferences::GetInstance().GetEnvForCurrentThread(); if (env == nullptr) @@ -45957,7 +45957,7 @@ void CHIPNitrogenDioxideConcentrationMeasurementPeakMeasuredValueAttributeCallba } CHIPNitrogenDioxideConcentrationMeasurementAverageMeasuredValueAttributeCallback:: - CHIPNitrogenDioxideConcentrationMeasurementAverageMeasuredValueAttributeCallback(jobject javaCallback, bool keepAlive) : +CHIPNitrogenDioxideConcentrationMeasurementAverageMeasuredValueAttributeCallback(jobject javaCallback, bool keepAlive) : chip::Callback::Callback( CallbackFn, this), keepAlive(keepAlive) @@ -45976,8 +45976,8 @@ CHIPNitrogenDioxideConcentrationMeasurementAverageMeasuredValueAttributeCallback } } -CHIPNitrogenDioxideConcentrationMeasurementAverageMeasuredValueAttributeCallback:: - ~CHIPNitrogenDioxideConcentrationMeasurementAverageMeasuredValueAttributeCallback() +CHIPNitrogenDioxideConcentrationMeasurementAverageMeasuredValueAttributeCallback::~ +CHIPNitrogenDioxideConcentrationMeasurementAverageMeasuredValueAttributeCallback() { JNIEnv * env = chip::JniReferences::GetInstance().GetEnvForCurrentThread(); if (env == nullptr) @@ -46028,7 +46028,7 @@ void CHIPNitrogenDioxideConcentrationMeasurementAverageMeasuredValueAttributeCal } CHIPNitrogenDioxideConcentrationMeasurementGeneratedCommandListAttributeCallback:: - CHIPNitrogenDioxideConcentrationMeasurementGeneratedCommandListAttributeCallback(jobject javaCallback, bool keepAlive) : +CHIPNitrogenDioxideConcentrationMeasurementGeneratedCommandListAttributeCallback(jobject javaCallback, bool keepAlive) : chip::Callback::Callback( CallbackFn, this), keepAlive(keepAlive) @@ -46047,8 +46047,8 @@ CHIPNitrogenDioxideConcentrationMeasurementGeneratedCommandListAttributeCallback } } -CHIPNitrogenDioxideConcentrationMeasurementGeneratedCommandListAttributeCallback:: - ~CHIPNitrogenDioxideConcentrationMeasurementGeneratedCommandListAttributeCallback() +CHIPNitrogenDioxideConcentrationMeasurementGeneratedCommandListAttributeCallback::~ +CHIPNitrogenDioxideConcentrationMeasurementGeneratedCommandListAttributeCallback() { JNIEnv * env = chip::JniReferences::GetInstance().GetEnvForCurrentThread(); if (env == nullptr) @@ -46103,7 +46103,7 @@ void CHIPNitrogenDioxideConcentrationMeasurementGeneratedCommandListAttributeCal } CHIPNitrogenDioxideConcentrationMeasurementAcceptedCommandListAttributeCallback:: - CHIPNitrogenDioxideConcentrationMeasurementAcceptedCommandListAttributeCallback(jobject javaCallback, bool keepAlive) : +CHIPNitrogenDioxideConcentrationMeasurementAcceptedCommandListAttributeCallback(jobject javaCallback, bool keepAlive) : chip::Callback::Callback(CallbackFn, this), keepAlive(keepAlive) @@ -46122,8 +46122,8 @@ CHIPNitrogenDioxideConcentrationMeasurementAcceptedCommandListAttributeCallback: } } -CHIPNitrogenDioxideConcentrationMeasurementAcceptedCommandListAttributeCallback:: - ~CHIPNitrogenDioxideConcentrationMeasurementAcceptedCommandListAttributeCallback() +CHIPNitrogenDioxideConcentrationMeasurementAcceptedCommandListAttributeCallback::~ +CHIPNitrogenDioxideConcentrationMeasurementAcceptedCommandListAttributeCallback() { JNIEnv * env = chip::JniReferences::GetInstance().GetEnvForCurrentThread(); if (env == nullptr) @@ -46178,7 +46178,7 @@ void CHIPNitrogenDioxideConcentrationMeasurementAcceptedCommandListAttributeCall } CHIPNitrogenDioxideConcentrationMeasurementEventListAttributeCallback:: - CHIPNitrogenDioxideConcentrationMeasurementEventListAttributeCallback(jobject javaCallback, bool keepAlive) : +CHIPNitrogenDioxideConcentrationMeasurementEventListAttributeCallback(jobject javaCallback, bool keepAlive) : chip::Callback::Callback(CallbackFn, this), keepAlive(keepAlive) { @@ -46196,8 +46196,8 @@ CHIPNitrogenDioxideConcentrationMeasurementEventListAttributeCallback:: } } -CHIPNitrogenDioxideConcentrationMeasurementEventListAttributeCallback:: - ~CHIPNitrogenDioxideConcentrationMeasurementEventListAttributeCallback() +CHIPNitrogenDioxideConcentrationMeasurementEventListAttributeCallback::~ +CHIPNitrogenDioxideConcentrationMeasurementEventListAttributeCallback() { JNIEnv * env = chip::JniReferences::GetInstance().GetEnvForCurrentThread(); if (env == nullptr) @@ -46251,7 +46251,7 @@ void CHIPNitrogenDioxideConcentrationMeasurementEventListAttributeCallback::Call } CHIPNitrogenDioxideConcentrationMeasurementAttributeListAttributeCallback:: - CHIPNitrogenDioxideConcentrationMeasurementAttributeListAttributeCallback(jobject javaCallback, bool keepAlive) : +CHIPNitrogenDioxideConcentrationMeasurementAttributeListAttributeCallback(jobject javaCallback, bool keepAlive) : chip::Callback::Callback(CallbackFn, this), keepAlive(keepAlive) @@ -46270,8 +46270,8 @@ CHIPNitrogenDioxideConcentrationMeasurementAttributeListAttributeCallback:: } } -CHIPNitrogenDioxideConcentrationMeasurementAttributeListAttributeCallback:: - ~CHIPNitrogenDioxideConcentrationMeasurementAttributeListAttributeCallback() +CHIPNitrogenDioxideConcentrationMeasurementAttributeListAttributeCallback::~ +CHIPNitrogenDioxideConcentrationMeasurementAttributeListAttributeCallback() { JNIEnv * env = chip::JniReferences::GetInstance().GetEnvForCurrentThread(); if (env == nullptr) @@ -46393,7 +46393,7 @@ void CHIPOzoneConcentrationMeasurementMeasuredValueAttributeCallback::CallbackFn } CHIPOzoneConcentrationMeasurementMinMeasuredValueAttributeCallback:: - CHIPOzoneConcentrationMeasurementMinMeasuredValueAttributeCallback(jobject javaCallback, bool keepAlive) : +CHIPOzoneConcentrationMeasurementMinMeasuredValueAttributeCallback(jobject javaCallback, bool keepAlive) : chip::Callback::Callback(CallbackFn, this), keepAlive(keepAlive) { @@ -46411,8 +46411,8 @@ CHIPOzoneConcentrationMeasurementMinMeasuredValueAttributeCallback:: } } -CHIPOzoneConcentrationMeasurementMinMeasuredValueAttributeCallback:: - ~CHIPOzoneConcentrationMeasurementMinMeasuredValueAttributeCallback() +CHIPOzoneConcentrationMeasurementMinMeasuredValueAttributeCallback::~ +CHIPOzoneConcentrationMeasurementMinMeasuredValueAttributeCallback() { JNIEnv * env = chip::JniReferences::GetInstance().GetEnvForCurrentThread(); if (env == nullptr) @@ -46462,7 +46462,7 @@ void CHIPOzoneConcentrationMeasurementMinMeasuredValueAttributeCallback::Callbac } CHIPOzoneConcentrationMeasurementMaxMeasuredValueAttributeCallback:: - CHIPOzoneConcentrationMeasurementMaxMeasuredValueAttributeCallback(jobject javaCallback, bool keepAlive) : +CHIPOzoneConcentrationMeasurementMaxMeasuredValueAttributeCallback(jobject javaCallback, bool keepAlive) : chip::Callback::Callback(CallbackFn, this), keepAlive(keepAlive) { @@ -46480,8 +46480,8 @@ CHIPOzoneConcentrationMeasurementMaxMeasuredValueAttributeCallback:: } } -CHIPOzoneConcentrationMeasurementMaxMeasuredValueAttributeCallback:: - ~CHIPOzoneConcentrationMeasurementMaxMeasuredValueAttributeCallback() +CHIPOzoneConcentrationMeasurementMaxMeasuredValueAttributeCallback::~ +CHIPOzoneConcentrationMeasurementMaxMeasuredValueAttributeCallback() { JNIEnv * env = chip::JniReferences::GetInstance().GetEnvForCurrentThread(); if (env == nullptr) @@ -46531,7 +46531,7 @@ void CHIPOzoneConcentrationMeasurementMaxMeasuredValueAttributeCallback::Callbac } CHIPOzoneConcentrationMeasurementPeakMeasuredValueAttributeCallback:: - CHIPOzoneConcentrationMeasurementPeakMeasuredValueAttributeCallback(jobject javaCallback, bool keepAlive) : +CHIPOzoneConcentrationMeasurementPeakMeasuredValueAttributeCallback(jobject javaCallback, bool keepAlive) : chip::Callback::Callback(CallbackFn, this), keepAlive(keepAlive) { @@ -46549,8 +46549,8 @@ CHIPOzoneConcentrationMeasurementPeakMeasuredValueAttributeCallback:: } } -CHIPOzoneConcentrationMeasurementPeakMeasuredValueAttributeCallback:: - ~CHIPOzoneConcentrationMeasurementPeakMeasuredValueAttributeCallback() +CHIPOzoneConcentrationMeasurementPeakMeasuredValueAttributeCallback::~ +CHIPOzoneConcentrationMeasurementPeakMeasuredValueAttributeCallback() { JNIEnv * env = chip::JniReferences::GetInstance().GetEnvForCurrentThread(); if (env == nullptr) @@ -46600,7 +46600,7 @@ void CHIPOzoneConcentrationMeasurementPeakMeasuredValueAttributeCallback::Callba } CHIPOzoneConcentrationMeasurementAverageMeasuredValueAttributeCallback:: - CHIPOzoneConcentrationMeasurementAverageMeasuredValueAttributeCallback(jobject javaCallback, bool keepAlive) : +CHIPOzoneConcentrationMeasurementAverageMeasuredValueAttributeCallback(jobject javaCallback, bool keepAlive) : chip::Callback::Callback(CallbackFn, this), keepAlive(keepAlive) { @@ -46618,8 +46618,8 @@ CHIPOzoneConcentrationMeasurementAverageMeasuredValueAttributeCallback:: } } -CHIPOzoneConcentrationMeasurementAverageMeasuredValueAttributeCallback:: - ~CHIPOzoneConcentrationMeasurementAverageMeasuredValueAttributeCallback() +CHIPOzoneConcentrationMeasurementAverageMeasuredValueAttributeCallback::~ +CHIPOzoneConcentrationMeasurementAverageMeasuredValueAttributeCallback() { JNIEnv * env = chip::JniReferences::GetInstance().GetEnvForCurrentThread(); if (env == nullptr) @@ -46669,7 +46669,7 @@ void CHIPOzoneConcentrationMeasurementAverageMeasuredValueAttributeCallback::Cal } CHIPOzoneConcentrationMeasurementGeneratedCommandListAttributeCallback:: - CHIPOzoneConcentrationMeasurementGeneratedCommandListAttributeCallback(jobject javaCallback, bool keepAlive) : +CHIPOzoneConcentrationMeasurementGeneratedCommandListAttributeCallback(jobject javaCallback, bool keepAlive) : chip::Callback::Callback(CallbackFn, this), keepAlive(keepAlive) { @@ -46687,8 +46687,8 @@ CHIPOzoneConcentrationMeasurementGeneratedCommandListAttributeCallback:: } } -CHIPOzoneConcentrationMeasurementGeneratedCommandListAttributeCallback:: - ~CHIPOzoneConcentrationMeasurementGeneratedCommandListAttributeCallback() +CHIPOzoneConcentrationMeasurementGeneratedCommandListAttributeCallback::~ +CHIPOzoneConcentrationMeasurementGeneratedCommandListAttributeCallback() { JNIEnv * env = chip::JniReferences::GetInstance().GetEnvForCurrentThread(); if (env == nullptr) @@ -46742,7 +46742,7 @@ void CHIPOzoneConcentrationMeasurementGeneratedCommandListAttributeCallback::Cal } CHIPOzoneConcentrationMeasurementAcceptedCommandListAttributeCallback:: - CHIPOzoneConcentrationMeasurementAcceptedCommandListAttributeCallback(jobject javaCallback, bool keepAlive) : +CHIPOzoneConcentrationMeasurementAcceptedCommandListAttributeCallback(jobject javaCallback, bool keepAlive) : chip::Callback::Callback(CallbackFn, this), keepAlive(keepAlive) { @@ -46760,8 +46760,8 @@ CHIPOzoneConcentrationMeasurementAcceptedCommandListAttributeCallback:: } } -CHIPOzoneConcentrationMeasurementAcceptedCommandListAttributeCallback:: - ~CHIPOzoneConcentrationMeasurementAcceptedCommandListAttributeCallback() +CHIPOzoneConcentrationMeasurementAcceptedCommandListAttributeCallback::~ +CHIPOzoneConcentrationMeasurementAcceptedCommandListAttributeCallback() { JNIEnv * env = chip::JniReferences::GetInstance().GetEnvForCurrentThread(); if (env == nullptr) @@ -47027,7 +47027,7 @@ void CHIPPm25ConcentrationMeasurementMeasuredValueAttributeCallback::CallbackFn( } CHIPPm25ConcentrationMeasurementMinMeasuredValueAttributeCallback:: - CHIPPm25ConcentrationMeasurementMinMeasuredValueAttributeCallback(jobject javaCallback, bool keepAlive) : +CHIPPm25ConcentrationMeasurementMinMeasuredValueAttributeCallback(jobject javaCallback, bool keepAlive) : chip::Callback::Callback(CallbackFn, this), keepAlive(keepAlive) { @@ -47045,8 +47045,8 @@ CHIPPm25ConcentrationMeasurementMinMeasuredValueAttributeCallback:: } } -CHIPPm25ConcentrationMeasurementMinMeasuredValueAttributeCallback:: - ~CHIPPm25ConcentrationMeasurementMinMeasuredValueAttributeCallback() +CHIPPm25ConcentrationMeasurementMinMeasuredValueAttributeCallback::~ +CHIPPm25ConcentrationMeasurementMinMeasuredValueAttributeCallback() { JNIEnv * env = chip::JniReferences::GetInstance().GetEnvForCurrentThread(); if (env == nullptr) @@ -47096,7 +47096,7 @@ void CHIPPm25ConcentrationMeasurementMinMeasuredValueAttributeCallback::Callback } CHIPPm25ConcentrationMeasurementMaxMeasuredValueAttributeCallback:: - CHIPPm25ConcentrationMeasurementMaxMeasuredValueAttributeCallback(jobject javaCallback, bool keepAlive) : +CHIPPm25ConcentrationMeasurementMaxMeasuredValueAttributeCallback(jobject javaCallback, bool keepAlive) : chip::Callback::Callback(CallbackFn, this), keepAlive(keepAlive) { @@ -47114,8 +47114,8 @@ CHIPPm25ConcentrationMeasurementMaxMeasuredValueAttributeCallback:: } } -CHIPPm25ConcentrationMeasurementMaxMeasuredValueAttributeCallback:: - ~CHIPPm25ConcentrationMeasurementMaxMeasuredValueAttributeCallback() +CHIPPm25ConcentrationMeasurementMaxMeasuredValueAttributeCallback::~ +CHIPPm25ConcentrationMeasurementMaxMeasuredValueAttributeCallback() { JNIEnv * env = chip::JniReferences::GetInstance().GetEnvForCurrentThread(); if (env == nullptr) @@ -47165,7 +47165,7 @@ void CHIPPm25ConcentrationMeasurementMaxMeasuredValueAttributeCallback::Callback } CHIPPm25ConcentrationMeasurementPeakMeasuredValueAttributeCallback:: - CHIPPm25ConcentrationMeasurementPeakMeasuredValueAttributeCallback(jobject javaCallback, bool keepAlive) : +CHIPPm25ConcentrationMeasurementPeakMeasuredValueAttributeCallback(jobject javaCallback, bool keepAlive) : chip::Callback::Callback(CallbackFn, this), keepAlive(keepAlive) { @@ -47183,8 +47183,8 @@ CHIPPm25ConcentrationMeasurementPeakMeasuredValueAttributeCallback:: } } -CHIPPm25ConcentrationMeasurementPeakMeasuredValueAttributeCallback:: - ~CHIPPm25ConcentrationMeasurementPeakMeasuredValueAttributeCallback() +CHIPPm25ConcentrationMeasurementPeakMeasuredValueAttributeCallback::~ +CHIPPm25ConcentrationMeasurementPeakMeasuredValueAttributeCallback() { JNIEnv * env = chip::JniReferences::GetInstance().GetEnvForCurrentThread(); if (env == nullptr) @@ -47234,7 +47234,7 @@ void CHIPPm25ConcentrationMeasurementPeakMeasuredValueAttributeCallback::Callbac } CHIPPm25ConcentrationMeasurementAverageMeasuredValueAttributeCallback:: - CHIPPm25ConcentrationMeasurementAverageMeasuredValueAttributeCallback(jobject javaCallback, bool keepAlive) : +CHIPPm25ConcentrationMeasurementAverageMeasuredValueAttributeCallback(jobject javaCallback, bool keepAlive) : chip::Callback::Callback(CallbackFn, this), keepAlive(keepAlive) { @@ -47252,8 +47252,8 @@ CHIPPm25ConcentrationMeasurementAverageMeasuredValueAttributeCallback:: } } -CHIPPm25ConcentrationMeasurementAverageMeasuredValueAttributeCallback:: - ~CHIPPm25ConcentrationMeasurementAverageMeasuredValueAttributeCallback() +CHIPPm25ConcentrationMeasurementAverageMeasuredValueAttributeCallback::~ +CHIPPm25ConcentrationMeasurementAverageMeasuredValueAttributeCallback() { JNIEnv * env = chip::JniReferences::GetInstance().GetEnvForCurrentThread(); if (env == nullptr) @@ -47303,7 +47303,7 @@ void CHIPPm25ConcentrationMeasurementAverageMeasuredValueAttributeCallback::Call } CHIPPm25ConcentrationMeasurementGeneratedCommandListAttributeCallback:: - CHIPPm25ConcentrationMeasurementGeneratedCommandListAttributeCallback(jobject javaCallback, bool keepAlive) : +CHIPPm25ConcentrationMeasurementGeneratedCommandListAttributeCallback(jobject javaCallback, bool keepAlive) : chip::Callback::Callback(CallbackFn, this), keepAlive(keepAlive) { @@ -47321,8 +47321,8 @@ CHIPPm25ConcentrationMeasurementGeneratedCommandListAttributeCallback:: } } -CHIPPm25ConcentrationMeasurementGeneratedCommandListAttributeCallback:: - ~CHIPPm25ConcentrationMeasurementGeneratedCommandListAttributeCallback() +CHIPPm25ConcentrationMeasurementGeneratedCommandListAttributeCallback::~ +CHIPPm25ConcentrationMeasurementGeneratedCommandListAttributeCallback() { JNIEnv * env = chip::JniReferences::GetInstance().GetEnvForCurrentThread(); if (env == nullptr) @@ -47376,7 +47376,7 @@ void CHIPPm25ConcentrationMeasurementGeneratedCommandListAttributeCallback::Call } CHIPPm25ConcentrationMeasurementAcceptedCommandListAttributeCallback:: - CHIPPm25ConcentrationMeasurementAcceptedCommandListAttributeCallback(jobject javaCallback, bool keepAlive) : +CHIPPm25ConcentrationMeasurementAcceptedCommandListAttributeCallback(jobject javaCallback, bool keepAlive) : chip::Callback::Callback(CallbackFn, this), keepAlive(keepAlive) { @@ -47394,8 +47394,8 @@ CHIPPm25ConcentrationMeasurementAcceptedCommandListAttributeCallback:: } } -CHIPPm25ConcentrationMeasurementAcceptedCommandListAttributeCallback:: - ~CHIPPm25ConcentrationMeasurementAcceptedCommandListAttributeCallback() +CHIPPm25ConcentrationMeasurementAcceptedCommandListAttributeCallback::~ +CHIPPm25ConcentrationMeasurementAcceptedCommandListAttributeCallback() { JNIEnv * env = chip::JniReferences::GetInstance().GetEnvForCurrentThread(); if (env == nullptr) @@ -47593,7 +47593,7 @@ void CHIPPm25ConcentrationMeasurementAttributeListAttributeCallback::CallbackFn( } CHIPFormaldehydeConcentrationMeasurementMeasuredValueAttributeCallback:: - CHIPFormaldehydeConcentrationMeasurementMeasuredValueAttributeCallback(jobject javaCallback, bool keepAlive) : +CHIPFormaldehydeConcentrationMeasurementMeasuredValueAttributeCallback(jobject javaCallback, bool keepAlive) : chip::Callback::Callback(CallbackFn, this), keepAlive(keepAlive) { @@ -47611,8 +47611,8 @@ CHIPFormaldehydeConcentrationMeasurementMeasuredValueAttributeCallback:: } } -CHIPFormaldehydeConcentrationMeasurementMeasuredValueAttributeCallback:: - ~CHIPFormaldehydeConcentrationMeasurementMeasuredValueAttributeCallback() +CHIPFormaldehydeConcentrationMeasurementMeasuredValueAttributeCallback::~ +CHIPFormaldehydeConcentrationMeasurementMeasuredValueAttributeCallback() { JNIEnv * env = chip::JniReferences::GetInstance().GetEnvForCurrentThread(); if (env == nullptr) @@ -47662,7 +47662,7 @@ void CHIPFormaldehydeConcentrationMeasurementMeasuredValueAttributeCallback::Cal } CHIPFormaldehydeConcentrationMeasurementMinMeasuredValueAttributeCallback:: - CHIPFormaldehydeConcentrationMeasurementMinMeasuredValueAttributeCallback(jobject javaCallback, bool keepAlive) : +CHIPFormaldehydeConcentrationMeasurementMinMeasuredValueAttributeCallback(jobject javaCallback, bool keepAlive) : chip::Callback::Callback(CallbackFn, this), keepAlive(keepAlive) @@ -47681,8 +47681,8 @@ CHIPFormaldehydeConcentrationMeasurementMinMeasuredValueAttributeCallback:: } } -CHIPFormaldehydeConcentrationMeasurementMinMeasuredValueAttributeCallback:: - ~CHIPFormaldehydeConcentrationMeasurementMinMeasuredValueAttributeCallback() +CHIPFormaldehydeConcentrationMeasurementMinMeasuredValueAttributeCallback::~ +CHIPFormaldehydeConcentrationMeasurementMinMeasuredValueAttributeCallback() { JNIEnv * env = chip::JniReferences::GetInstance().GetEnvForCurrentThread(); if (env == nullptr) @@ -47732,7 +47732,7 @@ void CHIPFormaldehydeConcentrationMeasurementMinMeasuredValueAttributeCallback:: } CHIPFormaldehydeConcentrationMeasurementMaxMeasuredValueAttributeCallback:: - CHIPFormaldehydeConcentrationMeasurementMaxMeasuredValueAttributeCallback(jobject javaCallback, bool keepAlive) : +CHIPFormaldehydeConcentrationMeasurementMaxMeasuredValueAttributeCallback(jobject javaCallback, bool keepAlive) : chip::Callback::Callback(CallbackFn, this), keepAlive(keepAlive) @@ -47751,8 +47751,8 @@ CHIPFormaldehydeConcentrationMeasurementMaxMeasuredValueAttributeCallback:: } } -CHIPFormaldehydeConcentrationMeasurementMaxMeasuredValueAttributeCallback:: - ~CHIPFormaldehydeConcentrationMeasurementMaxMeasuredValueAttributeCallback() +CHIPFormaldehydeConcentrationMeasurementMaxMeasuredValueAttributeCallback::~ +CHIPFormaldehydeConcentrationMeasurementMaxMeasuredValueAttributeCallback() { JNIEnv * env = chip::JniReferences::GetInstance().GetEnvForCurrentThread(); if (env == nullptr) @@ -47802,7 +47802,7 @@ void CHIPFormaldehydeConcentrationMeasurementMaxMeasuredValueAttributeCallback:: } CHIPFormaldehydeConcentrationMeasurementPeakMeasuredValueAttributeCallback:: - CHIPFormaldehydeConcentrationMeasurementPeakMeasuredValueAttributeCallback(jobject javaCallback, bool keepAlive) : +CHIPFormaldehydeConcentrationMeasurementPeakMeasuredValueAttributeCallback(jobject javaCallback, bool keepAlive) : chip::Callback::Callback(CallbackFn, this), keepAlive(keepAlive) @@ -47821,8 +47821,8 @@ CHIPFormaldehydeConcentrationMeasurementPeakMeasuredValueAttributeCallback:: } } -CHIPFormaldehydeConcentrationMeasurementPeakMeasuredValueAttributeCallback:: - ~CHIPFormaldehydeConcentrationMeasurementPeakMeasuredValueAttributeCallback() +CHIPFormaldehydeConcentrationMeasurementPeakMeasuredValueAttributeCallback::~ +CHIPFormaldehydeConcentrationMeasurementPeakMeasuredValueAttributeCallback() { JNIEnv * env = chip::JniReferences::GetInstance().GetEnvForCurrentThread(); if (env == nullptr) @@ -47873,7 +47873,7 @@ void CHIPFormaldehydeConcentrationMeasurementPeakMeasuredValueAttributeCallback: } CHIPFormaldehydeConcentrationMeasurementAverageMeasuredValueAttributeCallback:: - CHIPFormaldehydeConcentrationMeasurementAverageMeasuredValueAttributeCallback(jobject javaCallback, bool keepAlive) : +CHIPFormaldehydeConcentrationMeasurementAverageMeasuredValueAttributeCallback(jobject javaCallback, bool keepAlive) : chip::Callback::Callback(CallbackFn, this), keepAlive(keepAlive) @@ -47892,8 +47892,8 @@ CHIPFormaldehydeConcentrationMeasurementAverageMeasuredValueAttributeCallback:: } } -CHIPFormaldehydeConcentrationMeasurementAverageMeasuredValueAttributeCallback:: - ~CHIPFormaldehydeConcentrationMeasurementAverageMeasuredValueAttributeCallback() +CHIPFormaldehydeConcentrationMeasurementAverageMeasuredValueAttributeCallback::~ +CHIPFormaldehydeConcentrationMeasurementAverageMeasuredValueAttributeCallback() { JNIEnv * env = chip::JniReferences::GetInstance().GetEnvForCurrentThread(); if (env == nullptr) @@ -47944,7 +47944,7 @@ void CHIPFormaldehydeConcentrationMeasurementAverageMeasuredValueAttributeCallba } CHIPFormaldehydeConcentrationMeasurementGeneratedCommandListAttributeCallback:: - CHIPFormaldehydeConcentrationMeasurementGeneratedCommandListAttributeCallback(jobject javaCallback, bool keepAlive) : +CHIPFormaldehydeConcentrationMeasurementGeneratedCommandListAttributeCallback(jobject javaCallback, bool keepAlive) : chip::Callback::Callback(CallbackFn, this), keepAlive(keepAlive) @@ -47963,8 +47963,8 @@ CHIPFormaldehydeConcentrationMeasurementGeneratedCommandListAttributeCallback:: } } -CHIPFormaldehydeConcentrationMeasurementGeneratedCommandListAttributeCallback:: - ~CHIPFormaldehydeConcentrationMeasurementGeneratedCommandListAttributeCallback() +CHIPFormaldehydeConcentrationMeasurementGeneratedCommandListAttributeCallback::~ +CHIPFormaldehydeConcentrationMeasurementGeneratedCommandListAttributeCallback() { JNIEnv * env = chip::JniReferences::GetInstance().GetEnvForCurrentThread(); if (env == nullptr) @@ -48019,7 +48019,7 @@ void CHIPFormaldehydeConcentrationMeasurementGeneratedCommandListAttributeCallba } CHIPFormaldehydeConcentrationMeasurementAcceptedCommandListAttributeCallback:: - CHIPFormaldehydeConcentrationMeasurementAcceptedCommandListAttributeCallback(jobject javaCallback, bool keepAlive) : +CHIPFormaldehydeConcentrationMeasurementAcceptedCommandListAttributeCallback(jobject javaCallback, bool keepAlive) : chip::Callback::Callback(CallbackFn, this), keepAlive(keepAlive) @@ -48038,8 +48038,8 @@ CHIPFormaldehydeConcentrationMeasurementAcceptedCommandListAttributeCallback:: } } -CHIPFormaldehydeConcentrationMeasurementAcceptedCommandListAttributeCallback:: - ~CHIPFormaldehydeConcentrationMeasurementAcceptedCommandListAttributeCallback() +CHIPFormaldehydeConcentrationMeasurementAcceptedCommandListAttributeCallback::~ +CHIPFormaldehydeConcentrationMeasurementAcceptedCommandListAttributeCallback() { JNIEnv * env = chip::JniReferences::GetInstance().GetEnvForCurrentThread(); if (env == nullptr) @@ -48094,7 +48094,7 @@ void CHIPFormaldehydeConcentrationMeasurementAcceptedCommandListAttributeCallbac } CHIPFormaldehydeConcentrationMeasurementEventListAttributeCallback:: - CHIPFormaldehydeConcentrationMeasurementEventListAttributeCallback(jobject javaCallback, bool keepAlive) : +CHIPFormaldehydeConcentrationMeasurementEventListAttributeCallback(jobject javaCallback, bool keepAlive) : chip::Callback::Callback(CallbackFn, this), keepAlive(keepAlive) { @@ -48112,8 +48112,8 @@ CHIPFormaldehydeConcentrationMeasurementEventListAttributeCallback:: } } -CHIPFormaldehydeConcentrationMeasurementEventListAttributeCallback:: - ~CHIPFormaldehydeConcentrationMeasurementEventListAttributeCallback() +CHIPFormaldehydeConcentrationMeasurementEventListAttributeCallback::~ +CHIPFormaldehydeConcentrationMeasurementEventListAttributeCallback() { JNIEnv * env = chip::JniReferences::GetInstance().GetEnvForCurrentThread(); if (env == nullptr) @@ -48167,7 +48167,7 @@ void CHIPFormaldehydeConcentrationMeasurementEventListAttributeCallback::Callbac } CHIPFormaldehydeConcentrationMeasurementAttributeListAttributeCallback:: - CHIPFormaldehydeConcentrationMeasurementAttributeListAttributeCallback(jobject javaCallback, bool keepAlive) : +CHIPFormaldehydeConcentrationMeasurementAttributeListAttributeCallback(jobject javaCallback, bool keepAlive) : chip::Callback::Callback(CallbackFn, this), keepAlive(keepAlive) { @@ -48185,8 +48185,8 @@ CHIPFormaldehydeConcentrationMeasurementAttributeListAttributeCallback:: } } -CHIPFormaldehydeConcentrationMeasurementAttributeListAttributeCallback:: - ~CHIPFormaldehydeConcentrationMeasurementAttributeListAttributeCallback() +CHIPFormaldehydeConcentrationMeasurementAttributeListAttributeCallback::~ +CHIPFormaldehydeConcentrationMeasurementAttributeListAttributeCallback() { JNIEnv * env = chip::JniReferences::GetInstance().GetEnvForCurrentThread(); if (env == nullptr) @@ -48326,8 +48326,8 @@ CHIPPm1ConcentrationMeasurementMinMeasuredValueAttributeCallback::CHIPPm1Concent } } -CHIPPm1ConcentrationMeasurementMinMeasuredValueAttributeCallback:: - ~CHIPPm1ConcentrationMeasurementMinMeasuredValueAttributeCallback() +CHIPPm1ConcentrationMeasurementMinMeasuredValueAttributeCallback::~ +CHIPPm1ConcentrationMeasurementMinMeasuredValueAttributeCallback() { JNIEnv * env = chip::JniReferences::GetInstance().GetEnvForCurrentThread(); if (env == nullptr) @@ -48395,8 +48395,8 @@ CHIPPm1ConcentrationMeasurementMaxMeasuredValueAttributeCallback::CHIPPm1Concent } } -CHIPPm1ConcentrationMeasurementMaxMeasuredValueAttributeCallback:: - ~CHIPPm1ConcentrationMeasurementMaxMeasuredValueAttributeCallback() +CHIPPm1ConcentrationMeasurementMaxMeasuredValueAttributeCallback::~ +CHIPPm1ConcentrationMeasurementMaxMeasuredValueAttributeCallback() { JNIEnv * env = chip::JniReferences::GetInstance().GetEnvForCurrentThread(); if (env == nullptr) @@ -48446,7 +48446,7 @@ void CHIPPm1ConcentrationMeasurementMaxMeasuredValueAttributeCallback::CallbackF } CHIPPm1ConcentrationMeasurementPeakMeasuredValueAttributeCallback:: - CHIPPm1ConcentrationMeasurementPeakMeasuredValueAttributeCallback(jobject javaCallback, bool keepAlive) : +CHIPPm1ConcentrationMeasurementPeakMeasuredValueAttributeCallback(jobject javaCallback, bool keepAlive) : chip::Callback::Callback(CallbackFn, this), keepAlive(keepAlive) { @@ -48464,8 +48464,8 @@ CHIPPm1ConcentrationMeasurementPeakMeasuredValueAttributeCallback:: } } -CHIPPm1ConcentrationMeasurementPeakMeasuredValueAttributeCallback:: - ~CHIPPm1ConcentrationMeasurementPeakMeasuredValueAttributeCallback() +CHIPPm1ConcentrationMeasurementPeakMeasuredValueAttributeCallback::~ +CHIPPm1ConcentrationMeasurementPeakMeasuredValueAttributeCallback() { JNIEnv * env = chip::JniReferences::GetInstance().GetEnvForCurrentThread(); if (env == nullptr) @@ -48515,7 +48515,7 @@ void CHIPPm1ConcentrationMeasurementPeakMeasuredValueAttributeCallback::Callback } CHIPPm1ConcentrationMeasurementAverageMeasuredValueAttributeCallback:: - CHIPPm1ConcentrationMeasurementAverageMeasuredValueAttributeCallback(jobject javaCallback, bool keepAlive) : +CHIPPm1ConcentrationMeasurementAverageMeasuredValueAttributeCallback(jobject javaCallback, bool keepAlive) : chip::Callback::Callback(CallbackFn, this), keepAlive(keepAlive) { @@ -48533,8 +48533,8 @@ CHIPPm1ConcentrationMeasurementAverageMeasuredValueAttributeCallback:: } } -CHIPPm1ConcentrationMeasurementAverageMeasuredValueAttributeCallback:: - ~CHIPPm1ConcentrationMeasurementAverageMeasuredValueAttributeCallback() +CHIPPm1ConcentrationMeasurementAverageMeasuredValueAttributeCallback::~ +CHIPPm1ConcentrationMeasurementAverageMeasuredValueAttributeCallback() { JNIEnv * env = chip::JniReferences::GetInstance().GetEnvForCurrentThread(); if (env == nullptr) @@ -48584,7 +48584,7 @@ void CHIPPm1ConcentrationMeasurementAverageMeasuredValueAttributeCallback::Callb } CHIPPm1ConcentrationMeasurementGeneratedCommandListAttributeCallback:: - CHIPPm1ConcentrationMeasurementGeneratedCommandListAttributeCallback(jobject javaCallback, bool keepAlive) : +CHIPPm1ConcentrationMeasurementGeneratedCommandListAttributeCallback(jobject javaCallback, bool keepAlive) : chip::Callback::Callback(CallbackFn, this), keepAlive(keepAlive) { @@ -48602,8 +48602,8 @@ CHIPPm1ConcentrationMeasurementGeneratedCommandListAttributeCallback:: } } -CHIPPm1ConcentrationMeasurementGeneratedCommandListAttributeCallback:: - ~CHIPPm1ConcentrationMeasurementGeneratedCommandListAttributeCallback() +CHIPPm1ConcentrationMeasurementGeneratedCommandListAttributeCallback::~ +CHIPPm1ConcentrationMeasurementGeneratedCommandListAttributeCallback() { JNIEnv * env = chip::JniReferences::GetInstance().GetEnvForCurrentThread(); if (env == nullptr) @@ -48657,7 +48657,7 @@ void CHIPPm1ConcentrationMeasurementGeneratedCommandListAttributeCallback::Callb } CHIPPm1ConcentrationMeasurementAcceptedCommandListAttributeCallback:: - CHIPPm1ConcentrationMeasurementAcceptedCommandListAttributeCallback(jobject javaCallback, bool keepAlive) : +CHIPPm1ConcentrationMeasurementAcceptedCommandListAttributeCallback(jobject javaCallback, bool keepAlive) : chip::Callback::Callback(CallbackFn, this), keepAlive(keepAlive) { @@ -48675,8 +48675,8 @@ CHIPPm1ConcentrationMeasurementAcceptedCommandListAttributeCallback:: } } -CHIPPm1ConcentrationMeasurementAcceptedCommandListAttributeCallback:: - ~CHIPPm1ConcentrationMeasurementAcceptedCommandListAttributeCallback() +CHIPPm1ConcentrationMeasurementAcceptedCommandListAttributeCallback::~ +CHIPPm1ConcentrationMeasurementAcceptedCommandListAttributeCallback() { JNIEnv * env = chip::JniReferences::GetInstance().GetEnvForCurrentThread(); if (env == nullptr) @@ -48942,7 +48942,7 @@ void CHIPPm10ConcentrationMeasurementMeasuredValueAttributeCallback::CallbackFn( } CHIPPm10ConcentrationMeasurementMinMeasuredValueAttributeCallback:: - CHIPPm10ConcentrationMeasurementMinMeasuredValueAttributeCallback(jobject javaCallback, bool keepAlive) : +CHIPPm10ConcentrationMeasurementMinMeasuredValueAttributeCallback(jobject javaCallback, bool keepAlive) : chip::Callback::Callback(CallbackFn, this), keepAlive(keepAlive) { @@ -48960,8 +48960,8 @@ CHIPPm10ConcentrationMeasurementMinMeasuredValueAttributeCallback:: } } -CHIPPm10ConcentrationMeasurementMinMeasuredValueAttributeCallback:: - ~CHIPPm10ConcentrationMeasurementMinMeasuredValueAttributeCallback() +CHIPPm10ConcentrationMeasurementMinMeasuredValueAttributeCallback::~ +CHIPPm10ConcentrationMeasurementMinMeasuredValueAttributeCallback() { JNIEnv * env = chip::JniReferences::GetInstance().GetEnvForCurrentThread(); if (env == nullptr) @@ -49011,7 +49011,7 @@ void CHIPPm10ConcentrationMeasurementMinMeasuredValueAttributeCallback::Callback } CHIPPm10ConcentrationMeasurementMaxMeasuredValueAttributeCallback:: - CHIPPm10ConcentrationMeasurementMaxMeasuredValueAttributeCallback(jobject javaCallback, bool keepAlive) : +CHIPPm10ConcentrationMeasurementMaxMeasuredValueAttributeCallback(jobject javaCallback, bool keepAlive) : chip::Callback::Callback(CallbackFn, this), keepAlive(keepAlive) { @@ -49029,8 +49029,8 @@ CHIPPm10ConcentrationMeasurementMaxMeasuredValueAttributeCallback:: } } -CHIPPm10ConcentrationMeasurementMaxMeasuredValueAttributeCallback:: - ~CHIPPm10ConcentrationMeasurementMaxMeasuredValueAttributeCallback() +CHIPPm10ConcentrationMeasurementMaxMeasuredValueAttributeCallback::~ +CHIPPm10ConcentrationMeasurementMaxMeasuredValueAttributeCallback() { JNIEnv * env = chip::JniReferences::GetInstance().GetEnvForCurrentThread(); if (env == nullptr) @@ -49080,7 +49080,7 @@ void CHIPPm10ConcentrationMeasurementMaxMeasuredValueAttributeCallback::Callback } CHIPPm10ConcentrationMeasurementPeakMeasuredValueAttributeCallback:: - CHIPPm10ConcentrationMeasurementPeakMeasuredValueAttributeCallback(jobject javaCallback, bool keepAlive) : +CHIPPm10ConcentrationMeasurementPeakMeasuredValueAttributeCallback(jobject javaCallback, bool keepAlive) : chip::Callback::Callback(CallbackFn, this), keepAlive(keepAlive) { @@ -49098,8 +49098,8 @@ CHIPPm10ConcentrationMeasurementPeakMeasuredValueAttributeCallback:: } } -CHIPPm10ConcentrationMeasurementPeakMeasuredValueAttributeCallback:: - ~CHIPPm10ConcentrationMeasurementPeakMeasuredValueAttributeCallback() +CHIPPm10ConcentrationMeasurementPeakMeasuredValueAttributeCallback::~ +CHIPPm10ConcentrationMeasurementPeakMeasuredValueAttributeCallback() { JNIEnv * env = chip::JniReferences::GetInstance().GetEnvForCurrentThread(); if (env == nullptr) @@ -49149,7 +49149,7 @@ void CHIPPm10ConcentrationMeasurementPeakMeasuredValueAttributeCallback::Callbac } CHIPPm10ConcentrationMeasurementAverageMeasuredValueAttributeCallback:: - CHIPPm10ConcentrationMeasurementAverageMeasuredValueAttributeCallback(jobject javaCallback, bool keepAlive) : +CHIPPm10ConcentrationMeasurementAverageMeasuredValueAttributeCallback(jobject javaCallback, bool keepAlive) : chip::Callback::Callback(CallbackFn, this), keepAlive(keepAlive) { @@ -49167,8 +49167,8 @@ CHIPPm10ConcentrationMeasurementAverageMeasuredValueAttributeCallback:: } } -CHIPPm10ConcentrationMeasurementAverageMeasuredValueAttributeCallback:: - ~CHIPPm10ConcentrationMeasurementAverageMeasuredValueAttributeCallback() +CHIPPm10ConcentrationMeasurementAverageMeasuredValueAttributeCallback::~ +CHIPPm10ConcentrationMeasurementAverageMeasuredValueAttributeCallback() { JNIEnv * env = chip::JniReferences::GetInstance().GetEnvForCurrentThread(); if (env == nullptr) @@ -49218,7 +49218,7 @@ void CHIPPm10ConcentrationMeasurementAverageMeasuredValueAttributeCallback::Call } CHIPPm10ConcentrationMeasurementGeneratedCommandListAttributeCallback:: - CHIPPm10ConcentrationMeasurementGeneratedCommandListAttributeCallback(jobject javaCallback, bool keepAlive) : +CHIPPm10ConcentrationMeasurementGeneratedCommandListAttributeCallback(jobject javaCallback, bool keepAlive) : chip::Callback::Callback(CallbackFn, this), keepAlive(keepAlive) { @@ -49236,8 +49236,8 @@ CHIPPm10ConcentrationMeasurementGeneratedCommandListAttributeCallback:: } } -CHIPPm10ConcentrationMeasurementGeneratedCommandListAttributeCallback:: - ~CHIPPm10ConcentrationMeasurementGeneratedCommandListAttributeCallback() +CHIPPm10ConcentrationMeasurementGeneratedCommandListAttributeCallback::~ +CHIPPm10ConcentrationMeasurementGeneratedCommandListAttributeCallback() { JNIEnv * env = chip::JniReferences::GetInstance().GetEnvForCurrentThread(); if (env == nullptr) @@ -49291,7 +49291,7 @@ void CHIPPm10ConcentrationMeasurementGeneratedCommandListAttributeCallback::Call } CHIPPm10ConcentrationMeasurementAcceptedCommandListAttributeCallback:: - CHIPPm10ConcentrationMeasurementAcceptedCommandListAttributeCallback(jobject javaCallback, bool keepAlive) : +CHIPPm10ConcentrationMeasurementAcceptedCommandListAttributeCallback(jobject javaCallback, bool keepAlive) : chip::Callback::Callback(CallbackFn, this), keepAlive(keepAlive) { @@ -49309,8 +49309,8 @@ CHIPPm10ConcentrationMeasurementAcceptedCommandListAttributeCallback:: } } -CHIPPm10ConcentrationMeasurementAcceptedCommandListAttributeCallback:: - ~CHIPPm10ConcentrationMeasurementAcceptedCommandListAttributeCallback() +CHIPPm10ConcentrationMeasurementAcceptedCommandListAttributeCallback::~ +CHIPPm10ConcentrationMeasurementAcceptedCommandListAttributeCallback() { JNIEnv * env = chip::JniReferences::GetInstance().GetEnvForCurrentThread(); if (env == nullptr) @@ -49508,7 +49508,7 @@ void CHIPPm10ConcentrationMeasurementAttributeListAttributeCallback::CallbackFn( } CHIPTotalVolatileOrganicCompoundsConcentrationMeasurementMeasuredValueAttributeCallback:: - CHIPTotalVolatileOrganicCompoundsConcentrationMeasurementMeasuredValueAttributeCallback(jobject javaCallback, bool keepAlive) : +CHIPTotalVolatileOrganicCompoundsConcentrationMeasurementMeasuredValueAttributeCallback(jobject javaCallback, bool keepAlive) : chip::Callback::Callback( CallbackFn, this), keepAlive(keepAlive) @@ -49527,8 +49527,8 @@ CHIPTotalVolatileOrganicCompoundsConcentrationMeasurementMeasuredValueAttributeC } } -CHIPTotalVolatileOrganicCompoundsConcentrationMeasurementMeasuredValueAttributeCallback:: - ~CHIPTotalVolatileOrganicCompoundsConcentrationMeasurementMeasuredValueAttributeCallback() +CHIPTotalVolatileOrganicCompoundsConcentrationMeasurementMeasuredValueAttributeCallback::~ +CHIPTotalVolatileOrganicCompoundsConcentrationMeasurementMeasuredValueAttributeCallback() { JNIEnv * env = chip::JniReferences::GetInstance().GetEnvForCurrentThread(); if (env == nullptr) @@ -49581,8 +49581,7 @@ void CHIPTotalVolatileOrganicCompoundsConcentrationMeasurementMeasuredValueAttri } CHIPTotalVolatileOrganicCompoundsConcentrationMeasurementMinMeasuredValueAttributeCallback:: - CHIPTotalVolatileOrganicCompoundsConcentrationMeasurementMinMeasuredValueAttributeCallback(jobject javaCallback, - bool keepAlive) : +CHIPTotalVolatileOrganicCompoundsConcentrationMeasurementMinMeasuredValueAttributeCallback(jobject javaCallback, bool keepAlive) : chip::Callback::Callback( CallbackFn, this), keepAlive(keepAlive) @@ -49601,8 +49600,8 @@ CHIPTotalVolatileOrganicCompoundsConcentrationMeasurementMinMeasuredValueAttribu } } -CHIPTotalVolatileOrganicCompoundsConcentrationMeasurementMinMeasuredValueAttributeCallback:: - ~CHIPTotalVolatileOrganicCompoundsConcentrationMeasurementMinMeasuredValueAttributeCallback() +CHIPTotalVolatileOrganicCompoundsConcentrationMeasurementMinMeasuredValueAttributeCallback::~ +CHIPTotalVolatileOrganicCompoundsConcentrationMeasurementMinMeasuredValueAttributeCallback() { JNIEnv * env = chip::JniReferences::GetInstance().GetEnvForCurrentThread(); if (env == nullptr) @@ -49655,8 +49654,7 @@ void CHIPTotalVolatileOrganicCompoundsConcentrationMeasurementMinMeasuredValueAt } CHIPTotalVolatileOrganicCompoundsConcentrationMeasurementMaxMeasuredValueAttributeCallback:: - CHIPTotalVolatileOrganicCompoundsConcentrationMeasurementMaxMeasuredValueAttributeCallback(jobject javaCallback, - bool keepAlive) : +CHIPTotalVolatileOrganicCompoundsConcentrationMeasurementMaxMeasuredValueAttributeCallback(jobject javaCallback, bool keepAlive) : chip::Callback::Callback( CallbackFn, this), keepAlive(keepAlive) @@ -49675,8 +49673,8 @@ CHIPTotalVolatileOrganicCompoundsConcentrationMeasurementMaxMeasuredValueAttribu } } -CHIPTotalVolatileOrganicCompoundsConcentrationMeasurementMaxMeasuredValueAttributeCallback:: - ~CHIPTotalVolatileOrganicCompoundsConcentrationMeasurementMaxMeasuredValueAttributeCallback() +CHIPTotalVolatileOrganicCompoundsConcentrationMeasurementMaxMeasuredValueAttributeCallback::~ +CHIPTotalVolatileOrganicCompoundsConcentrationMeasurementMaxMeasuredValueAttributeCallback() { JNIEnv * env = chip::JniReferences::GetInstance().GetEnvForCurrentThread(); if (env == nullptr) @@ -49729,8 +49727,7 @@ void CHIPTotalVolatileOrganicCompoundsConcentrationMeasurementMaxMeasuredValueAt } CHIPTotalVolatileOrganicCompoundsConcentrationMeasurementPeakMeasuredValueAttributeCallback:: - CHIPTotalVolatileOrganicCompoundsConcentrationMeasurementPeakMeasuredValueAttributeCallback(jobject javaCallback, - bool keepAlive) : +CHIPTotalVolatileOrganicCompoundsConcentrationMeasurementPeakMeasuredValueAttributeCallback(jobject javaCallback, bool keepAlive) : chip::Callback::Callback< CHIPTotalVolatileOrganicCompoundsConcentrationMeasurementClusterPeakMeasuredValueAttributeCallbackType>(CallbackFn, this), keepAlive(keepAlive) @@ -49749,8 +49746,8 @@ CHIPTotalVolatileOrganicCompoundsConcentrationMeasurementPeakMeasuredValueAttrib } } -CHIPTotalVolatileOrganicCompoundsConcentrationMeasurementPeakMeasuredValueAttributeCallback:: - ~CHIPTotalVolatileOrganicCompoundsConcentrationMeasurementPeakMeasuredValueAttributeCallback() +CHIPTotalVolatileOrganicCompoundsConcentrationMeasurementPeakMeasuredValueAttributeCallback::~ +CHIPTotalVolatileOrganicCompoundsConcentrationMeasurementPeakMeasuredValueAttributeCallback() { JNIEnv * env = chip::JniReferences::GetInstance().GetEnvForCurrentThread(); if (env == nullptr) @@ -49803,8 +49800,8 @@ void CHIPTotalVolatileOrganicCompoundsConcentrationMeasurementPeakMeasuredValueA } CHIPTotalVolatileOrganicCompoundsConcentrationMeasurementAverageMeasuredValueAttributeCallback:: - CHIPTotalVolatileOrganicCompoundsConcentrationMeasurementAverageMeasuredValueAttributeCallback(jobject javaCallback, - bool keepAlive) : +CHIPTotalVolatileOrganicCompoundsConcentrationMeasurementAverageMeasuredValueAttributeCallback(jobject javaCallback, + bool keepAlive) : chip::Callback::Callback< CHIPTotalVolatileOrganicCompoundsConcentrationMeasurementClusterAverageMeasuredValueAttributeCallbackType>(CallbackFn, this), @@ -49824,8 +49821,8 @@ CHIPTotalVolatileOrganicCompoundsConcentrationMeasurementAverageMeasuredValueAtt } } -CHIPTotalVolatileOrganicCompoundsConcentrationMeasurementAverageMeasuredValueAttributeCallback:: - ~CHIPTotalVolatileOrganicCompoundsConcentrationMeasurementAverageMeasuredValueAttributeCallback() +CHIPTotalVolatileOrganicCompoundsConcentrationMeasurementAverageMeasuredValueAttributeCallback::~ +CHIPTotalVolatileOrganicCompoundsConcentrationMeasurementAverageMeasuredValueAttributeCallback() { JNIEnv * env = chip::JniReferences::GetInstance().GetEnvForCurrentThread(); if (env == nullptr) @@ -49879,8 +49876,8 @@ void CHIPTotalVolatileOrganicCompoundsConcentrationMeasurementAverageMeasuredVal } CHIPTotalVolatileOrganicCompoundsConcentrationMeasurementGeneratedCommandListAttributeCallback:: - CHIPTotalVolatileOrganicCompoundsConcentrationMeasurementGeneratedCommandListAttributeCallback(jobject javaCallback, - bool keepAlive) : +CHIPTotalVolatileOrganicCompoundsConcentrationMeasurementGeneratedCommandListAttributeCallback(jobject javaCallback, + bool keepAlive) : chip::Callback::Callback< CHIPTotalVolatileOrganicCompoundsConcentrationMeasurementClusterGeneratedCommandListAttributeCallbackType>(CallbackFn, this), @@ -49900,8 +49897,8 @@ CHIPTotalVolatileOrganicCompoundsConcentrationMeasurementGeneratedCommandListAtt } } -CHIPTotalVolatileOrganicCompoundsConcentrationMeasurementGeneratedCommandListAttributeCallback:: - ~CHIPTotalVolatileOrganicCompoundsConcentrationMeasurementGeneratedCommandListAttributeCallback() +CHIPTotalVolatileOrganicCompoundsConcentrationMeasurementGeneratedCommandListAttributeCallback::~ +CHIPTotalVolatileOrganicCompoundsConcentrationMeasurementGeneratedCommandListAttributeCallback() { JNIEnv * env = chip::JniReferences::GetInstance().GetEnvForCurrentThread(); if (env == nullptr) @@ -49959,8 +49956,8 @@ void CHIPTotalVolatileOrganicCompoundsConcentrationMeasurementGeneratedCommandLi } CHIPTotalVolatileOrganicCompoundsConcentrationMeasurementAcceptedCommandListAttributeCallback:: - CHIPTotalVolatileOrganicCompoundsConcentrationMeasurementAcceptedCommandListAttributeCallback(jobject javaCallback, - bool keepAlive) : +CHIPTotalVolatileOrganicCompoundsConcentrationMeasurementAcceptedCommandListAttributeCallback(jobject javaCallback, + bool keepAlive) : chip::Callback::Callback< CHIPTotalVolatileOrganicCompoundsConcentrationMeasurementClusterAcceptedCommandListAttributeCallbackType>(CallbackFn, this), keepAlive(keepAlive) @@ -49979,8 +49976,8 @@ CHIPTotalVolatileOrganicCompoundsConcentrationMeasurementAcceptedCommandListAttr } } -CHIPTotalVolatileOrganicCompoundsConcentrationMeasurementAcceptedCommandListAttributeCallback:: - ~CHIPTotalVolatileOrganicCompoundsConcentrationMeasurementAcceptedCommandListAttributeCallback() +CHIPTotalVolatileOrganicCompoundsConcentrationMeasurementAcceptedCommandListAttributeCallback::~ +CHIPTotalVolatileOrganicCompoundsConcentrationMeasurementAcceptedCommandListAttributeCallback() { JNIEnv * env = chip::JniReferences::GetInstance().GetEnvForCurrentThread(); if (env == nullptr) @@ -50038,7 +50035,7 @@ void CHIPTotalVolatileOrganicCompoundsConcentrationMeasurementAcceptedCommandLis } CHIPTotalVolatileOrganicCompoundsConcentrationMeasurementEventListAttributeCallback:: - CHIPTotalVolatileOrganicCompoundsConcentrationMeasurementEventListAttributeCallback(jobject javaCallback, bool keepAlive) : +CHIPTotalVolatileOrganicCompoundsConcentrationMeasurementEventListAttributeCallback(jobject javaCallback, bool keepAlive) : chip::Callback::Callback( CallbackFn, this), keepAlive(keepAlive) @@ -50057,8 +50054,8 @@ CHIPTotalVolatileOrganicCompoundsConcentrationMeasurementEventListAttributeCallb } } -CHIPTotalVolatileOrganicCompoundsConcentrationMeasurementEventListAttributeCallback:: - ~CHIPTotalVolatileOrganicCompoundsConcentrationMeasurementEventListAttributeCallback() +CHIPTotalVolatileOrganicCompoundsConcentrationMeasurementEventListAttributeCallback::~ +CHIPTotalVolatileOrganicCompoundsConcentrationMeasurementEventListAttributeCallback() { JNIEnv * env = chip::JniReferences::GetInstance().GetEnvForCurrentThread(); if (env == nullptr) @@ -50114,7 +50111,7 @@ void CHIPTotalVolatileOrganicCompoundsConcentrationMeasurementEventListAttribute } CHIPTotalVolatileOrganicCompoundsConcentrationMeasurementAttributeListAttributeCallback:: - CHIPTotalVolatileOrganicCompoundsConcentrationMeasurementAttributeListAttributeCallback(jobject javaCallback, bool keepAlive) : +CHIPTotalVolatileOrganicCompoundsConcentrationMeasurementAttributeListAttributeCallback(jobject javaCallback, bool keepAlive) : chip::Callback::Callback( CallbackFn, this), keepAlive(keepAlive) @@ -50133,8 +50130,8 @@ CHIPTotalVolatileOrganicCompoundsConcentrationMeasurementAttributeListAttributeC } } -CHIPTotalVolatileOrganicCompoundsConcentrationMeasurementAttributeListAttributeCallback:: - ~CHIPTotalVolatileOrganicCompoundsConcentrationMeasurementAttributeListAttributeCallback() +CHIPTotalVolatileOrganicCompoundsConcentrationMeasurementAttributeListAttributeCallback::~ +CHIPTotalVolatileOrganicCompoundsConcentrationMeasurementAttributeListAttributeCallback() { JNIEnv * env = chip::JniReferences::GetInstance().GetEnvForCurrentThread(); if (env == nullptr) @@ -50259,7 +50256,7 @@ void CHIPRadonConcentrationMeasurementMeasuredValueAttributeCallback::CallbackFn } CHIPRadonConcentrationMeasurementMinMeasuredValueAttributeCallback:: - CHIPRadonConcentrationMeasurementMinMeasuredValueAttributeCallback(jobject javaCallback, bool keepAlive) : +CHIPRadonConcentrationMeasurementMinMeasuredValueAttributeCallback(jobject javaCallback, bool keepAlive) : chip::Callback::Callback(CallbackFn, this), keepAlive(keepAlive) { @@ -50277,8 +50274,8 @@ CHIPRadonConcentrationMeasurementMinMeasuredValueAttributeCallback:: } } -CHIPRadonConcentrationMeasurementMinMeasuredValueAttributeCallback:: - ~CHIPRadonConcentrationMeasurementMinMeasuredValueAttributeCallback() +CHIPRadonConcentrationMeasurementMinMeasuredValueAttributeCallback::~ +CHIPRadonConcentrationMeasurementMinMeasuredValueAttributeCallback() { JNIEnv * env = chip::JniReferences::GetInstance().GetEnvForCurrentThread(); if (env == nullptr) @@ -50328,7 +50325,7 @@ void CHIPRadonConcentrationMeasurementMinMeasuredValueAttributeCallback::Callbac } CHIPRadonConcentrationMeasurementMaxMeasuredValueAttributeCallback:: - CHIPRadonConcentrationMeasurementMaxMeasuredValueAttributeCallback(jobject javaCallback, bool keepAlive) : +CHIPRadonConcentrationMeasurementMaxMeasuredValueAttributeCallback(jobject javaCallback, bool keepAlive) : chip::Callback::Callback(CallbackFn, this), keepAlive(keepAlive) { @@ -50346,8 +50343,8 @@ CHIPRadonConcentrationMeasurementMaxMeasuredValueAttributeCallback:: } } -CHIPRadonConcentrationMeasurementMaxMeasuredValueAttributeCallback:: - ~CHIPRadonConcentrationMeasurementMaxMeasuredValueAttributeCallback() +CHIPRadonConcentrationMeasurementMaxMeasuredValueAttributeCallback::~ +CHIPRadonConcentrationMeasurementMaxMeasuredValueAttributeCallback() { JNIEnv * env = chip::JniReferences::GetInstance().GetEnvForCurrentThread(); if (env == nullptr) @@ -50397,7 +50394,7 @@ void CHIPRadonConcentrationMeasurementMaxMeasuredValueAttributeCallback::Callbac } CHIPRadonConcentrationMeasurementPeakMeasuredValueAttributeCallback:: - CHIPRadonConcentrationMeasurementPeakMeasuredValueAttributeCallback(jobject javaCallback, bool keepAlive) : +CHIPRadonConcentrationMeasurementPeakMeasuredValueAttributeCallback(jobject javaCallback, bool keepAlive) : chip::Callback::Callback(CallbackFn, this), keepAlive(keepAlive) { @@ -50415,8 +50412,8 @@ CHIPRadonConcentrationMeasurementPeakMeasuredValueAttributeCallback:: } } -CHIPRadonConcentrationMeasurementPeakMeasuredValueAttributeCallback:: - ~CHIPRadonConcentrationMeasurementPeakMeasuredValueAttributeCallback() +CHIPRadonConcentrationMeasurementPeakMeasuredValueAttributeCallback::~ +CHIPRadonConcentrationMeasurementPeakMeasuredValueAttributeCallback() { JNIEnv * env = chip::JniReferences::GetInstance().GetEnvForCurrentThread(); if (env == nullptr) @@ -50466,7 +50463,7 @@ void CHIPRadonConcentrationMeasurementPeakMeasuredValueAttributeCallback::Callba } CHIPRadonConcentrationMeasurementAverageMeasuredValueAttributeCallback:: - CHIPRadonConcentrationMeasurementAverageMeasuredValueAttributeCallback(jobject javaCallback, bool keepAlive) : +CHIPRadonConcentrationMeasurementAverageMeasuredValueAttributeCallback(jobject javaCallback, bool keepAlive) : chip::Callback::Callback(CallbackFn, this), keepAlive(keepAlive) { @@ -50484,8 +50481,8 @@ CHIPRadonConcentrationMeasurementAverageMeasuredValueAttributeCallback:: } } -CHIPRadonConcentrationMeasurementAverageMeasuredValueAttributeCallback:: - ~CHIPRadonConcentrationMeasurementAverageMeasuredValueAttributeCallback() +CHIPRadonConcentrationMeasurementAverageMeasuredValueAttributeCallback::~ +CHIPRadonConcentrationMeasurementAverageMeasuredValueAttributeCallback() { JNIEnv * env = chip::JniReferences::GetInstance().GetEnvForCurrentThread(); if (env == nullptr) @@ -50535,7 +50532,7 @@ void CHIPRadonConcentrationMeasurementAverageMeasuredValueAttributeCallback::Cal } CHIPRadonConcentrationMeasurementGeneratedCommandListAttributeCallback:: - CHIPRadonConcentrationMeasurementGeneratedCommandListAttributeCallback(jobject javaCallback, bool keepAlive) : +CHIPRadonConcentrationMeasurementGeneratedCommandListAttributeCallback(jobject javaCallback, bool keepAlive) : chip::Callback::Callback(CallbackFn, this), keepAlive(keepAlive) { @@ -50553,8 +50550,8 @@ CHIPRadonConcentrationMeasurementGeneratedCommandListAttributeCallback:: } } -CHIPRadonConcentrationMeasurementGeneratedCommandListAttributeCallback:: - ~CHIPRadonConcentrationMeasurementGeneratedCommandListAttributeCallback() +CHIPRadonConcentrationMeasurementGeneratedCommandListAttributeCallback::~ +CHIPRadonConcentrationMeasurementGeneratedCommandListAttributeCallback() { JNIEnv * env = chip::JniReferences::GetInstance().GetEnvForCurrentThread(); if (env == nullptr) @@ -50608,7 +50605,7 @@ void CHIPRadonConcentrationMeasurementGeneratedCommandListAttributeCallback::Cal } CHIPRadonConcentrationMeasurementAcceptedCommandListAttributeCallback:: - CHIPRadonConcentrationMeasurementAcceptedCommandListAttributeCallback(jobject javaCallback, bool keepAlive) : +CHIPRadonConcentrationMeasurementAcceptedCommandListAttributeCallback(jobject javaCallback, bool keepAlive) : chip::Callback::Callback(CallbackFn, this), keepAlive(keepAlive) { @@ -50626,8 +50623,8 @@ CHIPRadonConcentrationMeasurementAcceptedCommandListAttributeCallback:: } } -CHIPRadonConcentrationMeasurementAcceptedCommandListAttributeCallback:: - ~CHIPRadonConcentrationMeasurementAcceptedCommandListAttributeCallback() +CHIPRadonConcentrationMeasurementAcceptedCommandListAttributeCallback::~ +CHIPRadonConcentrationMeasurementAcceptedCommandListAttributeCallback() { JNIEnv * env = chip::JniReferences::GetInstance().GetEnvForCurrentThread(); if (env == nullptr) 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 12d34873854914..147b18ffae1445 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 @@ -10453,192 +10453,6 @@ EmberAfStatus Set(chip::EndpointId endpoint, uint16_t value) namespace DeviceEnergyManagement { namespace Attributes { -namespace ESAType { - -EmberAfStatus Get(chip::EndpointId endpoint, chip::app::Clusters::DeviceEnergyManagement::ESATypeEnum * value) -{ - using Traits = NumericAttributeTraits; - Traits::StorageType temp; - uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp); - EmberAfStatus status = emberAfReadAttribute(endpoint, Clusters::DeviceEnergyManagement::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::DeviceEnergyManagement::ESATypeEnum value) -{ - using Traits = NumericAttributeTraits; - if (!Traits::CanRepresentValue(/* isNullable = */ false, value)) - { - return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; - } - Traits::StorageType storageValue; - Traits::WorkingToStorage(value, storageValue); - uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue); - return emberAfWriteAttribute(endpoint, Clusters::DeviceEnergyManagement::Id, Id, writable, ZCL_ENUM8_ATTRIBUTE_TYPE); -} - -} // namespace ESAType - -namespace ESACanGenerate { - -EmberAfStatus Get(chip::EndpointId endpoint, bool * value) -{ - using Traits = NumericAttributeTraits; - Traits::StorageType temp; - uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp); - EmberAfStatus status = emberAfReadAttribute(endpoint, Clusters::DeviceEnergyManagement::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, bool value) -{ - using Traits = NumericAttributeTraits; - if (!Traits::CanRepresentValue(/* isNullable = */ false, value)) - { - return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; - } - Traits::StorageType storageValue; - Traits::WorkingToStorage(value, storageValue); - uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue); - return emberAfWriteAttribute(endpoint, Clusters::DeviceEnergyManagement::Id, Id, writable, ZCL_BOOLEAN_ATTRIBUTE_TYPE); -} - -} // namespace ESACanGenerate - -namespace ESAState { - -EmberAfStatus Get(chip::EndpointId endpoint, chip::app::Clusters::DeviceEnergyManagement::ESAStateEnum * value) -{ - using Traits = NumericAttributeTraits; - Traits::StorageType temp; - uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp); - EmberAfStatus status = emberAfReadAttribute(endpoint, Clusters::DeviceEnergyManagement::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::DeviceEnergyManagement::ESAStateEnum value) -{ - using Traits = NumericAttributeTraits; - if (!Traits::CanRepresentValue(/* isNullable = */ false, value)) - { - return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; - } - Traits::StorageType storageValue; - Traits::WorkingToStorage(value, storageValue); - uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue); - return emberAfWriteAttribute(endpoint, Clusters::DeviceEnergyManagement::Id, Id, writable, ZCL_ENUM8_ATTRIBUTE_TYPE); -} - -} // namespace ESAState - -namespace AbsMinPower { - -EmberAfStatus Get(chip::EndpointId endpoint, int64_t * value) -{ - using Traits = NumericAttributeTraits; - Traits::StorageType temp; - uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp); - EmberAfStatus status = emberAfReadAttribute(endpoint, Clusters::DeviceEnergyManagement::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; - 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::DeviceEnergyManagement::Id, Id, writable, ZCL_POWER_MW_ATTRIBUTE_TYPE); -} - -} // namespace AbsMinPower - -namespace AbsMaxPower { - -EmberAfStatus Get(chip::EndpointId endpoint, int64_t * value) -{ - using Traits = NumericAttributeTraits; - Traits::StorageType temp; - uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp); - EmberAfStatus status = emberAfReadAttribute(endpoint, Clusters::DeviceEnergyManagement::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; - 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::DeviceEnergyManagement::Id, Id, writable, ZCL_POWER_MW_ATTRIBUTE_TYPE); -} - -} // namespace AbsMaxPower - -namespace FeatureMap { - -EmberAfStatus Get(chip::EndpointId endpoint, uint32_t * value) -{ - using Traits = NumericAttributeTraits; - Traits::StorageType temp; - uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp); - EmberAfStatus status = emberAfReadAttribute(endpoint, Clusters::DeviceEnergyManagement::Id, Id, readable, sizeof(temp)); - VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); - if (!Traits::CanRepresentValue(/* isNullable = */ false, temp)) - { - return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; - } - *value = Traits::StorageToWorking(temp); - return status; -} -EmberAfStatus Set(chip::EndpointId endpoint, uint32_t value) -{ - using Traits = NumericAttributeTraits; - if (!Traits::CanRepresentValue(/* isNullable = */ false, value)) - { - return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; - } - Traits::StorageType storageValue; - Traits::WorkingToStorage(value, storageValue); - uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue); - return emberAfWriteAttribute(endpoint, Clusters::DeviceEnergyManagement::Id, Id, writable, ZCL_BITMAP32_ATTRIBUTE_TYPE); -} - -} // namespace FeatureMap - namespace ClusterRevision { EmberAfStatus Get(chip::EndpointId endpoint, uint16_t * value) @@ -10676,65 +10490,11 @@ EmberAfStatus Set(chip::EndpointId endpoint, uint16_t value) namespace EnergyEvse { namespace Attributes { -namespace State { - -EmberAfStatus Get(chip::EndpointId endpoint, DataModel::Nullable & value) -{ - using Traits = NumericAttributeTraits; - Traits::StorageType temp; - uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp); - EmberAfStatus status = emberAfReadAttribute(endpoint, Clusters::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; - 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; - 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 & value) -{ - if (value.IsNull()) - { - return SetNull(endpoint); - } - - return Set(endpoint, value.Value()); -} - -} // namespace State - -namespace SupplyState { +namespace NumberOfWeeklyTargets { -EmberAfStatus Get(chip::EndpointId endpoint, chip::app::Clusters::EnergyEvse::SupplyStateEnum * value) +EmberAfStatus Get(chip::EndpointId endpoint, uint8_t * value) { - using Traits = NumericAttributeTraits; + using Traits = NumericAttributeTraits; Traits::StorageType temp; uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp); EmberAfStatus status = emberAfReadAttribute(endpoint, Clusters::EnergyEvse::Id, Id, readable, sizeof(temp)); @@ -10746,9 +10506,9 @@ EmberAfStatus Get(chip::EndpointId endpoint, chip::app::Clusters::EnergyEvse::Su *value = Traits::StorageToWorking(temp); return status; } -EmberAfStatus Set(chip::EndpointId endpoint, chip::app::Clusters::EnergyEvse::SupplyStateEnum value) +EmberAfStatus Set(chip::EndpointId endpoint, uint8_t value) { - using Traits = NumericAttributeTraits; + using Traits = NumericAttributeTraits; if (!Traits::CanRepresentValue(/* isNullable = */ false, value)) { return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; @@ -10756,16 +10516,16 @@ EmberAfStatus Set(chip::EndpointId endpoint, chip::app::Clusters::EnergyEvse::Su 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); + return emberAfWriteAttribute(endpoint, Clusters::EnergyEvse::Id, Id, writable, ZCL_INT8U_ATTRIBUTE_TYPE); } -} // namespace SupplyState +} // namespace NumberOfWeeklyTargets -namespace FaultState { +namespace NumberOfDailyTargets { -EmberAfStatus Get(chip::EndpointId endpoint, chip::app::Clusters::EnergyEvse::FaultStateEnum * value) +EmberAfStatus Get(chip::EndpointId endpoint, uint8_t * value) { - using Traits = NumericAttributeTraits; + using Traits = NumericAttributeTraits; Traits::StorageType temp; uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp); EmberAfStatus status = emberAfReadAttribute(endpoint, Clusters::EnergyEvse::Id, Id, readable, sizeof(temp)); @@ -10777,9 +10537,9 @@ EmberAfStatus Get(chip::EndpointId endpoint, chip::app::Clusters::EnergyEvse::Fa *value = Traits::StorageToWorking(temp); return status; } -EmberAfStatus Set(chip::EndpointId endpoint, chip::app::Clusters::EnergyEvse::FaultStateEnum value) +EmberAfStatus Set(chip::EndpointId endpoint, uint8_t value) { - using Traits = NumericAttributeTraits; + using Traits = NumericAttributeTraits; if (!Traits::CanRepresentValue(/* isNullable = */ false, value)) { return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; @@ -10787,1027 +10547,10 @@ EmberAfStatus Set(chip::EndpointId endpoint, chip::app::Clusters::EnergyEvse::Fa 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 & value) -{ - using Traits = NumericAttributeTraits; - Traits::StorageType temp; - uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp); - EmberAfStatus status = emberAfReadAttribute(endpoint, Clusters::EnergyEvse::Id, Id, readable, sizeof(temp)); - VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); - if (Traits::IsNullValue(temp)) - { - value.SetNull(); - } - else - { - value.SetNonNull() = Traits::StorageToWorking(temp); - } - return status; -} -EmberAfStatus Set(chip::EndpointId endpoint, uint32_t value) -{ - using Traits = NumericAttributeTraits; - if (!Traits::CanRepresentValue(/* isNullable = */ true, value)) - { - return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; - } - Traits::StorageType storageValue; - Traits::WorkingToStorage(value, storageValue); - uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue); - return emberAfWriteAttribute(endpoint, Clusters::EnergyEvse::Id, Id, writable, ZCL_EPOCH_S_ATTRIBUTE_TYPE); + return emberAfWriteAttribute(endpoint, Clusters::EnergyEvse::Id, Id, writable, ZCL_INT8U_ATTRIBUTE_TYPE); } -EmberAfStatus SetNull(chip::EndpointId endpoint) -{ - using Traits = NumericAttributeTraits; - Traits::StorageType value; - Traits::SetNull(value); - uint8_t * writable = Traits::ToAttributeStoreRepresentation(value); - return emberAfWriteAttribute(endpoint, Clusters::EnergyEvse::Id, Id, writable, ZCL_EPOCH_S_ATTRIBUTE_TYPE); -} - -EmberAfStatus Set(chip::EndpointId endpoint, const chip::app::DataModel::Nullable & value) -{ - if (value.IsNull()) - { - return SetNull(endpoint); - } - - return Set(endpoint, value.Value()); -} - -} // namespace ChargingEnabledUntil - -namespace DischargingEnabledUntil { - -EmberAfStatus Get(chip::EndpointId endpoint, DataModel::Nullable & value) -{ - using Traits = NumericAttributeTraits; - Traits::StorageType temp; - uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp); - EmberAfStatus status = emberAfReadAttribute(endpoint, Clusters::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; - 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; - 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 & 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; - 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; - 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_AMPERAGE_MA_ATTRIBUTE_TYPE); -} - -} // namespace CircuitCapacity - -namespace MinimumChargeCurrent { - -EmberAfStatus Get(chip::EndpointId endpoint, int64_t * value) -{ - using Traits = NumericAttributeTraits; - Traits::StorageType temp; - uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp); - EmberAfStatus status = emberAfReadAttribute(endpoint, Clusters::EnergyEvse::Id, Id, readable, sizeof(temp)); - VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); - if (!Traits::CanRepresentValue(/* isNullable = */ false, temp)) - { - return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; - } - *value = Traits::StorageToWorking(temp); - return status; -} -EmberAfStatus Set(chip::EndpointId endpoint, int64_t value) -{ - using Traits = NumericAttributeTraits; - if (!Traits::CanRepresentValue(/* isNullable = */ false, value)) - { - return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; - } - Traits::StorageType storageValue; - Traits::WorkingToStorage(value, storageValue); - uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue); - return emberAfWriteAttribute(endpoint, Clusters::EnergyEvse::Id, Id, writable, ZCL_AMPERAGE_MA_ATTRIBUTE_TYPE); -} - -} // namespace MinimumChargeCurrent - -namespace MaximumChargeCurrent { - -EmberAfStatus Get(chip::EndpointId endpoint, int64_t * value) -{ - using Traits = NumericAttributeTraits; - Traits::StorageType temp; - uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp); - EmberAfStatus status = emberAfReadAttribute(endpoint, Clusters::EnergyEvse::Id, Id, readable, sizeof(temp)); - VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); - if (!Traits::CanRepresentValue(/* isNullable = */ false, temp)) - { - return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; - } - *value = Traits::StorageToWorking(temp); - return status; -} -EmberAfStatus Set(chip::EndpointId endpoint, int64_t value) -{ - using Traits = NumericAttributeTraits; - if (!Traits::CanRepresentValue(/* isNullable = */ false, value)) - { - return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; - } - Traits::StorageType storageValue; - Traits::WorkingToStorage(value, storageValue); - uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue); - return emberAfWriteAttribute(endpoint, Clusters::EnergyEvse::Id, Id, writable, ZCL_AMPERAGE_MA_ATTRIBUTE_TYPE); -} - -} // namespace MaximumChargeCurrent - -namespace MaximumDischargeCurrent { - -EmberAfStatus Get(chip::EndpointId endpoint, int64_t * value) -{ - using Traits = NumericAttributeTraits; - Traits::StorageType temp; - uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp); - EmberAfStatus status = emberAfReadAttribute(endpoint, Clusters::EnergyEvse::Id, Id, readable, sizeof(temp)); - VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); - if (!Traits::CanRepresentValue(/* isNullable = */ false, temp)) - { - return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; - } - *value = Traits::StorageToWorking(temp); - return status; -} -EmberAfStatus Set(chip::EndpointId endpoint, int64_t value) -{ - using Traits = NumericAttributeTraits; - if (!Traits::CanRepresentValue(/* isNullable = */ false, value)) - { - return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; - } - Traits::StorageType storageValue; - Traits::WorkingToStorage(value, storageValue); - uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue); - return emberAfWriteAttribute(endpoint, Clusters::EnergyEvse::Id, Id, writable, ZCL_AMPERAGE_MA_ATTRIBUTE_TYPE); -} - -} // namespace MaximumDischargeCurrent - -namespace UserMaximumChargeCurrent { - -EmberAfStatus Get(chip::EndpointId endpoint, int64_t * value) -{ - using Traits = NumericAttributeTraits; - Traits::StorageType temp; - uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp); - EmberAfStatus status = emberAfReadAttribute(endpoint, Clusters::EnergyEvse::Id, Id, readable, sizeof(temp)); - VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); - if (!Traits::CanRepresentValue(/* isNullable = */ false, temp)) - { - return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; - } - *value = Traits::StorageToWorking(temp); - return status; -} -EmberAfStatus Set(chip::EndpointId endpoint, int64_t value) -{ - using Traits = NumericAttributeTraits; - if (!Traits::CanRepresentValue(/* isNullable = */ false, value)) - { - return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; - } - Traits::StorageType storageValue; - Traits::WorkingToStorage(value, storageValue); - uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue); - return emberAfWriteAttribute(endpoint, Clusters::EnergyEvse::Id, Id, writable, ZCL_AMPERAGE_MA_ATTRIBUTE_TYPE); -} - -} // namespace UserMaximumChargeCurrent - -namespace RandomizationDelayWindow { - -EmberAfStatus Get(chip::EndpointId endpoint, uint32_t * value) -{ - using Traits = NumericAttributeTraits; - Traits::StorageType temp; - uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp); - EmberAfStatus status = emberAfReadAttribute(endpoint, Clusters::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; - 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; - Traits::StorageType temp; - uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp); - EmberAfStatus status = emberAfReadAttribute(endpoint, Clusters::EnergyEvse::Id, Id, readable, sizeof(temp)); - VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); - if (!Traits::CanRepresentValue(/* isNullable = */ false, temp)) - { - return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; - } - *value = Traits::StorageToWorking(temp); - return status; -} -EmberAfStatus Set(chip::EndpointId endpoint, uint8_t value) -{ - using Traits = NumericAttributeTraits; - if (!Traits::CanRepresentValue(/* isNullable = */ false, value)) - { - return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; - } - Traits::StorageType storageValue; - Traits::WorkingToStorage(value, storageValue); - uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue); - return emberAfWriteAttribute(endpoint, Clusters::EnergyEvse::Id, Id, writable, ZCL_INT8U_ATTRIBUTE_TYPE); -} - -} // namespace NumberOfWeeklyTargets - -namespace NumberOfDailyTargets { - -EmberAfStatus Get(chip::EndpointId endpoint, uint8_t * value) -{ - using Traits = NumericAttributeTraits; - Traits::StorageType temp; - uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp); - EmberAfStatus status = emberAfReadAttribute(endpoint, Clusters::EnergyEvse::Id, Id, readable, sizeof(temp)); - VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); - if (!Traits::CanRepresentValue(/* isNullable = */ false, temp)) - { - return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; - } - *value = Traits::StorageToWorking(temp); - return status; -} -EmberAfStatus Set(chip::EndpointId endpoint, uint8_t value) -{ - using Traits = NumericAttributeTraits; - if (!Traits::CanRepresentValue(/* isNullable = */ false, value)) - { - return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; - } - Traits::StorageType storageValue; - Traits::WorkingToStorage(value, storageValue); - uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue); - return emberAfWriteAttribute(endpoint, Clusters::EnergyEvse::Id, Id, writable, ZCL_INT8U_ATTRIBUTE_TYPE); -} - -} // namespace NumberOfDailyTargets - -namespace NextChargeStartTime { - -EmberAfStatus Get(chip::EndpointId endpoint, DataModel::Nullable & value) -{ - using Traits = NumericAttributeTraits; - Traits::StorageType temp; - uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp); - EmberAfStatus status = emberAfReadAttribute(endpoint, Clusters::EnergyEvse::Id, Id, readable, sizeof(temp)); - VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); - if (Traits::IsNullValue(temp)) - { - value.SetNull(); - } - else - { - value.SetNonNull() = Traits::StorageToWorking(temp); - } - return status; -} -EmberAfStatus Set(chip::EndpointId endpoint, uint32_t value) -{ - using Traits = NumericAttributeTraits; - if (!Traits::CanRepresentValue(/* isNullable = */ true, value)) - { - return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; - } - Traits::StorageType storageValue; - Traits::WorkingToStorage(value, storageValue); - uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue); - return emberAfWriteAttribute(endpoint, Clusters::EnergyEvse::Id, Id, writable, ZCL_EPOCH_S_ATTRIBUTE_TYPE); -} - -EmberAfStatus SetNull(chip::EndpointId endpoint) -{ - using Traits = NumericAttributeTraits; - Traits::StorageType value; - Traits::SetNull(value); - uint8_t * writable = Traits::ToAttributeStoreRepresentation(value); - return emberAfWriteAttribute(endpoint, Clusters::EnergyEvse::Id, Id, writable, ZCL_EPOCH_S_ATTRIBUTE_TYPE); -} - -EmberAfStatus Set(chip::EndpointId endpoint, const chip::app::DataModel::Nullable & value) -{ - if (value.IsNull()) - { - return SetNull(endpoint); - } - - return Set(endpoint, value.Value()); -} - -} // namespace NextChargeStartTime - -namespace NextChargeTargetTime { - -EmberAfStatus Get(chip::EndpointId endpoint, DataModel::Nullable & value) -{ - using Traits = NumericAttributeTraits; - Traits::StorageType temp; - uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp); - EmberAfStatus status = emberAfReadAttribute(endpoint, Clusters::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; - 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; - 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 & value) -{ - if (value.IsNull()) - { - return SetNull(endpoint); - } - - return Set(endpoint, value.Value()); -} - -} // namespace NextChargeTargetTime - -namespace NextChargeRequiredEnergy { - -EmberAfStatus Get(chip::EndpointId endpoint, DataModel::Nullable & value) -{ - using Traits = NumericAttributeTraits; - Traits::StorageType temp; - uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp); - EmberAfStatus status = emberAfReadAttribute(endpoint, Clusters::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; - 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_ENERGY_MWH_ATTRIBUTE_TYPE); -} - -EmberAfStatus SetNull(chip::EndpointId endpoint) -{ - using Traits = NumericAttributeTraits; - Traits::StorageType value; - Traits::SetNull(value); - uint8_t * writable = Traits::ToAttributeStoreRepresentation(value); - return emberAfWriteAttribute(endpoint, Clusters::EnergyEvse::Id, Id, writable, ZCL_ENERGY_MWH_ATTRIBUTE_TYPE); -} - -EmberAfStatus Set(chip::EndpointId endpoint, const chip::app::DataModel::Nullable & value) -{ - if (value.IsNull()) - { - return SetNull(endpoint); - } - - return Set(endpoint, value.Value()); -} - -} // namespace NextChargeRequiredEnergy - -namespace NextChargeTargetSoC { - -EmberAfStatus Get(chip::EndpointId endpoint, DataModel::Nullable & value) -{ - using Traits = NumericAttributeTraits; - Traits::StorageType temp; - uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp); - EmberAfStatus status = emberAfReadAttribute(endpoint, Clusters::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; - 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; - 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 & value) -{ - if (value.IsNull()) - { - return SetNull(endpoint); - } - - return Set(endpoint, value.Value()); -} - -} // namespace NextChargeTargetSoC - -namespace ApproximateEVEfficiency { - -EmberAfStatus Get(chip::EndpointId endpoint, DataModel::Nullable & value) -{ - using Traits = NumericAttributeTraits; - Traits::StorageType temp; - uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp); - EmberAfStatus status = emberAfReadAttribute(endpoint, Clusters::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; - 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; - 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 & value) -{ - if (value.IsNull()) - { - return SetNull(endpoint); - } - - return Set(endpoint, value.Value()); -} - -} // namespace ApproximateEVEfficiency - -namespace StateOfCharge { - -EmberAfStatus Get(chip::EndpointId endpoint, DataModel::Nullable & value) -{ - using Traits = NumericAttributeTraits; - Traits::StorageType temp; - uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp); - EmberAfStatus status = emberAfReadAttribute(endpoint, Clusters::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; - 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; - 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 & value) -{ - if (value.IsNull()) - { - return SetNull(endpoint); - } - - return Set(endpoint, value.Value()); -} - -} // namespace StateOfCharge - -namespace BatteryCapacity { - -EmberAfStatus Get(chip::EndpointId endpoint, DataModel::Nullable & value) -{ - using Traits = NumericAttributeTraits; - Traits::StorageType temp; - uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp); - EmberAfStatus status = emberAfReadAttribute(endpoint, Clusters::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; - 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_ENERGY_MWH_ATTRIBUTE_TYPE); -} - -EmberAfStatus SetNull(chip::EndpointId endpoint) -{ - using Traits = NumericAttributeTraits; - Traits::StorageType value; - Traits::SetNull(value); - uint8_t * writable = Traits::ToAttributeStoreRepresentation(value); - return emberAfWriteAttribute(endpoint, Clusters::EnergyEvse::Id, Id, writable, ZCL_ENERGY_MWH_ATTRIBUTE_TYPE); -} - -EmberAfStatus Set(chip::EndpointId endpoint, const chip::app::DataModel::Nullable & value) -{ - if (value.IsNull()) - { - return SetNull(endpoint); - } - - return Set(endpoint, value.Value()); -} - -} // namespace BatteryCapacity - -namespace VehicleID { - -EmberAfStatus Get(chip::EndpointId endpoint, DataModel::Nullable & 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::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::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(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 & value) -{ - if (value.IsNull()) - { - return SetNull(endpoint); - } - - return Set(endpoint, value.Value()); -} - -} // namespace VehicleID - -namespace SessionID { - -EmberAfStatus Get(chip::EndpointId endpoint, DataModel::Nullable & value) -{ - using Traits = NumericAttributeTraits; - Traits::StorageType temp; - uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp); - EmberAfStatus status = emberAfReadAttribute(endpoint, Clusters::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; - 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; - 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 & value) -{ - if (value.IsNull()) - { - return SetNull(endpoint); - } - - return Set(endpoint, value.Value()); -} - -} // namespace SessionID - -namespace SessionDuration { - -EmberAfStatus Get(chip::EndpointId endpoint, DataModel::Nullable & value) -{ - using Traits = NumericAttributeTraits; - Traits::StorageType temp; - uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp); - EmberAfStatus status = emberAfReadAttribute(endpoint, Clusters::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; - 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_ELAPSED_S_ATTRIBUTE_TYPE); -} - -EmberAfStatus SetNull(chip::EndpointId endpoint) -{ - using Traits = NumericAttributeTraits; - Traits::StorageType value; - Traits::SetNull(value); - uint8_t * writable = Traits::ToAttributeStoreRepresentation(value); - return emberAfWriteAttribute(endpoint, Clusters::EnergyEvse::Id, Id, writable, ZCL_ELAPSED_S_ATTRIBUTE_TYPE); -} - -EmberAfStatus Set(chip::EndpointId endpoint, const chip::app::DataModel::Nullable & value) -{ - if (value.IsNull()) - { - return SetNull(endpoint); - } - - return Set(endpoint, value.Value()); -} - -} // namespace SessionDuration - -namespace SessionEnergyCharged { - -EmberAfStatus Get(chip::EndpointId endpoint, DataModel::Nullable & value) -{ - using Traits = NumericAttributeTraits; - Traits::StorageType temp; - uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp); - EmberAfStatus status = emberAfReadAttribute(endpoint, Clusters::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; - 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_ENERGY_MWH_ATTRIBUTE_TYPE); -} - -EmberAfStatus SetNull(chip::EndpointId endpoint) -{ - using Traits = NumericAttributeTraits; - Traits::StorageType value; - Traits::SetNull(value); - uint8_t * writable = Traits::ToAttributeStoreRepresentation(value); - return emberAfWriteAttribute(endpoint, Clusters::EnergyEvse::Id, Id, writable, ZCL_ENERGY_MWH_ATTRIBUTE_TYPE); -} - -EmberAfStatus Set(chip::EndpointId endpoint, const chip::app::DataModel::Nullable & value) -{ - if (value.IsNull()) - { - return SetNull(endpoint); - } - - return Set(endpoint, value.Value()); -} - -} // namespace SessionEnergyCharged - -namespace SessionEnergyDischarged { - -EmberAfStatus Get(chip::EndpointId endpoint, DataModel::Nullable & value) -{ - using Traits = NumericAttributeTraits; - Traits::StorageType temp; - uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp); - EmberAfStatus status = emberAfReadAttribute(endpoint, Clusters::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; - 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_ENERGY_MWH_ATTRIBUTE_TYPE); -} - -EmberAfStatus SetNull(chip::EndpointId endpoint) -{ - using Traits = NumericAttributeTraits; - Traits::StorageType value; - Traits::SetNull(value); - uint8_t * writable = Traits::ToAttributeStoreRepresentation(value); - return emberAfWriteAttribute(endpoint, Clusters::EnergyEvse::Id, Id, writable, ZCL_ENERGY_MWH_ATTRIBUTE_TYPE); -} - -EmberAfStatus Set(chip::EndpointId endpoint, const chip::app::DataModel::Nullable & value) -{ - if (value.IsNull()) - { - return SetNull(endpoint); - } - - return Set(endpoint, value.Value()); -} - -} // namespace SessionEnergyDischarged - -namespace FeatureMap { - -EmberAfStatus Get(chip::EndpointId endpoint, uint32_t * value) -{ - using Traits = NumericAttributeTraits; - Traits::StorageType temp; - uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp); - EmberAfStatus status = emberAfReadAttribute(endpoint, Clusters::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; - 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 NumberOfDailyTargets namespace ClusterRevision { 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 9540569158a171..f8c849863c7b59 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 @@ -2029,36 +2029,6 @@ EmberAfStatus Set(chip::EndpointId endpoint, uint16_t value); namespace DeviceEnergyManagement { namespace Attributes { -namespace ESAType { -EmberAfStatus Get(chip::EndpointId endpoint, chip::app::Clusters::DeviceEnergyManagement::ESATypeEnum * value); // ESATypeEnum -EmberAfStatus Set(chip::EndpointId endpoint, chip::app::Clusters::DeviceEnergyManagement::ESATypeEnum value); -} // namespace ESAType - -namespace ESACanGenerate { -EmberAfStatus Get(chip::EndpointId endpoint, bool * value); // boolean -EmberAfStatus Set(chip::EndpointId endpoint, bool value); -} // namespace ESACanGenerate - -namespace ESAState { -EmberAfStatus Get(chip::EndpointId endpoint, chip::app::Clusters::DeviceEnergyManagement::ESAStateEnum * value); // ESAStateEnum -EmberAfStatus Set(chip::EndpointId endpoint, chip::app::Clusters::DeviceEnergyManagement::ESAStateEnum value); -} // namespace ESAState - -namespace AbsMinPower { -EmberAfStatus Get(chip::EndpointId endpoint, int64_t * value); // power_mw -EmberAfStatus Set(chip::EndpointId endpoint, int64_t value); -} // namespace AbsMinPower - -namespace AbsMaxPower { -EmberAfStatus Get(chip::EndpointId endpoint, int64_t * value); // power_mw -EmberAfStatus Set(chip::EndpointId endpoint, int64_t value); -} // namespace AbsMaxPower - -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); @@ -2070,68 +2040,6 @@ EmberAfStatus Set(chip::EndpointId endpoint, uint16_t value); namespace EnergyEvse { namespace Attributes { -namespace State { -EmberAfStatus Get(chip::EndpointId endpoint, DataModel::Nullable & 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 & 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 & 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 & value); -} // namespace ChargingEnabledUntil - -namespace DischargingEnabledUntil { -EmberAfStatus Get(chip::EndpointId endpoint, DataModel::Nullable & 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 & value); -} // namespace DischargingEnabledUntil - -namespace CircuitCapacity { -EmberAfStatus Get(chip::EndpointId endpoint, int64_t * value); // amperage_ma -EmberAfStatus Set(chip::EndpointId endpoint, int64_t value); -} // namespace CircuitCapacity - -namespace MinimumChargeCurrent { -EmberAfStatus Get(chip::EndpointId endpoint, int64_t * value); // amperage_ma -EmberAfStatus Set(chip::EndpointId endpoint, int64_t value); -} // namespace MinimumChargeCurrent - -namespace MaximumChargeCurrent { -EmberAfStatus Get(chip::EndpointId endpoint, int64_t * value); // amperage_ma -EmberAfStatus Set(chip::EndpointId endpoint, int64_t value); -} // namespace MaximumChargeCurrent - -namespace MaximumDischargeCurrent { -EmberAfStatus Get(chip::EndpointId endpoint, int64_t * value); // amperage_ma -EmberAfStatus Set(chip::EndpointId endpoint, int64_t value); -} // namespace MaximumDischargeCurrent - -namespace UserMaximumChargeCurrent { -EmberAfStatus Get(chip::EndpointId endpoint, int64_t * value); // amperage_ma -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); @@ -2142,95 +2050,6 @@ EmberAfStatus Get(chip::EndpointId endpoint, uint8_t * value); // int8u EmberAfStatus Set(chip::EndpointId endpoint, uint8_t value); } // namespace NumberOfDailyTargets -namespace NextChargeStartTime { -EmberAfStatus Get(chip::EndpointId endpoint, DataModel::Nullable & value); // epoch_s -EmberAfStatus Set(chip::EndpointId endpoint, uint32_t value); -EmberAfStatus SetNull(chip::EndpointId endpoint); -EmberAfStatus Set(chip::EndpointId endpoint, const chip::app::DataModel::Nullable & value); -} // namespace NextChargeStartTime - -namespace NextChargeTargetTime { -EmberAfStatus Get(chip::EndpointId endpoint, DataModel::Nullable & 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 & value); -} // namespace NextChargeTargetTime - -namespace NextChargeRequiredEnergy { -EmberAfStatus Get(chip::EndpointId endpoint, DataModel::Nullable & value); // energy_mwh -EmberAfStatus Set(chip::EndpointId endpoint, int64_t value); -EmberAfStatus SetNull(chip::EndpointId endpoint); -EmberAfStatus Set(chip::EndpointId endpoint, const chip::app::DataModel::Nullable & value); -} // namespace NextChargeRequiredEnergy - -namespace NextChargeTargetSoC { -EmberAfStatus Get(chip::EndpointId endpoint, DataModel::Nullable & value); // percent -EmberAfStatus Set(chip::EndpointId endpoint, chip::Percent value); -EmberAfStatus SetNull(chip::EndpointId endpoint); -EmberAfStatus Set(chip::EndpointId endpoint, const chip::app::DataModel::Nullable & value); -} // namespace NextChargeTargetSoC - -namespace ApproximateEVEfficiency { -EmberAfStatus Get(chip::EndpointId endpoint, DataModel::Nullable & 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 & value); -} // namespace ApproximateEVEfficiency - -namespace StateOfCharge { -EmberAfStatus Get(chip::EndpointId endpoint, DataModel::Nullable & value); // percent -EmberAfStatus Set(chip::EndpointId endpoint, chip::Percent value); -EmberAfStatus SetNull(chip::EndpointId endpoint); -EmberAfStatus Set(chip::EndpointId endpoint, const chip::app::DataModel::Nullable & value); -} // namespace StateOfCharge - -namespace BatteryCapacity { -EmberAfStatus Get(chip::EndpointId endpoint, DataModel::Nullable & value); // energy_mwh -EmberAfStatus Set(chip::EndpointId endpoint, int64_t value); -EmberAfStatus SetNull(chip::EndpointId endpoint); -EmberAfStatus Set(chip::EndpointId endpoint, const chip::app::DataModel::Nullable & value); -} // namespace BatteryCapacity - -namespace VehicleID { -EmberAfStatus Get(chip::EndpointId endpoint, DataModel::Nullable & 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 & value); -} // namespace VehicleID - -namespace SessionID { -EmberAfStatus Get(chip::EndpointId endpoint, DataModel::Nullable & 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 & value); -} // namespace SessionID - -namespace SessionDuration { -EmberAfStatus Get(chip::EndpointId endpoint, DataModel::Nullable & value); // elapsed_s -EmberAfStatus Set(chip::EndpointId endpoint, uint32_t value); -EmberAfStatus SetNull(chip::EndpointId endpoint); -EmberAfStatus Set(chip::EndpointId endpoint, const chip::app::DataModel::Nullable & value); -} // namespace SessionDuration - -namespace SessionEnergyCharged { -EmberAfStatus Get(chip::EndpointId endpoint, DataModel::Nullable & value); // energy_mwh -EmberAfStatus Set(chip::EndpointId endpoint, int64_t value); -EmberAfStatus SetNull(chip::EndpointId endpoint); -EmberAfStatus Set(chip::EndpointId endpoint, const chip::app::DataModel::Nullable & value); -} // namespace SessionEnergyCharged - -namespace SessionEnergyDischarged { -EmberAfStatus Get(chip::EndpointId endpoint, DataModel::Nullable & value); // energy_mwh -EmberAfStatus Set(chip::EndpointId endpoint, int64_t value); -EmberAfStatus SetNull(chip::EndpointId endpoint); -EmberAfStatus Set(chip::EndpointId endpoint, const chip::app::DataModel::Nullable & 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); From b24bb80417aef9d77e424aa3e3b0da5453087191 Mon Sep 17 00:00:00 2001 From: James Harrow Date: Mon, 8 Jan 2024 21:24:21 +0000 Subject: [PATCH 077/114] Fixed incorrect type - not picked up by all compilers. --- .../energy-management-common/src/EnergyEvseManager.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/examples/energy-management-app/energy-management-common/src/EnergyEvseManager.cpp b/examples/energy-management-app/energy-management-common/src/EnergyEvseManager.cpp index 389a830e8da759..a71474f0913abb 100644 --- a/examples/energy-management-app/energy-management-common/src/EnergyEvseManager.cpp +++ b/examples/energy-management-app/energy-management-common/src/EnergyEvseManager.cpp @@ -59,7 +59,7 @@ CHIP_ERROR EnergyEvseManager::LoadPersistentAttributes() } // Restore UserMaximumChargeCurrent value - uint64_t tempUserMaximumChargeCurrent; + int64_t tempUserMaximumChargeCurrent; err = aProvider->ReadScalarValue(ConcreteAttributePath(aEndpointId, EnergyEvse::Id, Attributes::UserMaximumChargeCurrent::Id), tempUserMaximumChargeCurrent); if (err == CHIP_NO_ERROR) From 2fe195d83d51801afda3bfc3e7d1285f27eec4b1 Mon Sep 17 00:00:00 2001 From: James Harrow Date: Mon, 8 Jan 2024 21:50:26 +0000 Subject: [PATCH 078/114] Re-ran bootstrap, and then regen-all - to pick up more zap generated fixes --- .../zap-generated/CHIPInvokeCallbacks.cpp | 64 +- .../java/zap-generated/CHIPReadCallbacks.cpp | 879 +++++++++--------- 2 files changed, 473 insertions(+), 470 deletions(-) diff --git a/src/controller/java/zap-generated/CHIPInvokeCallbacks.cpp b/src/controller/java/zap-generated/CHIPInvokeCallbacks.cpp index 3c2c132eec3246..8c3deacae5abaf 100644 --- a/src/controller/java/zap-generated/CHIPInvokeCallbacks.cpp +++ b/src/controller/java/zap-generated/CHIPInvokeCallbacks.cpp @@ -1545,7 +1545,7 @@ void CHIPGeneralCommissioningClusterArmFailSafeResponseCallback::CallbackFn( env->CallVoidMethod(javaCallbackRef, javaMethod, ErrorCode, DebugText); } CHIPGeneralCommissioningClusterSetRegulatoryConfigResponseCallback:: -CHIPGeneralCommissioningClusterSetRegulatoryConfigResponseCallback(jobject javaCallback) : + CHIPGeneralCommissioningClusterSetRegulatoryConfigResponseCallback(jobject javaCallback) : Callback::Callback(CallbackFn, this) { JNIEnv * env = JniReferences::GetInstance().GetEnvForCurrentThread(); @@ -1562,8 +1562,8 @@ CHIPGeneralCommissioningClusterSetRegulatoryConfigResponseCallback(jobject javaC } } -CHIPGeneralCommissioningClusterSetRegulatoryConfigResponseCallback::~ -CHIPGeneralCommissioningClusterSetRegulatoryConfigResponseCallback() +CHIPGeneralCommissioningClusterSetRegulatoryConfigResponseCallback:: + ~CHIPGeneralCommissioningClusterSetRegulatoryConfigResponseCallback() { JNIEnv * env = JniReferences::GetInstance().GetEnvForCurrentThread(); if (env == nullptr) @@ -1612,7 +1612,7 @@ void CHIPGeneralCommissioningClusterSetRegulatoryConfigResponseCallback::Callbac env->CallVoidMethod(javaCallbackRef, javaMethod, ErrorCode, DebugText); } CHIPGeneralCommissioningClusterCommissioningCompleteResponseCallback:: -CHIPGeneralCommissioningClusterCommissioningCompleteResponseCallback(jobject javaCallback) : + CHIPGeneralCommissioningClusterCommissioningCompleteResponseCallback(jobject javaCallback) : Callback::Callback(CallbackFn, this) { JNIEnv * env = JniReferences::GetInstance().GetEnvForCurrentThread(); @@ -1629,8 +1629,8 @@ CHIPGeneralCommissioningClusterCommissioningCompleteResponseCallback(jobject jav } } -CHIPGeneralCommissioningClusterCommissioningCompleteResponseCallback::~ -CHIPGeneralCommissioningClusterCommissioningCompleteResponseCallback() +CHIPGeneralCommissioningClusterCommissioningCompleteResponseCallback:: + ~CHIPGeneralCommissioningClusterCommissioningCompleteResponseCallback() { JNIEnv * env = JniReferences::GetInstance().GetEnvForCurrentThread(); if (env == nullptr) @@ -2514,7 +2514,7 @@ void CHIPOperationalCredentialsClusterAttestationResponseCallback::CallbackFn( env->CallVoidMethod(javaCallbackRef, javaMethod, AttestationElements, AttestationSignature); } CHIPOperationalCredentialsClusterCertificateChainResponseCallback:: -CHIPOperationalCredentialsClusterCertificateChainResponseCallback(jobject javaCallback) : + CHIPOperationalCredentialsClusterCertificateChainResponseCallback(jobject javaCallback) : Callback::Callback(CallbackFn, this) { JNIEnv * env = JniReferences::GetInstance().GetEnvForCurrentThread(); @@ -2531,8 +2531,8 @@ CHIPOperationalCredentialsClusterCertificateChainResponseCallback(jobject javaCa } } -CHIPOperationalCredentialsClusterCertificateChainResponseCallback::~ -CHIPOperationalCredentialsClusterCertificateChainResponseCallback() +CHIPOperationalCredentialsClusterCertificateChainResponseCallback:: + ~CHIPOperationalCredentialsClusterCertificateChainResponseCallback() { JNIEnv * env = JniReferences::GetInstance().GetEnvForCurrentThread(); if (env == nullptr) @@ -2910,7 +2910,7 @@ void CHIPGroupKeyManagementClusterKeySetReadResponseCallback::CallbackFn( env->CallVoidMethod(javaCallbackRef, javaMethod, GroupKeySet); } CHIPGroupKeyManagementClusterKeySetReadAllIndicesResponseCallback:: -CHIPGroupKeyManagementClusterKeySetReadAllIndicesResponseCallback(jobject javaCallback) : + CHIPGroupKeyManagementClusterKeySetReadAllIndicesResponseCallback(jobject javaCallback) : Callback::Callback(CallbackFn, this) { JNIEnv * env = JniReferences::GetInstance().GetEnvForCurrentThread(); @@ -2927,8 +2927,8 @@ CHIPGroupKeyManagementClusterKeySetReadAllIndicesResponseCallback(jobject javaCa } } -CHIPGroupKeyManagementClusterKeySetReadAllIndicesResponseCallback::~ -CHIPGroupKeyManagementClusterKeySetReadAllIndicesResponseCallback() +CHIPGroupKeyManagementClusterKeySetReadAllIndicesResponseCallback:: + ~CHIPGroupKeyManagementClusterKeySetReadAllIndicesResponseCallback() { JNIEnv * env = JniReferences::GetInstance().GetEnvForCurrentThread(); if (env == nullptr) @@ -3106,7 +3106,7 @@ void CHIPIcdManagementClusterStayActiveResponseCallback::CallbackFn( env->CallVoidMethod(javaCallbackRef, javaMethod, PromisedActiveDuration); } CHIPOvenCavityOperationalStateClusterOperationalCommandResponseCallback:: -CHIPOvenCavityOperationalStateClusterOperationalCommandResponseCallback(jobject javaCallback) : + CHIPOvenCavityOperationalStateClusterOperationalCommandResponseCallback(jobject javaCallback) : Callback::Callback(CallbackFn, this) { JNIEnv * env = JniReferences::GetInstance().GetEnvForCurrentThread(); @@ -3123,8 +3123,8 @@ CHIPOvenCavityOperationalStateClusterOperationalCommandResponseCallback(jobject } } -CHIPOvenCavityOperationalStateClusterOperationalCommandResponseCallback::~ -CHIPOvenCavityOperationalStateClusterOperationalCommandResponseCallback() +CHIPOvenCavityOperationalStateClusterOperationalCommandResponseCallback:: + ~CHIPOvenCavityOperationalStateClusterOperationalCommandResponseCallback() { JNIEnv * env = JniReferences::GetInstance().GetEnvForCurrentThread(); if (env == nullptr) @@ -3367,7 +3367,7 @@ void CHIPLaundryWasherModeClusterChangeToModeResponseCallback::CallbackFn( env->CallVoidMethod(javaCallbackRef, javaMethod, Status, StatusText); } CHIPRefrigeratorAndTemperatureControlledCabinetModeClusterChangeToModeResponseCallback:: -CHIPRefrigeratorAndTemperatureControlledCabinetModeClusterChangeToModeResponseCallback(jobject javaCallback) : + CHIPRefrigeratorAndTemperatureControlledCabinetModeClusterChangeToModeResponseCallback(jobject javaCallback) : Callback::Callback(CallbackFn, this) { JNIEnv * env = JniReferences::GetInstance().GetEnvForCurrentThread(); @@ -3384,8 +3384,8 @@ CHIPRefrigeratorAndTemperatureControlledCabinetModeClusterChangeToModeResponseCa } } -CHIPRefrigeratorAndTemperatureControlledCabinetModeClusterChangeToModeResponseCallback::~ -CHIPRefrigeratorAndTemperatureControlledCabinetModeClusterChangeToModeResponseCallback() +CHIPRefrigeratorAndTemperatureControlledCabinetModeClusterChangeToModeResponseCallback:: + ~CHIPRefrigeratorAndTemperatureControlledCabinetModeClusterChangeToModeResponseCallback() { JNIEnv * env = JniReferences::GetInstance().GetEnvForCurrentThread(); if (env == nullptr) @@ -3796,8 +3796,8 @@ CHIPRvcOperationalStateClusterOperationalCommandResponseCallback::CHIPRvcOperati } } -CHIPRvcOperationalStateClusterOperationalCommandResponseCallback::~ -CHIPRvcOperationalStateClusterOperationalCommandResponseCallback() +CHIPRvcOperationalStateClusterOperationalCommandResponseCallback:: + ~CHIPRvcOperationalStateClusterOperationalCommandResponseCallback() { JNIEnv * env = JniReferences::GetInstance().GetEnvForCurrentThread(); if (env == nullptr) @@ -6331,7 +6331,7 @@ void CHIPContentAppObserverClusterContentAppMessageResponseCallback::CallbackFn( env->CallVoidMethod(javaCallbackRef, javaMethod, Status, Data, EncodingHint); } CHIPElectricalMeasurementClusterGetProfileInfoResponseCommandCallback:: -CHIPElectricalMeasurementClusterGetProfileInfoResponseCommandCallback(jobject javaCallback) : + CHIPElectricalMeasurementClusterGetProfileInfoResponseCommandCallback(jobject javaCallback) : Callback::Callback(CallbackFn, this) { JNIEnv * env = JniReferences::GetInstance().GetEnvForCurrentThread(); @@ -6348,8 +6348,8 @@ CHIPElectricalMeasurementClusterGetProfileInfoResponseCommandCallback(jobject ja } } -CHIPElectricalMeasurementClusterGetProfileInfoResponseCommandCallback::~ -CHIPElectricalMeasurementClusterGetProfileInfoResponseCommandCallback() +CHIPElectricalMeasurementClusterGetProfileInfoResponseCommandCallback:: + ~CHIPElectricalMeasurementClusterGetProfileInfoResponseCommandCallback() { JNIEnv * env = JniReferences::GetInstance().GetEnvForCurrentThread(); if (env == nullptr) @@ -6426,7 +6426,7 @@ void CHIPElectricalMeasurementClusterGetProfileInfoResponseCommandCallback::Call env->CallVoidMethod(javaCallbackRef, javaMethod, profileCount, profileIntervalPeriod, maxNumberOfIntervals, listOfAttributes); } CHIPElectricalMeasurementClusterGetMeasurementProfileResponseCommandCallback:: -CHIPElectricalMeasurementClusterGetMeasurementProfileResponseCommandCallback(jobject javaCallback) : + CHIPElectricalMeasurementClusterGetMeasurementProfileResponseCommandCallback(jobject javaCallback) : Callback::Callback(CallbackFn, this) { JNIEnv * env = JniReferences::GetInstance().GetEnvForCurrentThread(); @@ -6443,8 +6443,8 @@ CHIPElectricalMeasurementClusterGetMeasurementProfileResponseCommandCallback(job } } -CHIPElectricalMeasurementClusterGetMeasurementProfileResponseCommandCallback::~ -CHIPElectricalMeasurementClusterGetMeasurementProfileResponseCommandCallback() +CHIPElectricalMeasurementClusterGetMeasurementProfileResponseCommandCallback:: + ~CHIPElectricalMeasurementClusterGetMeasurementProfileResponseCommandCallback() { JNIEnv * env = JniReferences::GetInstance().GetEnvForCurrentThread(); if (env == nullptr) @@ -7372,7 +7372,7 @@ void CHIPUnitTestingClusterTestNullableOptionalResponseCallback::CallbackFn( env->CallVoidMethod(javaCallbackRef, javaMethod, wasPresent, wasNull, value, originalValue); } CHIPUnitTestingClusterTestComplexNullableOptionalResponseCallback:: -CHIPUnitTestingClusterTestComplexNullableOptionalResponseCallback(jobject javaCallback) : + CHIPUnitTestingClusterTestComplexNullableOptionalResponseCallback(jobject javaCallback) : Callback::Callback(CallbackFn, this) { JNIEnv * env = JniReferences::GetInstance().GetEnvForCurrentThread(); @@ -7389,8 +7389,8 @@ CHIPUnitTestingClusterTestComplexNullableOptionalResponseCallback(jobject javaCa } } -CHIPUnitTestingClusterTestComplexNullableOptionalResponseCallback::~ -CHIPUnitTestingClusterTestComplexNullableOptionalResponseCallback() +CHIPUnitTestingClusterTestComplexNullableOptionalResponseCallback:: + ~CHIPUnitTestingClusterTestComplexNullableOptionalResponseCallback() { JNIEnv * env = JniReferences::GetInstance().GetEnvForCurrentThread(); if (env == nullptr) @@ -8267,7 +8267,7 @@ void CHIPUnitTestingClusterTestEmitTestEventResponseCallback::CallbackFn( env->CallVoidMethod(javaCallbackRef, javaMethod, value); } CHIPUnitTestingClusterTestEmitTestFabricScopedEventResponseCallback:: -CHIPUnitTestingClusterTestEmitTestFabricScopedEventResponseCallback(jobject javaCallback) : + CHIPUnitTestingClusterTestEmitTestFabricScopedEventResponseCallback(jobject javaCallback) : Callback::Callback(CallbackFn, this) { JNIEnv * env = JniReferences::GetInstance().GetEnvForCurrentThread(); @@ -8284,8 +8284,8 @@ CHIPUnitTestingClusterTestEmitTestFabricScopedEventResponseCallback(jobject java } } -CHIPUnitTestingClusterTestEmitTestFabricScopedEventResponseCallback::~ -CHIPUnitTestingClusterTestEmitTestFabricScopedEventResponseCallback() +CHIPUnitTestingClusterTestEmitTestFabricScopedEventResponseCallback:: + ~CHIPUnitTestingClusterTestEmitTestFabricScopedEventResponseCallback() { JNIEnv * env = JniReferences::GetInstance().GetEnvForCurrentThread(); if (env == nullptr) diff --git a/src/controller/java/zap-generated/CHIPReadCallbacks.cpp b/src/controller/java/zap-generated/CHIPReadCallbacks.cpp index 5a72bbb8f90669..9b9c6dbf5b84a8 100644 --- a/src/controller/java/zap-generated/CHIPReadCallbacks.cpp +++ b/src/controller/java/zap-generated/CHIPReadCallbacks.cpp @@ -1416,7 +1416,7 @@ void CHIPOnOffAttributeListAttributeCallback::CallbackFn(void * context, } CHIPOnOffSwitchConfigurationGeneratedCommandListAttributeCallback:: -CHIPOnOffSwitchConfigurationGeneratedCommandListAttributeCallback(jobject javaCallback, bool keepAlive) : + CHIPOnOffSwitchConfigurationGeneratedCommandListAttributeCallback(jobject javaCallback, bool keepAlive) : chip::Callback::Callback(CallbackFn, this), keepAlive(keepAlive) { @@ -1434,8 +1434,8 @@ CHIPOnOffSwitchConfigurationGeneratedCommandListAttributeCallback(jobject javaCa } } -CHIPOnOffSwitchConfigurationGeneratedCommandListAttributeCallback::~ -CHIPOnOffSwitchConfigurationGeneratedCommandListAttributeCallback() +CHIPOnOffSwitchConfigurationGeneratedCommandListAttributeCallback:: + ~CHIPOnOffSwitchConfigurationGeneratedCommandListAttributeCallback() { JNIEnv * env = chip::JniReferences::GetInstance().GetEnvForCurrentThread(); if (env == nullptr) @@ -1507,8 +1507,8 @@ CHIPOnOffSwitchConfigurationAcceptedCommandListAttributeCallback::CHIPOnOffSwitc } } -CHIPOnOffSwitchConfigurationAcceptedCommandListAttributeCallback::~ -CHIPOnOffSwitchConfigurationAcceptedCommandListAttributeCallback() +CHIPOnOffSwitchConfigurationAcceptedCommandListAttributeCallback:: + ~CHIPOnOffSwitchConfigurationAcceptedCommandListAttributeCallback() { JNIEnv * env = chip::JniReferences::GetInstance().GetEnvForCurrentThread(); if (env == nullptr) @@ -5528,7 +5528,7 @@ void CHIPBasicInformationAttributeListAttributeCallback::CallbackFn( } CHIPOtaSoftwareUpdateProviderGeneratedCommandListAttributeCallback:: -CHIPOtaSoftwareUpdateProviderGeneratedCommandListAttributeCallback(jobject javaCallback, bool keepAlive) : + CHIPOtaSoftwareUpdateProviderGeneratedCommandListAttributeCallback(jobject javaCallback, bool keepAlive) : chip::Callback::Callback(CallbackFn, this), keepAlive(keepAlive) { @@ -5546,8 +5546,8 @@ CHIPOtaSoftwareUpdateProviderGeneratedCommandListAttributeCallback(jobject javaC } } -CHIPOtaSoftwareUpdateProviderGeneratedCommandListAttributeCallback::~ -CHIPOtaSoftwareUpdateProviderGeneratedCommandListAttributeCallback() +CHIPOtaSoftwareUpdateProviderGeneratedCommandListAttributeCallback:: + ~CHIPOtaSoftwareUpdateProviderGeneratedCommandListAttributeCallback() { JNIEnv * env = chip::JniReferences::GetInstance().GetEnvForCurrentThread(); if (env == nullptr) @@ -5601,7 +5601,7 @@ void CHIPOtaSoftwareUpdateProviderGeneratedCommandListAttributeCallback::Callbac } CHIPOtaSoftwareUpdateProviderAcceptedCommandListAttributeCallback:: -CHIPOtaSoftwareUpdateProviderAcceptedCommandListAttributeCallback(jobject javaCallback, bool keepAlive) : + CHIPOtaSoftwareUpdateProviderAcceptedCommandListAttributeCallback(jobject javaCallback, bool keepAlive) : chip::Callback::Callback(CallbackFn, this), keepAlive(keepAlive) { @@ -5619,8 +5619,8 @@ CHIPOtaSoftwareUpdateProviderAcceptedCommandListAttributeCallback(jobject javaCa } } -CHIPOtaSoftwareUpdateProviderAcceptedCommandListAttributeCallback::~ -CHIPOtaSoftwareUpdateProviderAcceptedCommandListAttributeCallback() +CHIPOtaSoftwareUpdateProviderAcceptedCommandListAttributeCallback:: + ~CHIPOtaSoftwareUpdateProviderAcceptedCommandListAttributeCallback() { JNIEnv * env = chip::JniReferences::GetInstance().GetEnvForCurrentThread(); if (env == nullptr) @@ -5818,7 +5818,7 @@ void CHIPOtaSoftwareUpdateProviderAttributeListAttributeCallback::CallbackFn( } CHIPOtaSoftwareUpdateRequestorDefaultOTAProvidersAttributeCallback:: -CHIPOtaSoftwareUpdateRequestorDefaultOTAProvidersAttributeCallback(jobject javaCallback, bool keepAlive) : + CHIPOtaSoftwareUpdateRequestorDefaultOTAProvidersAttributeCallback(jobject javaCallback, bool keepAlive) : chip::Callback::Callback(CallbackFn, this), keepAlive(keepAlive) { @@ -5836,8 +5836,8 @@ CHIPOtaSoftwareUpdateRequestorDefaultOTAProvidersAttributeCallback(jobject javaC } } -CHIPOtaSoftwareUpdateRequestorDefaultOTAProvidersAttributeCallback::~ -CHIPOtaSoftwareUpdateRequestorDefaultOTAProvidersAttributeCallback() +CHIPOtaSoftwareUpdateRequestorDefaultOTAProvidersAttributeCallback:: + ~CHIPOtaSoftwareUpdateRequestorDefaultOTAProvidersAttributeCallback() { JNIEnv * env = chip::JniReferences::GetInstance().GetEnvForCurrentThread(); if (env == nullptr) @@ -5929,7 +5929,7 @@ void CHIPOtaSoftwareUpdateRequestorDefaultOTAProvidersAttributeCallback::Callbac } CHIPOtaSoftwareUpdateRequestorUpdateStateProgressAttributeCallback:: -CHIPOtaSoftwareUpdateRequestorUpdateStateProgressAttributeCallback(jobject javaCallback, bool keepAlive) : + CHIPOtaSoftwareUpdateRequestorUpdateStateProgressAttributeCallback(jobject javaCallback, bool keepAlive) : chip::Callback::Callback(CallbackFn, this), keepAlive(keepAlive) { @@ -5947,8 +5947,8 @@ CHIPOtaSoftwareUpdateRequestorUpdateStateProgressAttributeCallback(jobject javaC } } -CHIPOtaSoftwareUpdateRequestorUpdateStateProgressAttributeCallback::~ -CHIPOtaSoftwareUpdateRequestorUpdateStateProgressAttributeCallback() +CHIPOtaSoftwareUpdateRequestorUpdateStateProgressAttributeCallback:: + ~CHIPOtaSoftwareUpdateRequestorUpdateStateProgressAttributeCallback() { JNIEnv * env = chip::JniReferences::GetInstance().GetEnvForCurrentThread(); if (env == nullptr) @@ -5998,7 +5998,7 @@ void CHIPOtaSoftwareUpdateRequestorUpdateStateProgressAttributeCallback::Callbac } CHIPOtaSoftwareUpdateRequestorGeneratedCommandListAttributeCallback:: -CHIPOtaSoftwareUpdateRequestorGeneratedCommandListAttributeCallback(jobject javaCallback, bool keepAlive) : + CHIPOtaSoftwareUpdateRequestorGeneratedCommandListAttributeCallback(jobject javaCallback, bool keepAlive) : chip::Callback::Callback(CallbackFn, this), keepAlive(keepAlive) { @@ -6016,8 +6016,8 @@ CHIPOtaSoftwareUpdateRequestorGeneratedCommandListAttributeCallback(jobject java } } -CHIPOtaSoftwareUpdateRequestorGeneratedCommandListAttributeCallback::~ -CHIPOtaSoftwareUpdateRequestorGeneratedCommandListAttributeCallback() +CHIPOtaSoftwareUpdateRequestorGeneratedCommandListAttributeCallback:: + ~CHIPOtaSoftwareUpdateRequestorGeneratedCommandListAttributeCallback() { JNIEnv * env = chip::JniReferences::GetInstance().GetEnvForCurrentThread(); if (env == nullptr) @@ -6071,7 +6071,7 @@ void CHIPOtaSoftwareUpdateRequestorGeneratedCommandListAttributeCallback::Callba } CHIPOtaSoftwareUpdateRequestorAcceptedCommandListAttributeCallback:: -CHIPOtaSoftwareUpdateRequestorAcceptedCommandListAttributeCallback(jobject javaCallback, bool keepAlive) : + CHIPOtaSoftwareUpdateRequestorAcceptedCommandListAttributeCallback(jobject javaCallback, bool keepAlive) : chip::Callback::Callback(CallbackFn, this), keepAlive(keepAlive) { @@ -6089,8 +6089,8 @@ CHIPOtaSoftwareUpdateRequestorAcceptedCommandListAttributeCallback(jobject javaC } } -CHIPOtaSoftwareUpdateRequestorAcceptedCommandListAttributeCallback::~ -CHIPOtaSoftwareUpdateRequestorAcceptedCommandListAttributeCallback() +CHIPOtaSoftwareUpdateRequestorAcceptedCommandListAttributeCallback:: + ~CHIPOtaSoftwareUpdateRequestorAcceptedCommandListAttributeCallback() { JNIEnv * env = chip::JniReferences::GetInstance().GetEnvForCurrentThread(); if (env == nullptr) @@ -6356,7 +6356,7 @@ void CHIPLocalizationConfigurationSupportedLocalesAttributeCallback::CallbackFn( } CHIPLocalizationConfigurationGeneratedCommandListAttributeCallback:: -CHIPLocalizationConfigurationGeneratedCommandListAttributeCallback(jobject javaCallback, bool keepAlive) : + CHIPLocalizationConfigurationGeneratedCommandListAttributeCallback(jobject javaCallback, bool keepAlive) : chip::Callback::Callback(CallbackFn, this), keepAlive(keepAlive) { @@ -6374,8 +6374,8 @@ CHIPLocalizationConfigurationGeneratedCommandListAttributeCallback(jobject javaC } } -CHIPLocalizationConfigurationGeneratedCommandListAttributeCallback::~ -CHIPLocalizationConfigurationGeneratedCommandListAttributeCallback() +CHIPLocalizationConfigurationGeneratedCommandListAttributeCallback:: + ~CHIPLocalizationConfigurationGeneratedCommandListAttributeCallback() { JNIEnv * env = chip::JniReferences::GetInstance().GetEnvForCurrentThread(); if (env == nullptr) @@ -6429,7 +6429,7 @@ void CHIPLocalizationConfigurationGeneratedCommandListAttributeCallback::Callbac } CHIPLocalizationConfigurationAcceptedCommandListAttributeCallback:: -CHIPLocalizationConfigurationAcceptedCommandListAttributeCallback(jobject javaCallback, bool keepAlive) : + CHIPLocalizationConfigurationAcceptedCommandListAttributeCallback(jobject javaCallback, bool keepAlive) : chip::Callback::Callback(CallbackFn, this), keepAlive(keepAlive) { @@ -6447,8 +6447,8 @@ CHIPLocalizationConfigurationAcceptedCommandListAttributeCallback(jobject javaCa } } -CHIPLocalizationConfigurationAcceptedCommandListAttributeCallback::~ -CHIPLocalizationConfigurationAcceptedCommandListAttributeCallback() +CHIPLocalizationConfigurationAcceptedCommandListAttributeCallback:: + ~CHIPLocalizationConfigurationAcceptedCommandListAttributeCallback() { JNIEnv * env = chip::JniReferences::GetInstance().GetEnvForCurrentThread(); if (env == nullptr) @@ -6646,7 +6646,7 @@ void CHIPLocalizationConfigurationAttributeListAttributeCallback::CallbackFn( } CHIPTimeFormatLocalizationSupportedCalendarTypesAttributeCallback:: -CHIPTimeFormatLocalizationSupportedCalendarTypesAttributeCallback(jobject javaCallback, bool keepAlive) : + CHIPTimeFormatLocalizationSupportedCalendarTypesAttributeCallback(jobject javaCallback, bool keepAlive) : chip::Callback::Callback(CallbackFn, this), keepAlive(keepAlive) { @@ -6664,8 +6664,8 @@ CHIPTimeFormatLocalizationSupportedCalendarTypesAttributeCallback(jobject javaCa } } -CHIPTimeFormatLocalizationSupportedCalendarTypesAttributeCallback::~ -CHIPTimeFormatLocalizationSupportedCalendarTypesAttributeCallback() +CHIPTimeFormatLocalizationSupportedCalendarTypesAttributeCallback:: + ~CHIPTimeFormatLocalizationSupportedCalendarTypesAttributeCallback() { JNIEnv * env = chip::JniReferences::GetInstance().GetEnvForCurrentThread(); if (env == nullptr) @@ -7365,7 +7365,7 @@ void CHIPPowerSourceConfigurationSourcesAttributeCallback::CallbackFn( } CHIPPowerSourceConfigurationGeneratedCommandListAttributeCallback:: -CHIPPowerSourceConfigurationGeneratedCommandListAttributeCallback(jobject javaCallback, bool keepAlive) : + CHIPPowerSourceConfigurationGeneratedCommandListAttributeCallback(jobject javaCallback, bool keepAlive) : chip::Callback::Callback(CallbackFn, this), keepAlive(keepAlive) { @@ -7383,8 +7383,8 @@ CHIPPowerSourceConfigurationGeneratedCommandListAttributeCallback(jobject javaCa } } -CHIPPowerSourceConfigurationGeneratedCommandListAttributeCallback::~ -CHIPPowerSourceConfigurationGeneratedCommandListAttributeCallback() +CHIPPowerSourceConfigurationGeneratedCommandListAttributeCallback:: + ~CHIPPowerSourceConfigurationGeneratedCommandListAttributeCallback() { JNIEnv * env = chip::JniReferences::GetInstance().GetEnvForCurrentThread(); if (env == nullptr) @@ -7456,8 +7456,8 @@ CHIPPowerSourceConfigurationAcceptedCommandListAttributeCallback::CHIPPowerSourc } } -CHIPPowerSourceConfigurationAcceptedCommandListAttributeCallback::~ -CHIPPowerSourceConfigurationAcceptedCommandListAttributeCallback() +CHIPPowerSourceConfigurationAcceptedCommandListAttributeCallback:: + ~CHIPPowerSourceConfigurationAcceptedCommandListAttributeCallback() { JNIEnv * env = chip::JniReferences::GetInstance().GetEnvForCurrentThread(); if (env == nullptr) @@ -12543,7 +12543,7 @@ void CHIPThreadNetworkDiagnosticsChannelPage0MaskAttributeCallback::CallbackFn( } CHIPThreadNetworkDiagnosticsActiveNetworkFaultsListAttributeCallback:: -CHIPThreadNetworkDiagnosticsActiveNetworkFaultsListAttributeCallback(jobject javaCallback, bool keepAlive) : + CHIPThreadNetworkDiagnosticsActiveNetworkFaultsListAttributeCallback(jobject javaCallback, bool keepAlive) : chip::Callback::Callback(CallbackFn, this), keepAlive(keepAlive) { @@ -12561,8 +12561,8 @@ CHIPThreadNetworkDiagnosticsActiveNetworkFaultsListAttributeCallback(jobject jav } } -CHIPThreadNetworkDiagnosticsActiveNetworkFaultsListAttributeCallback::~ -CHIPThreadNetworkDiagnosticsActiveNetworkFaultsListAttributeCallback() +CHIPThreadNetworkDiagnosticsActiveNetworkFaultsListAttributeCallback:: + ~CHIPThreadNetworkDiagnosticsActiveNetworkFaultsListAttributeCallback() { JNIEnv * env = chip::JniReferences::GetInstance().GetEnvForCurrentThread(); if (env == nullptr) @@ -12617,7 +12617,7 @@ void CHIPThreadNetworkDiagnosticsActiveNetworkFaultsListAttributeCallback::Callb } CHIPThreadNetworkDiagnosticsGeneratedCommandListAttributeCallback:: -CHIPThreadNetworkDiagnosticsGeneratedCommandListAttributeCallback(jobject javaCallback, bool keepAlive) : + CHIPThreadNetworkDiagnosticsGeneratedCommandListAttributeCallback(jobject javaCallback, bool keepAlive) : chip::Callback::Callback(CallbackFn, this), keepAlive(keepAlive) { @@ -12635,8 +12635,8 @@ CHIPThreadNetworkDiagnosticsGeneratedCommandListAttributeCallback(jobject javaCa } } -CHIPThreadNetworkDiagnosticsGeneratedCommandListAttributeCallback::~ -CHIPThreadNetworkDiagnosticsGeneratedCommandListAttributeCallback() +CHIPThreadNetworkDiagnosticsGeneratedCommandListAttributeCallback:: + ~CHIPThreadNetworkDiagnosticsGeneratedCommandListAttributeCallback() { JNIEnv * env = chip::JniReferences::GetInstance().GetEnvForCurrentThread(); if (env == nullptr) @@ -12708,8 +12708,8 @@ CHIPThreadNetworkDiagnosticsAcceptedCommandListAttributeCallback::CHIPThreadNetw } } -CHIPThreadNetworkDiagnosticsAcceptedCommandListAttributeCallback::~ -CHIPThreadNetworkDiagnosticsAcceptedCommandListAttributeCallback() +CHIPThreadNetworkDiagnosticsAcceptedCommandListAttributeCallback:: + ~CHIPThreadNetworkDiagnosticsAcceptedCommandListAttributeCallback() { JNIEnv * env = chip::JniReferences::GetInstance().GetEnvForCurrentThread(); if (env == nullptr) @@ -13380,7 +13380,7 @@ void CHIPWiFiNetworkDiagnosticsBeaconRxCountAttributeCallback::CallbackFn(void * } CHIPWiFiNetworkDiagnosticsPacketMulticastRxCountAttributeCallback:: -CHIPWiFiNetworkDiagnosticsPacketMulticastRxCountAttributeCallback(jobject javaCallback, bool keepAlive) : + CHIPWiFiNetworkDiagnosticsPacketMulticastRxCountAttributeCallback(jobject javaCallback, bool keepAlive) : chip::Callback::Callback(CallbackFn, this), keepAlive(keepAlive) { @@ -13398,8 +13398,8 @@ CHIPWiFiNetworkDiagnosticsPacketMulticastRxCountAttributeCallback(jobject javaCa } } -CHIPWiFiNetworkDiagnosticsPacketMulticastRxCountAttributeCallback::~ -CHIPWiFiNetworkDiagnosticsPacketMulticastRxCountAttributeCallback() +CHIPWiFiNetworkDiagnosticsPacketMulticastRxCountAttributeCallback:: + ~CHIPWiFiNetworkDiagnosticsPacketMulticastRxCountAttributeCallback() { JNIEnv * env = chip::JniReferences::GetInstance().GetEnvForCurrentThread(); if (env == nullptr) @@ -13449,7 +13449,7 @@ void CHIPWiFiNetworkDiagnosticsPacketMulticastRxCountAttributeCallback::Callback } CHIPWiFiNetworkDiagnosticsPacketMulticastTxCountAttributeCallback:: -CHIPWiFiNetworkDiagnosticsPacketMulticastTxCountAttributeCallback(jobject javaCallback, bool keepAlive) : + CHIPWiFiNetworkDiagnosticsPacketMulticastTxCountAttributeCallback(jobject javaCallback, bool keepAlive) : chip::Callback::Callback(CallbackFn, this), keepAlive(keepAlive) { @@ -13467,8 +13467,8 @@ CHIPWiFiNetworkDiagnosticsPacketMulticastTxCountAttributeCallback(jobject javaCa } } -CHIPWiFiNetworkDiagnosticsPacketMulticastTxCountAttributeCallback::~ -CHIPWiFiNetworkDiagnosticsPacketMulticastTxCountAttributeCallback() +CHIPWiFiNetworkDiagnosticsPacketMulticastTxCountAttributeCallback:: + ~CHIPWiFiNetworkDiagnosticsPacketMulticastTxCountAttributeCallback() { JNIEnv * env = chip::JniReferences::GetInstance().GetEnvForCurrentThread(); if (env == nullptr) @@ -14282,7 +14282,7 @@ void CHIPEthernetNetworkDiagnosticsCarrierDetectAttributeCallback::CallbackFn(vo } CHIPEthernetNetworkDiagnosticsGeneratedCommandListAttributeCallback:: -CHIPEthernetNetworkDiagnosticsGeneratedCommandListAttributeCallback(jobject javaCallback, bool keepAlive) : + CHIPEthernetNetworkDiagnosticsGeneratedCommandListAttributeCallback(jobject javaCallback, bool keepAlive) : chip::Callback::Callback(CallbackFn, this), keepAlive(keepAlive) { @@ -14300,8 +14300,8 @@ CHIPEthernetNetworkDiagnosticsGeneratedCommandListAttributeCallback(jobject java } } -CHIPEthernetNetworkDiagnosticsGeneratedCommandListAttributeCallback::~ -CHIPEthernetNetworkDiagnosticsGeneratedCommandListAttributeCallback() +CHIPEthernetNetworkDiagnosticsGeneratedCommandListAttributeCallback:: + ~CHIPEthernetNetworkDiagnosticsGeneratedCommandListAttributeCallback() { JNIEnv * env = chip::JniReferences::GetInstance().GetEnvForCurrentThread(); if (env == nullptr) @@ -14355,7 +14355,7 @@ void CHIPEthernetNetworkDiagnosticsGeneratedCommandListAttributeCallback::Callba } CHIPEthernetNetworkDiagnosticsAcceptedCommandListAttributeCallback:: -CHIPEthernetNetworkDiagnosticsAcceptedCommandListAttributeCallback(jobject javaCallback, bool keepAlive) : + CHIPEthernetNetworkDiagnosticsAcceptedCommandListAttributeCallback(jobject javaCallback, bool keepAlive) : chip::Callback::Callback(CallbackFn, this), keepAlive(keepAlive) { @@ -14373,8 +14373,8 @@ CHIPEthernetNetworkDiagnosticsAcceptedCommandListAttributeCallback(jobject javaC } } -CHIPEthernetNetworkDiagnosticsAcceptedCommandListAttributeCallback::~ -CHIPEthernetNetworkDiagnosticsAcceptedCommandListAttributeCallback() +CHIPEthernetNetworkDiagnosticsAcceptedCommandListAttributeCallback:: + ~CHIPEthernetNetworkDiagnosticsAcceptedCommandListAttributeCallback() { JNIEnv * env = chip::JniReferences::GetInstance().GetEnvForCurrentThread(); if (env == nullptr) @@ -15284,7 +15284,7 @@ void CHIPTimeSynchronizationAttributeListAttributeCallback::CallbackFn( } CHIPBridgedDeviceBasicInformationGeneratedCommandListAttributeCallback:: -CHIPBridgedDeviceBasicInformationGeneratedCommandListAttributeCallback(jobject javaCallback, bool keepAlive) : + CHIPBridgedDeviceBasicInformationGeneratedCommandListAttributeCallback(jobject javaCallback, bool keepAlive) : chip::Callback::Callback(CallbackFn, this), keepAlive(keepAlive) { @@ -15302,8 +15302,8 @@ CHIPBridgedDeviceBasicInformationGeneratedCommandListAttributeCallback(jobject j } } -CHIPBridgedDeviceBasicInformationGeneratedCommandListAttributeCallback::~ -CHIPBridgedDeviceBasicInformationGeneratedCommandListAttributeCallback() +CHIPBridgedDeviceBasicInformationGeneratedCommandListAttributeCallback:: + ~CHIPBridgedDeviceBasicInformationGeneratedCommandListAttributeCallback() { JNIEnv * env = chip::JniReferences::GetInstance().GetEnvForCurrentThread(); if (env == nullptr) @@ -15357,7 +15357,7 @@ void CHIPBridgedDeviceBasicInformationGeneratedCommandListAttributeCallback::Cal } CHIPBridgedDeviceBasicInformationAcceptedCommandListAttributeCallback:: -CHIPBridgedDeviceBasicInformationAcceptedCommandListAttributeCallback(jobject javaCallback, bool keepAlive) : + CHIPBridgedDeviceBasicInformationAcceptedCommandListAttributeCallback(jobject javaCallback, bool keepAlive) : chip::Callback::Callback(CallbackFn, this), keepAlive(keepAlive) { @@ -15375,8 +15375,8 @@ CHIPBridgedDeviceBasicInformationAcceptedCommandListAttributeCallback(jobject ja } } -CHIPBridgedDeviceBasicInformationAcceptedCommandListAttributeCallback::~ -CHIPBridgedDeviceBasicInformationAcceptedCommandListAttributeCallback() +CHIPBridgedDeviceBasicInformationAcceptedCommandListAttributeCallback:: + ~CHIPBridgedDeviceBasicInformationAcceptedCommandListAttributeCallback() { JNIEnv * env = chip::JniReferences::GetInstance().GetEnvForCurrentThread(); if (env == nullptr) @@ -15992,7 +15992,7 @@ void CHIPAdministratorCommissioningAdminVendorIdAttributeCallback::CallbackFn( } CHIPAdministratorCommissioningGeneratedCommandListAttributeCallback:: -CHIPAdministratorCommissioningGeneratedCommandListAttributeCallback(jobject javaCallback, bool keepAlive) : + CHIPAdministratorCommissioningGeneratedCommandListAttributeCallback(jobject javaCallback, bool keepAlive) : chip::Callback::Callback(CallbackFn, this), keepAlive(keepAlive) { @@ -16010,8 +16010,8 @@ CHIPAdministratorCommissioningGeneratedCommandListAttributeCallback(jobject java } } -CHIPAdministratorCommissioningGeneratedCommandListAttributeCallback::~ -CHIPAdministratorCommissioningGeneratedCommandListAttributeCallback() +CHIPAdministratorCommissioningGeneratedCommandListAttributeCallback:: + ~CHIPAdministratorCommissioningGeneratedCommandListAttributeCallback() { JNIEnv * env = chip::JniReferences::GetInstance().GetEnvForCurrentThread(); if (env == nullptr) @@ -16065,7 +16065,7 @@ void CHIPAdministratorCommissioningGeneratedCommandListAttributeCallback::Callba } CHIPAdministratorCommissioningAcceptedCommandListAttributeCallback:: -CHIPAdministratorCommissioningAcceptedCommandListAttributeCallback(jobject javaCallback, bool keepAlive) : + CHIPAdministratorCommissioningAcceptedCommandListAttributeCallback(jobject javaCallback, bool keepAlive) : chip::Callback::Callback(CallbackFn, this), keepAlive(keepAlive) { @@ -16083,8 +16083,8 @@ CHIPAdministratorCommissioningAcceptedCommandListAttributeCallback(jobject javaC } } -CHIPAdministratorCommissioningAcceptedCommandListAttributeCallback::~ -CHIPAdministratorCommissioningAcceptedCommandListAttributeCallback() +CHIPAdministratorCommissioningAcceptedCommandListAttributeCallback:: + ~CHIPAdministratorCommissioningAcceptedCommandListAttributeCallback() { JNIEnv * env = chip::JniReferences::GetInstance().GetEnvForCurrentThread(); if (env == nullptr) @@ -16517,7 +16517,7 @@ void CHIPOperationalCredentialsFabricsAttributeCallback::CallbackFn( } CHIPOperationalCredentialsTrustedRootCertificatesAttributeCallback:: -CHIPOperationalCredentialsTrustedRootCertificatesAttributeCallback(jobject javaCallback, bool keepAlive) : + CHIPOperationalCredentialsTrustedRootCertificatesAttributeCallback(jobject javaCallback, bool keepAlive) : chip::Callback::Callback(CallbackFn, this), keepAlive(keepAlive) { @@ -16535,8 +16535,8 @@ CHIPOperationalCredentialsTrustedRootCertificatesAttributeCallback(jobject javaC } } -CHIPOperationalCredentialsTrustedRootCertificatesAttributeCallback::~ -CHIPOperationalCredentialsTrustedRootCertificatesAttributeCallback() +CHIPOperationalCredentialsTrustedRootCertificatesAttributeCallback:: + ~CHIPOperationalCredentialsTrustedRootCertificatesAttributeCallback() { JNIEnv * env = chip::JniReferences::GetInstance().GetEnvForCurrentThread(); if (env == nullptr) @@ -20166,7 +20166,7 @@ void CHIPOvenCavityOperationalStateCountdownTimeAttributeCallback::CallbackFn( } CHIPOvenCavityOperationalStateOperationalStateListAttributeCallback:: -CHIPOvenCavityOperationalStateOperationalStateListAttributeCallback(jobject javaCallback, bool keepAlive) : + CHIPOvenCavityOperationalStateOperationalStateListAttributeCallback(jobject javaCallback, bool keepAlive) : chip::Callback::Callback(CallbackFn, this), keepAlive(keepAlive) { @@ -20184,8 +20184,8 @@ CHIPOvenCavityOperationalStateOperationalStateListAttributeCallback(jobject java } } -CHIPOvenCavityOperationalStateOperationalStateListAttributeCallback::~ -CHIPOvenCavityOperationalStateOperationalStateListAttributeCallback() +CHIPOvenCavityOperationalStateOperationalStateListAttributeCallback:: + ~CHIPOvenCavityOperationalStateOperationalStateListAttributeCallback() { JNIEnv * env = chip::JniReferences::GetInstance().GetEnvForCurrentThread(); if (env == nullptr) @@ -20276,7 +20276,7 @@ void CHIPOvenCavityOperationalStateOperationalStateListAttributeCallback::Callba } CHIPOvenCavityOperationalStateGeneratedCommandListAttributeCallback:: -CHIPOvenCavityOperationalStateGeneratedCommandListAttributeCallback(jobject javaCallback, bool keepAlive) : + CHIPOvenCavityOperationalStateGeneratedCommandListAttributeCallback(jobject javaCallback, bool keepAlive) : chip::Callback::Callback(CallbackFn, this), keepAlive(keepAlive) { @@ -20294,8 +20294,8 @@ CHIPOvenCavityOperationalStateGeneratedCommandListAttributeCallback(jobject java } } -CHIPOvenCavityOperationalStateGeneratedCommandListAttributeCallback::~ -CHIPOvenCavityOperationalStateGeneratedCommandListAttributeCallback() +CHIPOvenCavityOperationalStateGeneratedCommandListAttributeCallback:: + ~CHIPOvenCavityOperationalStateGeneratedCommandListAttributeCallback() { JNIEnv * env = chip::JniReferences::GetInstance().GetEnvForCurrentThread(); if (env == nullptr) @@ -20349,7 +20349,7 @@ void CHIPOvenCavityOperationalStateGeneratedCommandListAttributeCallback::Callba } CHIPOvenCavityOperationalStateAcceptedCommandListAttributeCallback:: -CHIPOvenCavityOperationalStateAcceptedCommandListAttributeCallback(jobject javaCallback, bool keepAlive) : + CHIPOvenCavityOperationalStateAcceptedCommandListAttributeCallback(jobject javaCallback, bool keepAlive) : chip::Callback::Callback(CallbackFn, this), keepAlive(keepAlive) { @@ -20367,8 +20367,8 @@ CHIPOvenCavityOperationalStateAcceptedCommandListAttributeCallback(jobject javaC } } -CHIPOvenCavityOperationalStateAcceptedCommandListAttributeCallback::~ -CHIPOvenCavityOperationalStateAcceptedCommandListAttributeCallback() +CHIPOvenCavityOperationalStateAcceptedCommandListAttributeCallback:: + ~CHIPOvenCavityOperationalStateAcceptedCommandListAttributeCallback() { JNIEnv * env = chip::JniReferences::GetInstance().GetEnvForCurrentThread(); if (env == nullptr) @@ -22731,7 +22731,7 @@ void CHIPLaundryWasherModeAttributeListAttributeCallback::CallbackFn( } CHIPRefrigeratorAndTemperatureControlledCabinetModeSupportedModesAttributeCallback:: -CHIPRefrigeratorAndTemperatureControlledCabinetModeSupportedModesAttributeCallback(jobject javaCallback, bool keepAlive) : + CHIPRefrigeratorAndTemperatureControlledCabinetModeSupportedModesAttributeCallback(jobject javaCallback, bool keepAlive) : chip::Callback::Callback( CallbackFn, this), keepAlive(keepAlive) @@ -22750,8 +22750,8 @@ CHIPRefrigeratorAndTemperatureControlledCabinetModeSupportedModesAttributeCallba } } -CHIPRefrigeratorAndTemperatureControlledCabinetModeSupportedModesAttributeCallback::~ -CHIPRefrigeratorAndTemperatureControlledCabinetModeSupportedModesAttributeCallback() +CHIPRefrigeratorAndTemperatureControlledCabinetModeSupportedModesAttributeCallback:: + ~CHIPRefrigeratorAndTemperatureControlledCabinetModeSupportedModesAttributeCallback() { JNIEnv * env = chip::JniReferences::GetInstance().GetEnvForCurrentThread(); if (env == nullptr) @@ -22890,7 +22890,7 @@ void CHIPRefrigeratorAndTemperatureControlledCabinetModeSupportedModesAttributeC } CHIPRefrigeratorAndTemperatureControlledCabinetModeStartUpModeAttributeCallback:: -CHIPRefrigeratorAndTemperatureControlledCabinetModeStartUpModeAttributeCallback(jobject javaCallback, bool keepAlive) : + CHIPRefrigeratorAndTemperatureControlledCabinetModeStartUpModeAttributeCallback(jobject javaCallback, bool keepAlive) : chip::Callback::Callback(CallbackFn, this), keepAlive(keepAlive) @@ -22909,8 +22909,8 @@ CHIPRefrigeratorAndTemperatureControlledCabinetModeStartUpModeAttributeCallback( } } -CHIPRefrigeratorAndTemperatureControlledCabinetModeStartUpModeAttributeCallback::~ -CHIPRefrigeratorAndTemperatureControlledCabinetModeStartUpModeAttributeCallback() +CHIPRefrigeratorAndTemperatureControlledCabinetModeStartUpModeAttributeCallback:: + ~CHIPRefrigeratorAndTemperatureControlledCabinetModeStartUpModeAttributeCallback() { JNIEnv * env = chip::JniReferences::GetInstance().GetEnvForCurrentThread(); if (env == nullptr) @@ -22961,7 +22961,7 @@ void CHIPRefrigeratorAndTemperatureControlledCabinetModeStartUpModeAttributeCall } CHIPRefrigeratorAndTemperatureControlledCabinetModeOnModeAttributeCallback:: -CHIPRefrigeratorAndTemperatureControlledCabinetModeOnModeAttributeCallback(jobject javaCallback, bool keepAlive) : + CHIPRefrigeratorAndTemperatureControlledCabinetModeOnModeAttributeCallback(jobject javaCallback, bool keepAlive) : chip::Callback::Callback(CallbackFn, this), keepAlive(keepAlive) @@ -22980,8 +22980,8 @@ CHIPRefrigeratorAndTemperatureControlledCabinetModeOnModeAttributeCallback(jobje } } -CHIPRefrigeratorAndTemperatureControlledCabinetModeOnModeAttributeCallback::~ -CHIPRefrigeratorAndTemperatureControlledCabinetModeOnModeAttributeCallback() +CHIPRefrigeratorAndTemperatureControlledCabinetModeOnModeAttributeCallback:: + ~CHIPRefrigeratorAndTemperatureControlledCabinetModeOnModeAttributeCallback() { JNIEnv * env = chip::JniReferences::GetInstance().GetEnvForCurrentThread(); if (env == nullptr) @@ -23032,7 +23032,7 @@ void CHIPRefrigeratorAndTemperatureControlledCabinetModeOnModeAttributeCallback: } CHIPRefrigeratorAndTemperatureControlledCabinetModeGeneratedCommandListAttributeCallback:: -CHIPRefrigeratorAndTemperatureControlledCabinetModeGeneratedCommandListAttributeCallback(jobject javaCallback, bool keepAlive) : + CHIPRefrigeratorAndTemperatureControlledCabinetModeGeneratedCommandListAttributeCallback(jobject javaCallback, bool keepAlive) : chip::Callback::Callback( CallbackFn, this), keepAlive(keepAlive) @@ -23051,8 +23051,8 @@ CHIPRefrigeratorAndTemperatureControlledCabinetModeGeneratedCommandListAttribute } } -CHIPRefrigeratorAndTemperatureControlledCabinetModeGeneratedCommandListAttributeCallback::~ -CHIPRefrigeratorAndTemperatureControlledCabinetModeGeneratedCommandListAttributeCallback() +CHIPRefrigeratorAndTemperatureControlledCabinetModeGeneratedCommandListAttributeCallback:: + ~CHIPRefrigeratorAndTemperatureControlledCabinetModeGeneratedCommandListAttributeCallback() { JNIEnv * env = chip::JniReferences::GetInstance().GetEnvForCurrentThread(); if (env == nullptr) @@ -23109,7 +23109,7 @@ void CHIPRefrigeratorAndTemperatureControlledCabinetModeGeneratedCommandListAttr } CHIPRefrigeratorAndTemperatureControlledCabinetModeAcceptedCommandListAttributeCallback:: -CHIPRefrigeratorAndTemperatureControlledCabinetModeAcceptedCommandListAttributeCallback(jobject javaCallback, bool keepAlive) : + CHIPRefrigeratorAndTemperatureControlledCabinetModeAcceptedCommandListAttributeCallback(jobject javaCallback, bool keepAlive) : chip::Callback::Callback( CallbackFn, this), keepAlive(keepAlive) @@ -23128,8 +23128,8 @@ CHIPRefrigeratorAndTemperatureControlledCabinetModeAcceptedCommandListAttributeC } } -CHIPRefrigeratorAndTemperatureControlledCabinetModeAcceptedCommandListAttributeCallback::~ -CHIPRefrigeratorAndTemperatureControlledCabinetModeAcceptedCommandListAttributeCallback() +CHIPRefrigeratorAndTemperatureControlledCabinetModeAcceptedCommandListAttributeCallback:: + ~CHIPRefrigeratorAndTemperatureControlledCabinetModeAcceptedCommandListAttributeCallback() { JNIEnv * env = chip::JniReferences::GetInstance().GetEnvForCurrentThread(); if (env == nullptr) @@ -23186,7 +23186,7 @@ void CHIPRefrigeratorAndTemperatureControlledCabinetModeAcceptedCommandListAttri } CHIPRefrigeratorAndTemperatureControlledCabinetModeEventListAttributeCallback:: -CHIPRefrigeratorAndTemperatureControlledCabinetModeEventListAttributeCallback(jobject javaCallback, bool keepAlive) : + CHIPRefrigeratorAndTemperatureControlledCabinetModeEventListAttributeCallback(jobject javaCallback, bool keepAlive) : chip::Callback::Callback(CallbackFn, this), keepAlive(keepAlive) @@ -23205,8 +23205,8 @@ CHIPRefrigeratorAndTemperatureControlledCabinetModeEventListAttributeCallback(jo } } -CHIPRefrigeratorAndTemperatureControlledCabinetModeEventListAttributeCallback::~ -CHIPRefrigeratorAndTemperatureControlledCabinetModeEventListAttributeCallback() +CHIPRefrigeratorAndTemperatureControlledCabinetModeEventListAttributeCallback:: + ~CHIPRefrigeratorAndTemperatureControlledCabinetModeEventListAttributeCallback() { JNIEnv * env = chip::JniReferences::GetInstance().GetEnvForCurrentThread(); if (env == nullptr) @@ -23261,7 +23261,7 @@ void CHIPRefrigeratorAndTemperatureControlledCabinetModeEventListAttributeCallba } CHIPRefrigeratorAndTemperatureControlledCabinetModeAttributeListAttributeCallback:: -CHIPRefrigeratorAndTemperatureControlledCabinetModeAttributeListAttributeCallback(jobject javaCallback, bool keepAlive) : + CHIPRefrigeratorAndTemperatureControlledCabinetModeAttributeListAttributeCallback(jobject javaCallback, bool keepAlive) : chip::Callback::Callback( CallbackFn, this), keepAlive(keepAlive) @@ -23280,8 +23280,8 @@ CHIPRefrigeratorAndTemperatureControlledCabinetModeAttributeListAttributeCallbac } } -CHIPRefrigeratorAndTemperatureControlledCabinetModeAttributeListAttributeCallback::~ -CHIPRefrigeratorAndTemperatureControlledCabinetModeAttributeListAttributeCallback() +CHIPRefrigeratorAndTemperatureControlledCabinetModeAttributeListAttributeCallback:: + ~CHIPRefrigeratorAndTemperatureControlledCabinetModeAttributeListAttributeCallback() { JNIEnv * env = chip::JniReferences::GetInstance().GetEnvForCurrentThread(); if (env == nullptr) @@ -24820,7 +24820,7 @@ void CHIPRvcCleanModeAttributeListAttributeCallback::CallbackFn(void * context, } CHIPTemperatureControlSupportedTemperatureLevelsAttributeCallback:: -CHIPTemperatureControlSupportedTemperatureLevelsAttributeCallback(jobject javaCallback, bool keepAlive) : + CHIPTemperatureControlSupportedTemperatureLevelsAttributeCallback(jobject javaCallback, bool keepAlive) : chip::Callback::Callback(CallbackFn, this), keepAlive(keepAlive) { @@ -24838,8 +24838,8 @@ CHIPTemperatureControlSupportedTemperatureLevelsAttributeCallback(jobject javaCa } } -CHIPTemperatureControlSupportedTemperatureLevelsAttributeCallback::~ -CHIPTemperatureControlSupportedTemperatureLevelsAttributeCallback() +CHIPTemperatureControlSupportedTemperatureLevelsAttributeCallback:: + ~CHIPTemperatureControlSupportedTemperatureLevelsAttributeCallback() { JNIEnv * env = chip::JniReferences::GetInstance().GetEnvForCurrentThread(); if (env == nullptr) @@ -29261,7 +29261,7 @@ void CHIPHepaFilterMonitoringAttributeListAttributeCallback::CallbackFn( } CHIPActivatedCarbonFilterMonitoringLastChangedTimeAttributeCallback:: -CHIPActivatedCarbonFilterMonitoringLastChangedTimeAttributeCallback(jobject javaCallback, bool keepAlive) : + CHIPActivatedCarbonFilterMonitoringLastChangedTimeAttributeCallback(jobject javaCallback, bool keepAlive) : chip::Callback::Callback(CallbackFn, this), keepAlive(keepAlive) { @@ -29279,8 +29279,8 @@ CHIPActivatedCarbonFilterMonitoringLastChangedTimeAttributeCallback(jobject java } } -CHIPActivatedCarbonFilterMonitoringLastChangedTimeAttributeCallback::~ -CHIPActivatedCarbonFilterMonitoringLastChangedTimeAttributeCallback() +CHIPActivatedCarbonFilterMonitoringLastChangedTimeAttributeCallback:: + ~CHIPActivatedCarbonFilterMonitoringLastChangedTimeAttributeCallback() { JNIEnv * env = chip::JniReferences::GetInstance().GetEnvForCurrentThread(); if (env == nullptr) @@ -29330,7 +29330,7 @@ void CHIPActivatedCarbonFilterMonitoringLastChangedTimeAttributeCallback::Callba } CHIPActivatedCarbonFilterMonitoringReplacementProductListAttributeCallback:: -CHIPActivatedCarbonFilterMonitoringReplacementProductListAttributeCallback(jobject javaCallback, bool keepAlive) : + CHIPActivatedCarbonFilterMonitoringReplacementProductListAttributeCallback(jobject javaCallback, bool keepAlive) : chip::Callback::Callback(CallbackFn, this), keepAlive(keepAlive) @@ -29349,8 +29349,8 @@ CHIPActivatedCarbonFilterMonitoringReplacementProductListAttributeCallback(jobje } } -CHIPActivatedCarbonFilterMonitoringReplacementProductListAttributeCallback::~ -CHIPActivatedCarbonFilterMonitoringReplacementProductListAttributeCallback() +CHIPActivatedCarbonFilterMonitoringReplacementProductListAttributeCallback:: + ~CHIPActivatedCarbonFilterMonitoringReplacementProductListAttributeCallback() { JNIEnv * env = chip::JniReferences::GetInstance().GetEnvForCurrentThread(); if (env == nullptr) @@ -29433,7 +29433,7 @@ void CHIPActivatedCarbonFilterMonitoringReplacementProductListAttributeCallback: } CHIPActivatedCarbonFilterMonitoringGeneratedCommandListAttributeCallback:: -CHIPActivatedCarbonFilterMonitoringGeneratedCommandListAttributeCallback(jobject javaCallback, bool keepAlive) : + CHIPActivatedCarbonFilterMonitoringGeneratedCommandListAttributeCallback(jobject javaCallback, bool keepAlive) : chip::Callback::Callback(CallbackFn, this), keepAlive(keepAlive) { @@ -29451,8 +29451,8 @@ CHIPActivatedCarbonFilterMonitoringGeneratedCommandListAttributeCallback(jobject } } -CHIPActivatedCarbonFilterMonitoringGeneratedCommandListAttributeCallback::~ -CHIPActivatedCarbonFilterMonitoringGeneratedCommandListAttributeCallback() +CHIPActivatedCarbonFilterMonitoringGeneratedCommandListAttributeCallback:: + ~CHIPActivatedCarbonFilterMonitoringGeneratedCommandListAttributeCallback() { JNIEnv * env = chip::JniReferences::GetInstance().GetEnvForCurrentThread(); if (env == nullptr) @@ -29506,7 +29506,7 @@ void CHIPActivatedCarbonFilterMonitoringGeneratedCommandListAttributeCallback::C } CHIPActivatedCarbonFilterMonitoringAcceptedCommandListAttributeCallback:: -CHIPActivatedCarbonFilterMonitoringAcceptedCommandListAttributeCallback(jobject javaCallback, bool keepAlive) : + CHIPActivatedCarbonFilterMonitoringAcceptedCommandListAttributeCallback(jobject javaCallback, bool keepAlive) : chip::Callback::Callback(CallbackFn, this), keepAlive(keepAlive) { @@ -29524,8 +29524,8 @@ CHIPActivatedCarbonFilterMonitoringAcceptedCommandListAttributeCallback(jobject } } -CHIPActivatedCarbonFilterMonitoringAcceptedCommandListAttributeCallback::~ -CHIPActivatedCarbonFilterMonitoringAcceptedCommandListAttributeCallback() +CHIPActivatedCarbonFilterMonitoringAcceptedCommandListAttributeCallback:: + ~CHIPActivatedCarbonFilterMonitoringAcceptedCommandListAttributeCallback() { JNIEnv * env = chip::JniReferences::GetInstance().GetEnvForCurrentThread(); if (env == nullptr) @@ -29651,7 +29651,7 @@ void CHIPActivatedCarbonFilterMonitoringEventListAttributeCallback::CallbackFn( } CHIPActivatedCarbonFilterMonitoringAttributeListAttributeCallback:: -CHIPActivatedCarbonFilterMonitoringAttributeListAttributeCallback(jobject javaCallback, bool keepAlive) : + CHIPActivatedCarbonFilterMonitoringAttributeListAttributeCallback(jobject javaCallback, bool keepAlive) : chip::Callback::Callback(CallbackFn, this), keepAlive(keepAlive) { @@ -29669,8 +29669,8 @@ CHIPActivatedCarbonFilterMonitoringAttributeListAttributeCallback(jobject javaCa } } -CHIPActivatedCarbonFilterMonitoringAttributeListAttributeCallback::~ -CHIPActivatedCarbonFilterMonitoringAttributeListAttributeCallback() +CHIPActivatedCarbonFilterMonitoringAttributeListAttributeCallback:: + ~CHIPActivatedCarbonFilterMonitoringAttributeListAttributeCallback() { JNIEnv * env = chip::JniReferences::GetInstance().GetEnvForCurrentThread(); if (env == nullptr) @@ -29724,7 +29724,7 @@ void CHIPActivatedCarbonFilterMonitoringAttributeListAttributeCallback::Callback } CHIPBooleanStateConfigurationGeneratedCommandListAttributeCallback:: -CHIPBooleanStateConfigurationGeneratedCommandListAttributeCallback(jobject javaCallback, bool keepAlive) : + CHIPBooleanStateConfigurationGeneratedCommandListAttributeCallback(jobject javaCallback, bool keepAlive) : chip::Callback::Callback(CallbackFn, this), keepAlive(keepAlive) { @@ -29742,8 +29742,8 @@ CHIPBooleanStateConfigurationGeneratedCommandListAttributeCallback(jobject javaC } } -CHIPBooleanStateConfigurationGeneratedCommandListAttributeCallback::~ -CHIPBooleanStateConfigurationGeneratedCommandListAttributeCallback() +CHIPBooleanStateConfigurationGeneratedCommandListAttributeCallback:: + ~CHIPBooleanStateConfigurationGeneratedCommandListAttributeCallback() { JNIEnv * env = chip::JniReferences::GetInstance().GetEnvForCurrentThread(); if (env == nullptr) @@ -29797,7 +29797,7 @@ void CHIPBooleanStateConfigurationGeneratedCommandListAttributeCallback::Callbac } CHIPBooleanStateConfigurationAcceptedCommandListAttributeCallback:: -CHIPBooleanStateConfigurationAcceptedCommandListAttributeCallback(jobject javaCallback, bool keepAlive) : + CHIPBooleanStateConfigurationAcceptedCommandListAttributeCallback(jobject javaCallback, bool keepAlive) : chip::Callback::Callback(CallbackFn, this), keepAlive(keepAlive) { @@ -29815,8 +29815,8 @@ CHIPBooleanStateConfigurationAcceptedCommandListAttributeCallback(jobject javaCa } } -CHIPBooleanStateConfigurationAcceptedCommandListAttributeCallback::~ -CHIPBooleanStateConfigurationAcceptedCommandListAttributeCallback() +CHIPBooleanStateConfigurationAcceptedCommandListAttributeCallback:: + ~CHIPBooleanStateConfigurationAcceptedCommandListAttributeCallback() { JNIEnv * env = chip::JniReferences::GetInstance().GetEnvForCurrentThread(); if (env == nullptr) @@ -30082,7 +30082,7 @@ void CHIPValveConfigurationAndControlOpenDurationAttributeCallback::CallbackFn( } CHIPValveConfigurationAndControlDefaultOpenDurationAttributeCallback:: -CHIPValveConfigurationAndControlDefaultOpenDurationAttributeCallback(jobject javaCallback, bool keepAlive) : + CHIPValveConfigurationAndControlDefaultOpenDurationAttributeCallback(jobject javaCallback, bool keepAlive) : chip::Callback::Callback(CallbackFn, this), keepAlive(keepAlive) { @@ -30100,8 +30100,8 @@ CHIPValveConfigurationAndControlDefaultOpenDurationAttributeCallback(jobject jav } } -CHIPValveConfigurationAndControlDefaultOpenDurationAttributeCallback::~ -CHIPValveConfigurationAndControlDefaultOpenDurationAttributeCallback() +CHIPValveConfigurationAndControlDefaultOpenDurationAttributeCallback:: + ~CHIPValveConfigurationAndControlDefaultOpenDurationAttributeCallback() { JNIEnv * env = chip::JniReferences::GetInstance().GetEnvForCurrentThread(); if (env == nullptr) @@ -30219,7 +30219,7 @@ void CHIPValveConfigurationAndControlAutoCloseTimeAttributeCallback::CallbackFn( } CHIPValveConfigurationAndControlRemainingDurationAttributeCallback:: -CHIPValveConfigurationAndControlRemainingDurationAttributeCallback(jobject javaCallback, bool keepAlive) : + CHIPValveConfigurationAndControlRemainingDurationAttributeCallback(jobject javaCallback, bool keepAlive) : chip::Callback::Callback(CallbackFn, this), keepAlive(keepAlive) { @@ -30237,8 +30237,8 @@ CHIPValveConfigurationAndControlRemainingDurationAttributeCallback(jobject javaC } } -CHIPValveConfigurationAndControlRemainingDurationAttributeCallback::~ -CHIPValveConfigurationAndControlRemainingDurationAttributeCallback() +CHIPValveConfigurationAndControlRemainingDurationAttributeCallback:: + ~CHIPValveConfigurationAndControlRemainingDurationAttributeCallback() { JNIEnv * env = chip::JniReferences::GetInstance().GetEnvForCurrentThread(); if (env == nullptr) @@ -30560,7 +30560,7 @@ void CHIPValveConfigurationAndControlTargetLevelAttributeCallback::CallbackFn( } CHIPValveConfigurationAndControlGeneratedCommandListAttributeCallback:: -CHIPValveConfigurationAndControlGeneratedCommandListAttributeCallback(jobject javaCallback, bool keepAlive) : + CHIPValveConfigurationAndControlGeneratedCommandListAttributeCallback(jobject javaCallback, bool keepAlive) : chip::Callback::Callback(CallbackFn, this), keepAlive(keepAlive) { @@ -30578,8 +30578,8 @@ CHIPValveConfigurationAndControlGeneratedCommandListAttributeCallback(jobject ja } } -CHIPValveConfigurationAndControlGeneratedCommandListAttributeCallback::~ -CHIPValveConfigurationAndControlGeneratedCommandListAttributeCallback() +CHIPValveConfigurationAndControlGeneratedCommandListAttributeCallback:: + ~CHIPValveConfigurationAndControlGeneratedCommandListAttributeCallback() { JNIEnv * env = chip::JniReferences::GetInstance().GetEnvForCurrentThread(); if (env == nullptr) @@ -30633,7 +30633,7 @@ void CHIPValveConfigurationAndControlGeneratedCommandListAttributeCallback::Call } CHIPValveConfigurationAndControlAcceptedCommandListAttributeCallback:: -CHIPValveConfigurationAndControlAcceptedCommandListAttributeCallback(jobject javaCallback, bool keepAlive) : + CHIPValveConfigurationAndControlAcceptedCommandListAttributeCallback(jobject javaCallback, bool keepAlive) : chip::Callback::Callback(CallbackFn, this), keepAlive(keepAlive) { @@ -30651,8 +30651,8 @@ CHIPValveConfigurationAndControlAcceptedCommandListAttributeCallback(jobject jav } } -CHIPValveConfigurationAndControlAcceptedCommandListAttributeCallback::~ -CHIPValveConfigurationAndControlAcceptedCommandListAttributeCallback() +CHIPValveConfigurationAndControlAcceptedCommandListAttributeCallback:: + ~CHIPValveConfigurationAndControlAcceptedCommandListAttributeCallback() { JNIEnv * env = chip::JniReferences::GetInstance().GetEnvForCurrentThread(); if (env == nullptr) @@ -30850,7 +30850,7 @@ void CHIPValveConfigurationAndControlAttributeListAttributeCallback::CallbackFn( } CHIPElectricalEnergyMeasurementGeneratedCommandListAttributeCallback:: -CHIPElectricalEnergyMeasurementGeneratedCommandListAttributeCallback(jobject javaCallback, bool keepAlive) : + CHIPElectricalEnergyMeasurementGeneratedCommandListAttributeCallback(jobject javaCallback, bool keepAlive) : chip::Callback::Callback(CallbackFn, this), keepAlive(keepAlive) { @@ -30868,8 +30868,8 @@ CHIPElectricalEnergyMeasurementGeneratedCommandListAttributeCallback(jobject jav } } -CHIPElectricalEnergyMeasurementGeneratedCommandListAttributeCallback::~ -CHIPElectricalEnergyMeasurementGeneratedCommandListAttributeCallback() +CHIPElectricalEnergyMeasurementGeneratedCommandListAttributeCallback:: + ~CHIPElectricalEnergyMeasurementGeneratedCommandListAttributeCallback() { JNIEnv * env = chip::JniReferences::GetInstance().GetEnvForCurrentThread(); if (env == nullptr) @@ -30923,7 +30923,7 @@ void CHIPElectricalEnergyMeasurementGeneratedCommandListAttributeCallback::Callb } CHIPElectricalEnergyMeasurementAcceptedCommandListAttributeCallback:: -CHIPElectricalEnergyMeasurementAcceptedCommandListAttributeCallback(jobject javaCallback, bool keepAlive) : + CHIPElectricalEnergyMeasurementAcceptedCommandListAttributeCallback(jobject javaCallback, bool keepAlive) : chip::Callback::Callback(CallbackFn, this), keepAlive(keepAlive) { @@ -30941,8 +30941,8 @@ CHIPElectricalEnergyMeasurementAcceptedCommandListAttributeCallback(jobject java } } -CHIPElectricalEnergyMeasurementAcceptedCommandListAttributeCallback::~ -CHIPElectricalEnergyMeasurementAcceptedCommandListAttributeCallback() +CHIPElectricalEnergyMeasurementAcceptedCommandListAttributeCallback:: + ~CHIPElectricalEnergyMeasurementAcceptedCommandListAttributeCallback() { JNIEnv * env = chip::JniReferences::GetInstance().GetEnvForCurrentThread(); if (env == nullptr) @@ -31140,7 +31140,7 @@ void CHIPElectricalEnergyMeasurementAttributeListAttributeCallback::CallbackFn( } CHIPDemandResponseLoadControlLoadControlProgramsAttributeCallback:: -CHIPDemandResponseLoadControlLoadControlProgramsAttributeCallback(jobject javaCallback, bool keepAlive) : + CHIPDemandResponseLoadControlLoadControlProgramsAttributeCallback(jobject javaCallback, bool keepAlive) : chip::Callback::Callback(CallbackFn, this), keepAlive(keepAlive) { @@ -31158,8 +31158,8 @@ CHIPDemandResponseLoadControlLoadControlProgramsAttributeCallback(jobject javaCa } } -CHIPDemandResponseLoadControlLoadControlProgramsAttributeCallback::~ -CHIPDemandResponseLoadControlLoadControlProgramsAttributeCallback() +CHIPDemandResponseLoadControlLoadControlProgramsAttributeCallback:: + ~CHIPDemandResponseLoadControlLoadControlProgramsAttributeCallback() { JNIEnv * env = chip::JniReferences::GetInstance().GetEnvForCurrentThread(); if (env == nullptr) @@ -32375,7 +32375,7 @@ void CHIPDemandResponseLoadControlActiveEventsAttributeCallback::CallbackFn( } CHIPDemandResponseLoadControlGeneratedCommandListAttributeCallback:: -CHIPDemandResponseLoadControlGeneratedCommandListAttributeCallback(jobject javaCallback, bool keepAlive) : + CHIPDemandResponseLoadControlGeneratedCommandListAttributeCallback(jobject javaCallback, bool keepAlive) : chip::Callback::Callback(CallbackFn, this), keepAlive(keepAlive) { @@ -32393,8 +32393,8 @@ CHIPDemandResponseLoadControlGeneratedCommandListAttributeCallback(jobject javaC } } -CHIPDemandResponseLoadControlGeneratedCommandListAttributeCallback::~ -CHIPDemandResponseLoadControlGeneratedCommandListAttributeCallback() +CHIPDemandResponseLoadControlGeneratedCommandListAttributeCallback:: + ~CHIPDemandResponseLoadControlGeneratedCommandListAttributeCallback() { JNIEnv * env = chip::JniReferences::GetInstance().GetEnvForCurrentThread(); if (env == nullptr) @@ -32448,7 +32448,7 @@ void CHIPDemandResponseLoadControlGeneratedCommandListAttributeCallback::Callbac } CHIPDemandResponseLoadControlAcceptedCommandListAttributeCallback:: -CHIPDemandResponseLoadControlAcceptedCommandListAttributeCallback(jobject javaCallback, bool keepAlive) : + CHIPDemandResponseLoadControlAcceptedCommandListAttributeCallback(jobject javaCallback, bool keepAlive) : chip::Callback::Callback(CallbackFn, this), keepAlive(keepAlive) { @@ -32466,8 +32466,8 @@ CHIPDemandResponseLoadControlAcceptedCommandListAttributeCallback(jobject javaCa } } -CHIPDemandResponseLoadControlAcceptedCommandListAttributeCallback::~ -CHIPDemandResponseLoadControlAcceptedCommandListAttributeCallback() +CHIPDemandResponseLoadControlAcceptedCommandListAttributeCallback:: + ~CHIPDemandResponseLoadControlAcceptedCommandListAttributeCallback() { JNIEnv * env = chip::JniReferences::GetInstance().GetEnvForCurrentThread(); if (env == nullptr) @@ -32665,7 +32665,7 @@ void CHIPDemandResponseLoadControlAttributeListAttributeCallback::CallbackFn( } CHIPDeviceEnergyManagementPowerAdjustmentCapabilityAttributeCallback:: -CHIPDeviceEnergyManagementPowerAdjustmentCapabilityAttributeCallback(jobject javaCallback, bool keepAlive) : + CHIPDeviceEnergyManagementPowerAdjustmentCapabilityAttributeCallback(jobject javaCallback, bool keepAlive) : chip::Callback::Callback(CallbackFn, this), keepAlive(keepAlive) { @@ -32683,8 +32683,8 @@ CHIPDeviceEnergyManagementPowerAdjustmentCapabilityAttributeCallback(jobject jav } } -CHIPDeviceEnergyManagementPowerAdjustmentCapabilityAttributeCallback::~ -CHIPDeviceEnergyManagementPowerAdjustmentCapabilityAttributeCallback() +CHIPDeviceEnergyManagementPowerAdjustmentCapabilityAttributeCallback:: + ~CHIPDeviceEnergyManagementPowerAdjustmentCapabilityAttributeCallback() { JNIEnv * env = chip::JniReferences::GetInstance().GetEnvForCurrentThread(); if (env == nullptr) @@ -35493,8 +35493,8 @@ CHIPWindowCoveringCurrentPositionLiftPercentageAttributeCallback::CHIPWindowCove } } -CHIPWindowCoveringCurrentPositionLiftPercentageAttributeCallback::~ -CHIPWindowCoveringCurrentPositionLiftPercentageAttributeCallback() +CHIPWindowCoveringCurrentPositionLiftPercentageAttributeCallback:: + ~CHIPWindowCoveringCurrentPositionLiftPercentageAttributeCallback() { JNIEnv * env = chip::JniReferences::GetInstance().GetEnvForCurrentThread(); if (env == nullptr) @@ -35562,8 +35562,8 @@ CHIPWindowCoveringCurrentPositionTiltPercentageAttributeCallback::CHIPWindowCove } } -CHIPWindowCoveringCurrentPositionTiltPercentageAttributeCallback::~ -CHIPWindowCoveringCurrentPositionTiltPercentageAttributeCallback() +CHIPWindowCoveringCurrentPositionTiltPercentageAttributeCallback:: + ~CHIPWindowCoveringCurrentPositionTiltPercentageAttributeCallback() { JNIEnv * env = chip::JniReferences::GetInstance().GetEnvForCurrentThread(); if (env == nullptr) @@ -35613,7 +35613,7 @@ void CHIPWindowCoveringCurrentPositionTiltPercentageAttributeCallback::CallbackF } CHIPWindowCoveringTargetPositionLiftPercent100thsAttributeCallback:: -CHIPWindowCoveringTargetPositionLiftPercent100thsAttributeCallback(jobject javaCallback, bool keepAlive) : + CHIPWindowCoveringTargetPositionLiftPercent100thsAttributeCallback(jobject javaCallback, bool keepAlive) : chip::Callback::Callback(CallbackFn, this), keepAlive(keepAlive) { @@ -35631,8 +35631,8 @@ CHIPWindowCoveringTargetPositionLiftPercent100thsAttributeCallback(jobject javaC } } -CHIPWindowCoveringTargetPositionLiftPercent100thsAttributeCallback::~ -CHIPWindowCoveringTargetPositionLiftPercent100thsAttributeCallback() +CHIPWindowCoveringTargetPositionLiftPercent100thsAttributeCallback:: + ~CHIPWindowCoveringTargetPositionLiftPercent100thsAttributeCallback() { JNIEnv * env = chip::JniReferences::GetInstance().GetEnvForCurrentThread(); if (env == nullptr) @@ -35682,7 +35682,7 @@ void CHIPWindowCoveringTargetPositionLiftPercent100thsAttributeCallback::Callbac } CHIPWindowCoveringTargetPositionTiltPercent100thsAttributeCallback:: -CHIPWindowCoveringTargetPositionTiltPercent100thsAttributeCallback(jobject javaCallback, bool keepAlive) : + CHIPWindowCoveringTargetPositionTiltPercent100thsAttributeCallback(jobject javaCallback, bool keepAlive) : chip::Callback::Callback(CallbackFn, this), keepAlive(keepAlive) { @@ -35700,8 +35700,8 @@ CHIPWindowCoveringTargetPositionTiltPercent100thsAttributeCallback(jobject javaC } } -CHIPWindowCoveringTargetPositionTiltPercent100thsAttributeCallback::~ -CHIPWindowCoveringTargetPositionTiltPercent100thsAttributeCallback() +CHIPWindowCoveringTargetPositionTiltPercent100thsAttributeCallback:: + ~CHIPWindowCoveringTargetPositionTiltPercent100thsAttributeCallback() { JNIEnv * env = chip::JniReferences::GetInstance().GetEnvForCurrentThread(); if (env == nullptr) @@ -35751,7 +35751,7 @@ void CHIPWindowCoveringTargetPositionTiltPercent100thsAttributeCallback::Callbac } CHIPWindowCoveringCurrentPositionLiftPercent100thsAttributeCallback:: -CHIPWindowCoveringCurrentPositionLiftPercent100thsAttributeCallback(jobject javaCallback, bool keepAlive) : + CHIPWindowCoveringCurrentPositionLiftPercent100thsAttributeCallback(jobject javaCallback, bool keepAlive) : chip::Callback::Callback(CallbackFn, this), keepAlive(keepAlive) { @@ -35769,8 +35769,8 @@ CHIPWindowCoveringCurrentPositionLiftPercent100thsAttributeCallback(jobject java } } -CHIPWindowCoveringCurrentPositionLiftPercent100thsAttributeCallback::~ -CHIPWindowCoveringCurrentPositionLiftPercent100thsAttributeCallback() +CHIPWindowCoveringCurrentPositionLiftPercent100thsAttributeCallback:: + ~CHIPWindowCoveringCurrentPositionLiftPercent100thsAttributeCallback() { JNIEnv * env = chip::JniReferences::GetInstance().GetEnvForCurrentThread(); if (env == nullptr) @@ -35820,7 +35820,7 @@ void CHIPWindowCoveringCurrentPositionLiftPercent100thsAttributeCallback::Callba } CHIPWindowCoveringCurrentPositionTiltPercent100thsAttributeCallback:: -CHIPWindowCoveringCurrentPositionTiltPercent100thsAttributeCallback(jobject javaCallback, bool keepAlive) : + CHIPWindowCoveringCurrentPositionTiltPercent100thsAttributeCallback(jobject javaCallback, bool keepAlive) : chip::Callback::Callback(CallbackFn, this), keepAlive(keepAlive) { @@ -35838,8 +35838,8 @@ CHIPWindowCoveringCurrentPositionTiltPercent100thsAttributeCallback(jobject java } } -CHIPWindowCoveringCurrentPositionTiltPercent100thsAttributeCallback::~ -CHIPWindowCoveringCurrentPositionTiltPercent100thsAttributeCallback() +CHIPWindowCoveringCurrentPositionTiltPercent100thsAttributeCallback:: + ~CHIPWindowCoveringCurrentPositionTiltPercent100thsAttributeCallback() { JNIEnv * env = chip::JniReferences::GetInstance().GetEnvForCurrentThread(); if (env == nullptr) @@ -36681,8 +36681,8 @@ CHIPPumpConfigurationAndControlMinConstPressureAttributeCallback::CHIPPumpConfig } } -CHIPPumpConfigurationAndControlMinConstPressureAttributeCallback::~ -CHIPPumpConfigurationAndControlMinConstPressureAttributeCallback() +CHIPPumpConfigurationAndControlMinConstPressureAttributeCallback:: + ~CHIPPumpConfigurationAndControlMinConstPressureAttributeCallback() { JNIEnv * env = chip::JniReferences::GetInstance().GetEnvForCurrentThread(); if (env == nullptr) @@ -36750,8 +36750,8 @@ CHIPPumpConfigurationAndControlMaxConstPressureAttributeCallback::CHIPPumpConfig } } -CHIPPumpConfigurationAndControlMaxConstPressureAttributeCallback::~ -CHIPPumpConfigurationAndControlMaxConstPressureAttributeCallback() +CHIPPumpConfigurationAndControlMaxConstPressureAttributeCallback:: + ~CHIPPumpConfigurationAndControlMaxConstPressureAttributeCallback() { JNIEnv * env = chip::JniReferences::GetInstance().GetEnvForCurrentThread(); if (env == nullptr) @@ -37481,7 +37481,7 @@ void CHIPPumpConfigurationAndControlSpeedAttributeCallback::CallbackFn(void * co } CHIPPumpConfigurationAndControlLifetimeRunningHoursAttributeCallback:: -CHIPPumpConfigurationAndControlLifetimeRunningHoursAttributeCallback(jobject javaCallback, bool keepAlive) : + CHIPPumpConfigurationAndControlLifetimeRunningHoursAttributeCallback(jobject javaCallback, bool keepAlive) : chip::Callback::Callback(CallbackFn, this), keepAlive(keepAlive) { @@ -37499,8 +37499,8 @@ CHIPPumpConfigurationAndControlLifetimeRunningHoursAttributeCallback(jobject jav } } -CHIPPumpConfigurationAndControlLifetimeRunningHoursAttributeCallback::~ -CHIPPumpConfigurationAndControlLifetimeRunningHoursAttributeCallback() +CHIPPumpConfigurationAndControlLifetimeRunningHoursAttributeCallback:: + ~CHIPPumpConfigurationAndControlLifetimeRunningHoursAttributeCallback() { JNIEnv * env = chip::JniReferences::GetInstance().GetEnvForCurrentThread(); if (env == nullptr) @@ -37618,7 +37618,7 @@ void CHIPPumpConfigurationAndControlPowerAttributeCallback::CallbackFn(void * co } CHIPPumpConfigurationAndControlLifetimeEnergyConsumedAttributeCallback:: -CHIPPumpConfigurationAndControlLifetimeEnergyConsumedAttributeCallback(jobject javaCallback, bool keepAlive) : + CHIPPumpConfigurationAndControlLifetimeEnergyConsumedAttributeCallback(jobject javaCallback, bool keepAlive) : chip::Callback::Callback(CallbackFn, this), keepAlive(keepAlive) { @@ -37636,8 +37636,8 @@ CHIPPumpConfigurationAndControlLifetimeEnergyConsumedAttributeCallback(jobject j } } -CHIPPumpConfigurationAndControlLifetimeEnergyConsumedAttributeCallback::~ -CHIPPumpConfigurationAndControlLifetimeEnergyConsumedAttributeCallback() +CHIPPumpConfigurationAndControlLifetimeEnergyConsumedAttributeCallback:: + ~CHIPPumpConfigurationAndControlLifetimeEnergyConsumedAttributeCallback() { JNIEnv * env = chip::JniReferences::GetInstance().GetEnvForCurrentThread(); if (env == nullptr) @@ -37687,7 +37687,7 @@ void CHIPPumpConfigurationAndControlLifetimeEnergyConsumedAttributeCallback::Cal } CHIPPumpConfigurationAndControlGeneratedCommandListAttributeCallback:: -CHIPPumpConfigurationAndControlGeneratedCommandListAttributeCallback(jobject javaCallback, bool keepAlive) : + CHIPPumpConfigurationAndControlGeneratedCommandListAttributeCallback(jobject javaCallback, bool keepAlive) : chip::Callback::Callback(CallbackFn, this), keepAlive(keepAlive) { @@ -37705,8 +37705,8 @@ CHIPPumpConfigurationAndControlGeneratedCommandListAttributeCallback(jobject jav } } -CHIPPumpConfigurationAndControlGeneratedCommandListAttributeCallback::~ -CHIPPumpConfigurationAndControlGeneratedCommandListAttributeCallback() +CHIPPumpConfigurationAndControlGeneratedCommandListAttributeCallback:: + ~CHIPPumpConfigurationAndControlGeneratedCommandListAttributeCallback() { JNIEnv * env = chip::JniReferences::GetInstance().GetEnvForCurrentThread(); if (env == nullptr) @@ -37760,7 +37760,7 @@ void CHIPPumpConfigurationAndControlGeneratedCommandListAttributeCallback::Callb } CHIPPumpConfigurationAndControlAcceptedCommandListAttributeCallback:: -CHIPPumpConfigurationAndControlAcceptedCommandListAttributeCallback(jobject javaCallback, bool keepAlive) : + CHIPPumpConfigurationAndControlAcceptedCommandListAttributeCallback(jobject javaCallback, bool keepAlive) : chip::Callback::Callback(CallbackFn, this), keepAlive(keepAlive) { @@ -37778,8 +37778,8 @@ CHIPPumpConfigurationAndControlAcceptedCommandListAttributeCallback(jobject java } } -CHIPPumpConfigurationAndControlAcceptedCommandListAttributeCallback::~ -CHIPPumpConfigurationAndControlAcceptedCommandListAttributeCallback() +CHIPPumpConfigurationAndControlAcceptedCommandListAttributeCallback:: + ~CHIPPumpConfigurationAndControlAcceptedCommandListAttributeCallback() { JNIEnv * env = chip::JniReferences::GetInstance().GetEnvForCurrentThread(); if (env == nullptr) @@ -39410,7 +39410,7 @@ void CHIPFanControlAttributeListAttributeCallback::CallbackFn(void * context, } CHIPThermostatUserInterfaceConfigurationGeneratedCommandListAttributeCallback:: -CHIPThermostatUserInterfaceConfigurationGeneratedCommandListAttributeCallback(jobject javaCallback, bool keepAlive) : + CHIPThermostatUserInterfaceConfigurationGeneratedCommandListAttributeCallback(jobject javaCallback, bool keepAlive) : chip::Callback::Callback(CallbackFn, this), keepAlive(keepAlive) @@ -39429,8 +39429,8 @@ CHIPThermostatUserInterfaceConfigurationGeneratedCommandListAttributeCallback(jo } } -CHIPThermostatUserInterfaceConfigurationGeneratedCommandListAttributeCallback::~ -CHIPThermostatUserInterfaceConfigurationGeneratedCommandListAttributeCallback() +CHIPThermostatUserInterfaceConfigurationGeneratedCommandListAttributeCallback:: + ~CHIPThermostatUserInterfaceConfigurationGeneratedCommandListAttributeCallback() { JNIEnv * env = chip::JniReferences::GetInstance().GetEnvForCurrentThread(); if (env == nullptr) @@ -39485,7 +39485,7 @@ void CHIPThermostatUserInterfaceConfigurationGeneratedCommandListAttributeCallba } CHIPThermostatUserInterfaceConfigurationAcceptedCommandListAttributeCallback:: -CHIPThermostatUserInterfaceConfigurationAcceptedCommandListAttributeCallback(jobject javaCallback, bool keepAlive) : + CHIPThermostatUserInterfaceConfigurationAcceptedCommandListAttributeCallback(jobject javaCallback, bool keepAlive) : chip::Callback::Callback(CallbackFn, this), keepAlive(keepAlive) @@ -39504,8 +39504,8 @@ CHIPThermostatUserInterfaceConfigurationAcceptedCommandListAttributeCallback(job } } -CHIPThermostatUserInterfaceConfigurationAcceptedCommandListAttributeCallback::~ -CHIPThermostatUserInterfaceConfigurationAcceptedCommandListAttributeCallback() +CHIPThermostatUserInterfaceConfigurationAcceptedCommandListAttributeCallback:: + ~CHIPThermostatUserInterfaceConfigurationAcceptedCommandListAttributeCallback() { JNIEnv * env = chip::JniReferences::GetInstance().GetEnvForCurrentThread(); if (env == nullptr) @@ -39560,7 +39560,7 @@ void CHIPThermostatUserInterfaceConfigurationAcceptedCommandListAttributeCallbac } CHIPThermostatUserInterfaceConfigurationEventListAttributeCallback:: -CHIPThermostatUserInterfaceConfigurationEventListAttributeCallback(jobject javaCallback, bool keepAlive) : + CHIPThermostatUserInterfaceConfigurationEventListAttributeCallback(jobject javaCallback, bool keepAlive) : chip::Callback::Callback(CallbackFn, this), keepAlive(keepAlive) { @@ -39578,8 +39578,8 @@ CHIPThermostatUserInterfaceConfigurationEventListAttributeCallback(jobject javaC } } -CHIPThermostatUserInterfaceConfigurationEventListAttributeCallback::~ -CHIPThermostatUserInterfaceConfigurationEventListAttributeCallback() +CHIPThermostatUserInterfaceConfigurationEventListAttributeCallback:: + ~CHIPThermostatUserInterfaceConfigurationEventListAttributeCallback() { JNIEnv * env = chip::JniReferences::GetInstance().GetEnvForCurrentThread(); if (env == nullptr) @@ -39633,7 +39633,7 @@ void CHIPThermostatUserInterfaceConfigurationEventListAttributeCallback::Callbac } CHIPThermostatUserInterfaceConfigurationAttributeListAttributeCallback:: -CHIPThermostatUserInterfaceConfigurationAttributeListAttributeCallback(jobject javaCallback, bool keepAlive) : + CHIPThermostatUserInterfaceConfigurationAttributeListAttributeCallback(jobject javaCallback, bool keepAlive) : chip::Callback::Callback(CallbackFn, this), keepAlive(keepAlive) { @@ -39651,8 +39651,8 @@ CHIPThermostatUserInterfaceConfigurationAttributeListAttributeCallback(jobject j } } -CHIPThermostatUserInterfaceConfigurationAttributeListAttributeCallback::~ -CHIPThermostatUserInterfaceConfigurationAttributeListAttributeCallback() +CHIPThermostatUserInterfaceConfigurationAttributeListAttributeCallback:: + ~CHIPThermostatUserInterfaceConfigurationAttributeListAttributeCallback() { JNIEnv * env = chip::JniReferences::GetInstance().GetEnvForCurrentThread(); if (env == nullptr) @@ -40818,8 +40818,8 @@ CHIPBallastConfigurationBallastFactorAdjustmentAttributeCallback::CHIPBallastCon } } -CHIPBallastConfigurationBallastFactorAdjustmentAttributeCallback::~ -CHIPBallastConfigurationBallastFactorAdjustmentAttributeCallback() +CHIPBallastConfigurationBallastFactorAdjustmentAttributeCallback:: + ~CHIPBallastConfigurationBallastFactorAdjustmentAttributeCallback() { JNIEnv * env = chip::JniReferences::GetInstance().GetEnvForCurrentThread(); if (env == nullptr) @@ -43680,8 +43680,8 @@ CHIPRelativeHumidityMeasurementMinMeasuredValueAttributeCallback::CHIPRelativeHu } } -CHIPRelativeHumidityMeasurementMinMeasuredValueAttributeCallback::~ -CHIPRelativeHumidityMeasurementMinMeasuredValueAttributeCallback() +CHIPRelativeHumidityMeasurementMinMeasuredValueAttributeCallback:: + ~CHIPRelativeHumidityMeasurementMinMeasuredValueAttributeCallback() { JNIEnv * env = chip::JniReferences::GetInstance().GetEnvForCurrentThread(); if (env == nullptr) @@ -43749,8 +43749,8 @@ CHIPRelativeHumidityMeasurementMaxMeasuredValueAttributeCallback::CHIPRelativeHu } } -CHIPRelativeHumidityMeasurementMaxMeasuredValueAttributeCallback::~ -CHIPRelativeHumidityMeasurementMaxMeasuredValueAttributeCallback() +CHIPRelativeHumidityMeasurementMaxMeasuredValueAttributeCallback:: + ~CHIPRelativeHumidityMeasurementMaxMeasuredValueAttributeCallback() { JNIEnv * env = chip::JniReferences::GetInstance().GetEnvForCurrentThread(); if (env == nullptr) @@ -43800,7 +43800,7 @@ void CHIPRelativeHumidityMeasurementMaxMeasuredValueAttributeCallback::CallbackF } CHIPRelativeHumidityMeasurementGeneratedCommandListAttributeCallback:: -CHIPRelativeHumidityMeasurementGeneratedCommandListAttributeCallback(jobject javaCallback, bool keepAlive) : + CHIPRelativeHumidityMeasurementGeneratedCommandListAttributeCallback(jobject javaCallback, bool keepAlive) : chip::Callback::Callback(CallbackFn, this), keepAlive(keepAlive) { @@ -43818,8 +43818,8 @@ CHIPRelativeHumidityMeasurementGeneratedCommandListAttributeCallback(jobject jav } } -CHIPRelativeHumidityMeasurementGeneratedCommandListAttributeCallback::~ -CHIPRelativeHumidityMeasurementGeneratedCommandListAttributeCallback() +CHIPRelativeHumidityMeasurementGeneratedCommandListAttributeCallback:: + ~CHIPRelativeHumidityMeasurementGeneratedCommandListAttributeCallback() { JNIEnv * env = chip::JniReferences::GetInstance().GetEnvForCurrentThread(); if (env == nullptr) @@ -43873,7 +43873,7 @@ void CHIPRelativeHumidityMeasurementGeneratedCommandListAttributeCallback::Callb } CHIPRelativeHumidityMeasurementAcceptedCommandListAttributeCallback:: -CHIPRelativeHumidityMeasurementAcceptedCommandListAttributeCallback(jobject javaCallback, bool keepAlive) : + CHIPRelativeHumidityMeasurementAcceptedCommandListAttributeCallback(jobject javaCallback, bool keepAlive) : chip::Callback::Callback(CallbackFn, this), keepAlive(keepAlive) { @@ -43891,8 +43891,8 @@ CHIPRelativeHumidityMeasurementAcceptedCommandListAttributeCallback(jobject java } } -CHIPRelativeHumidityMeasurementAcceptedCommandListAttributeCallback::~ -CHIPRelativeHumidityMeasurementAcceptedCommandListAttributeCallback() +CHIPRelativeHumidityMeasurementAcceptedCommandListAttributeCallback:: + ~CHIPRelativeHumidityMeasurementAcceptedCommandListAttributeCallback() { JNIEnv * env = chip::JniReferences::GetInstance().GetEnvForCurrentThread(); if (env == nullptr) @@ -44376,7 +44376,7 @@ void CHIPOccupancySensingAttributeListAttributeCallback::CallbackFn( } CHIPCarbonMonoxideConcentrationMeasurementMeasuredValueAttributeCallback:: -CHIPCarbonMonoxideConcentrationMeasurementMeasuredValueAttributeCallback(jobject javaCallback, bool keepAlive) : + CHIPCarbonMonoxideConcentrationMeasurementMeasuredValueAttributeCallback(jobject javaCallback, bool keepAlive) : chip::Callback::Callback(CallbackFn, this), keepAlive(keepAlive) { @@ -44394,8 +44394,8 @@ CHIPCarbonMonoxideConcentrationMeasurementMeasuredValueAttributeCallback(jobject } } -CHIPCarbonMonoxideConcentrationMeasurementMeasuredValueAttributeCallback::~ -CHIPCarbonMonoxideConcentrationMeasurementMeasuredValueAttributeCallback() +CHIPCarbonMonoxideConcentrationMeasurementMeasuredValueAttributeCallback:: + ~CHIPCarbonMonoxideConcentrationMeasurementMeasuredValueAttributeCallback() { JNIEnv * env = chip::JniReferences::GetInstance().GetEnvForCurrentThread(); if (env == nullptr) @@ -44445,7 +44445,7 @@ void CHIPCarbonMonoxideConcentrationMeasurementMeasuredValueAttributeCallback::C } CHIPCarbonMonoxideConcentrationMeasurementMinMeasuredValueAttributeCallback:: -CHIPCarbonMonoxideConcentrationMeasurementMinMeasuredValueAttributeCallback(jobject javaCallback, bool keepAlive) : + CHIPCarbonMonoxideConcentrationMeasurementMinMeasuredValueAttributeCallback(jobject javaCallback, bool keepAlive) : chip::Callback::Callback(CallbackFn, this), keepAlive(keepAlive) @@ -44464,8 +44464,8 @@ CHIPCarbonMonoxideConcentrationMeasurementMinMeasuredValueAttributeCallback(jobj } } -CHIPCarbonMonoxideConcentrationMeasurementMinMeasuredValueAttributeCallback::~ -CHIPCarbonMonoxideConcentrationMeasurementMinMeasuredValueAttributeCallback() +CHIPCarbonMonoxideConcentrationMeasurementMinMeasuredValueAttributeCallback:: + ~CHIPCarbonMonoxideConcentrationMeasurementMinMeasuredValueAttributeCallback() { JNIEnv * env = chip::JniReferences::GetInstance().GetEnvForCurrentThread(); if (env == nullptr) @@ -44516,7 +44516,7 @@ void CHIPCarbonMonoxideConcentrationMeasurementMinMeasuredValueAttributeCallback } CHIPCarbonMonoxideConcentrationMeasurementMaxMeasuredValueAttributeCallback:: -CHIPCarbonMonoxideConcentrationMeasurementMaxMeasuredValueAttributeCallback(jobject javaCallback, bool keepAlive) : + CHIPCarbonMonoxideConcentrationMeasurementMaxMeasuredValueAttributeCallback(jobject javaCallback, bool keepAlive) : chip::Callback::Callback(CallbackFn, this), keepAlive(keepAlive) @@ -44535,8 +44535,8 @@ CHIPCarbonMonoxideConcentrationMeasurementMaxMeasuredValueAttributeCallback(jobj } } -CHIPCarbonMonoxideConcentrationMeasurementMaxMeasuredValueAttributeCallback::~ -CHIPCarbonMonoxideConcentrationMeasurementMaxMeasuredValueAttributeCallback() +CHIPCarbonMonoxideConcentrationMeasurementMaxMeasuredValueAttributeCallback:: + ~CHIPCarbonMonoxideConcentrationMeasurementMaxMeasuredValueAttributeCallback() { JNIEnv * env = chip::JniReferences::GetInstance().GetEnvForCurrentThread(); if (env == nullptr) @@ -44587,7 +44587,7 @@ void CHIPCarbonMonoxideConcentrationMeasurementMaxMeasuredValueAttributeCallback } CHIPCarbonMonoxideConcentrationMeasurementPeakMeasuredValueAttributeCallback:: -CHIPCarbonMonoxideConcentrationMeasurementPeakMeasuredValueAttributeCallback(jobject javaCallback, bool keepAlive) : + CHIPCarbonMonoxideConcentrationMeasurementPeakMeasuredValueAttributeCallback(jobject javaCallback, bool keepAlive) : chip::Callback::Callback(CallbackFn, this), keepAlive(keepAlive) @@ -44606,8 +44606,8 @@ CHIPCarbonMonoxideConcentrationMeasurementPeakMeasuredValueAttributeCallback(job } } -CHIPCarbonMonoxideConcentrationMeasurementPeakMeasuredValueAttributeCallback::~ -CHIPCarbonMonoxideConcentrationMeasurementPeakMeasuredValueAttributeCallback() +CHIPCarbonMonoxideConcentrationMeasurementPeakMeasuredValueAttributeCallback:: + ~CHIPCarbonMonoxideConcentrationMeasurementPeakMeasuredValueAttributeCallback() { JNIEnv * env = chip::JniReferences::GetInstance().GetEnvForCurrentThread(); if (env == nullptr) @@ -44658,7 +44658,7 @@ void CHIPCarbonMonoxideConcentrationMeasurementPeakMeasuredValueAttributeCallbac } CHIPCarbonMonoxideConcentrationMeasurementAverageMeasuredValueAttributeCallback:: -CHIPCarbonMonoxideConcentrationMeasurementAverageMeasuredValueAttributeCallback(jobject javaCallback, bool keepAlive) : + CHIPCarbonMonoxideConcentrationMeasurementAverageMeasuredValueAttributeCallback(jobject javaCallback, bool keepAlive) : chip::Callback::Callback(CallbackFn, this), keepAlive(keepAlive) @@ -44677,8 +44677,8 @@ CHIPCarbonMonoxideConcentrationMeasurementAverageMeasuredValueAttributeCallback( } } -CHIPCarbonMonoxideConcentrationMeasurementAverageMeasuredValueAttributeCallback::~ -CHIPCarbonMonoxideConcentrationMeasurementAverageMeasuredValueAttributeCallback() +CHIPCarbonMonoxideConcentrationMeasurementAverageMeasuredValueAttributeCallback:: + ~CHIPCarbonMonoxideConcentrationMeasurementAverageMeasuredValueAttributeCallback() { JNIEnv * env = chip::JniReferences::GetInstance().GetEnvForCurrentThread(); if (env == nullptr) @@ -44729,7 +44729,7 @@ void CHIPCarbonMonoxideConcentrationMeasurementAverageMeasuredValueAttributeCall } CHIPCarbonMonoxideConcentrationMeasurementGeneratedCommandListAttributeCallback:: -CHIPCarbonMonoxideConcentrationMeasurementGeneratedCommandListAttributeCallback(jobject javaCallback, bool keepAlive) : + CHIPCarbonMonoxideConcentrationMeasurementGeneratedCommandListAttributeCallback(jobject javaCallback, bool keepAlive) : chip::Callback::Callback(CallbackFn, this), keepAlive(keepAlive) @@ -44748,8 +44748,8 @@ CHIPCarbonMonoxideConcentrationMeasurementGeneratedCommandListAttributeCallback( } } -CHIPCarbonMonoxideConcentrationMeasurementGeneratedCommandListAttributeCallback::~ -CHIPCarbonMonoxideConcentrationMeasurementGeneratedCommandListAttributeCallback() +CHIPCarbonMonoxideConcentrationMeasurementGeneratedCommandListAttributeCallback:: + ~CHIPCarbonMonoxideConcentrationMeasurementGeneratedCommandListAttributeCallback() { JNIEnv * env = chip::JniReferences::GetInstance().GetEnvForCurrentThread(); if (env == nullptr) @@ -44804,7 +44804,7 @@ void CHIPCarbonMonoxideConcentrationMeasurementGeneratedCommandListAttributeCall } CHIPCarbonMonoxideConcentrationMeasurementAcceptedCommandListAttributeCallback:: -CHIPCarbonMonoxideConcentrationMeasurementAcceptedCommandListAttributeCallback(jobject javaCallback, bool keepAlive) : + CHIPCarbonMonoxideConcentrationMeasurementAcceptedCommandListAttributeCallback(jobject javaCallback, bool keepAlive) : chip::Callback::Callback(CallbackFn, this), keepAlive(keepAlive) @@ -44823,8 +44823,8 @@ CHIPCarbonMonoxideConcentrationMeasurementAcceptedCommandListAttributeCallback(j } } -CHIPCarbonMonoxideConcentrationMeasurementAcceptedCommandListAttributeCallback::~ -CHIPCarbonMonoxideConcentrationMeasurementAcceptedCommandListAttributeCallback() +CHIPCarbonMonoxideConcentrationMeasurementAcceptedCommandListAttributeCallback:: + ~CHIPCarbonMonoxideConcentrationMeasurementAcceptedCommandListAttributeCallback() { JNIEnv * env = chip::JniReferences::GetInstance().GetEnvForCurrentThread(); if (env == nullptr) @@ -44879,7 +44879,7 @@ void CHIPCarbonMonoxideConcentrationMeasurementAcceptedCommandListAttributeCallb } CHIPCarbonMonoxideConcentrationMeasurementEventListAttributeCallback:: -CHIPCarbonMonoxideConcentrationMeasurementEventListAttributeCallback(jobject javaCallback, bool keepAlive) : + CHIPCarbonMonoxideConcentrationMeasurementEventListAttributeCallback(jobject javaCallback, bool keepAlive) : chip::Callback::Callback(CallbackFn, this), keepAlive(keepAlive) { @@ -44897,8 +44897,8 @@ CHIPCarbonMonoxideConcentrationMeasurementEventListAttributeCallback(jobject jav } } -CHIPCarbonMonoxideConcentrationMeasurementEventListAttributeCallback::~ -CHIPCarbonMonoxideConcentrationMeasurementEventListAttributeCallback() +CHIPCarbonMonoxideConcentrationMeasurementEventListAttributeCallback:: + ~CHIPCarbonMonoxideConcentrationMeasurementEventListAttributeCallback() { JNIEnv * env = chip::JniReferences::GetInstance().GetEnvForCurrentThread(); if (env == nullptr) @@ -44952,7 +44952,7 @@ void CHIPCarbonMonoxideConcentrationMeasurementEventListAttributeCallback::Callb } CHIPCarbonMonoxideConcentrationMeasurementAttributeListAttributeCallback:: -CHIPCarbonMonoxideConcentrationMeasurementAttributeListAttributeCallback(jobject javaCallback, bool keepAlive) : + CHIPCarbonMonoxideConcentrationMeasurementAttributeListAttributeCallback(jobject javaCallback, bool keepAlive) : chip::Callback::Callback(CallbackFn, this), keepAlive(keepAlive) { @@ -44970,8 +44970,8 @@ CHIPCarbonMonoxideConcentrationMeasurementAttributeListAttributeCallback(jobject } } -CHIPCarbonMonoxideConcentrationMeasurementAttributeListAttributeCallback::~ -CHIPCarbonMonoxideConcentrationMeasurementAttributeListAttributeCallback() +CHIPCarbonMonoxideConcentrationMeasurementAttributeListAttributeCallback:: + ~CHIPCarbonMonoxideConcentrationMeasurementAttributeListAttributeCallback() { JNIEnv * env = chip::JniReferences::GetInstance().GetEnvForCurrentThread(); if (env == nullptr) @@ -45025,7 +45025,7 @@ void CHIPCarbonMonoxideConcentrationMeasurementAttributeListAttributeCallback::C } CHIPCarbonDioxideConcentrationMeasurementMeasuredValueAttributeCallback:: -CHIPCarbonDioxideConcentrationMeasurementMeasuredValueAttributeCallback(jobject javaCallback, bool keepAlive) : + CHIPCarbonDioxideConcentrationMeasurementMeasuredValueAttributeCallback(jobject javaCallback, bool keepAlive) : chip::Callback::Callback(CallbackFn, this), keepAlive(keepAlive) { @@ -45043,8 +45043,8 @@ CHIPCarbonDioxideConcentrationMeasurementMeasuredValueAttributeCallback(jobject } } -CHIPCarbonDioxideConcentrationMeasurementMeasuredValueAttributeCallback::~ -CHIPCarbonDioxideConcentrationMeasurementMeasuredValueAttributeCallback() +CHIPCarbonDioxideConcentrationMeasurementMeasuredValueAttributeCallback:: + ~CHIPCarbonDioxideConcentrationMeasurementMeasuredValueAttributeCallback() { JNIEnv * env = chip::JniReferences::GetInstance().GetEnvForCurrentThread(); if (env == nullptr) @@ -45094,7 +45094,7 @@ void CHIPCarbonDioxideConcentrationMeasurementMeasuredValueAttributeCallback::Ca } CHIPCarbonDioxideConcentrationMeasurementMinMeasuredValueAttributeCallback:: -CHIPCarbonDioxideConcentrationMeasurementMinMeasuredValueAttributeCallback(jobject javaCallback, bool keepAlive) : + CHIPCarbonDioxideConcentrationMeasurementMinMeasuredValueAttributeCallback(jobject javaCallback, bool keepAlive) : chip::Callback::Callback(CallbackFn, this), keepAlive(keepAlive) @@ -45113,8 +45113,8 @@ CHIPCarbonDioxideConcentrationMeasurementMinMeasuredValueAttributeCallback(jobje } } -CHIPCarbonDioxideConcentrationMeasurementMinMeasuredValueAttributeCallback::~ -CHIPCarbonDioxideConcentrationMeasurementMinMeasuredValueAttributeCallback() +CHIPCarbonDioxideConcentrationMeasurementMinMeasuredValueAttributeCallback:: + ~CHIPCarbonDioxideConcentrationMeasurementMinMeasuredValueAttributeCallback() { JNIEnv * env = chip::JniReferences::GetInstance().GetEnvForCurrentThread(); if (env == nullptr) @@ -45165,7 +45165,7 @@ void CHIPCarbonDioxideConcentrationMeasurementMinMeasuredValueAttributeCallback: } CHIPCarbonDioxideConcentrationMeasurementMaxMeasuredValueAttributeCallback:: -CHIPCarbonDioxideConcentrationMeasurementMaxMeasuredValueAttributeCallback(jobject javaCallback, bool keepAlive) : + CHIPCarbonDioxideConcentrationMeasurementMaxMeasuredValueAttributeCallback(jobject javaCallback, bool keepAlive) : chip::Callback::Callback(CallbackFn, this), keepAlive(keepAlive) @@ -45184,8 +45184,8 @@ CHIPCarbonDioxideConcentrationMeasurementMaxMeasuredValueAttributeCallback(jobje } } -CHIPCarbonDioxideConcentrationMeasurementMaxMeasuredValueAttributeCallback::~ -CHIPCarbonDioxideConcentrationMeasurementMaxMeasuredValueAttributeCallback() +CHIPCarbonDioxideConcentrationMeasurementMaxMeasuredValueAttributeCallback:: + ~CHIPCarbonDioxideConcentrationMeasurementMaxMeasuredValueAttributeCallback() { JNIEnv * env = chip::JniReferences::GetInstance().GetEnvForCurrentThread(); if (env == nullptr) @@ -45236,7 +45236,7 @@ void CHIPCarbonDioxideConcentrationMeasurementMaxMeasuredValueAttributeCallback: } CHIPCarbonDioxideConcentrationMeasurementPeakMeasuredValueAttributeCallback:: -CHIPCarbonDioxideConcentrationMeasurementPeakMeasuredValueAttributeCallback(jobject javaCallback, bool keepAlive) : + CHIPCarbonDioxideConcentrationMeasurementPeakMeasuredValueAttributeCallback(jobject javaCallback, bool keepAlive) : chip::Callback::Callback(CallbackFn, this), keepAlive(keepAlive) @@ -45255,8 +45255,8 @@ CHIPCarbonDioxideConcentrationMeasurementPeakMeasuredValueAttributeCallback(jobj } } -CHIPCarbonDioxideConcentrationMeasurementPeakMeasuredValueAttributeCallback::~ -CHIPCarbonDioxideConcentrationMeasurementPeakMeasuredValueAttributeCallback() +CHIPCarbonDioxideConcentrationMeasurementPeakMeasuredValueAttributeCallback:: + ~CHIPCarbonDioxideConcentrationMeasurementPeakMeasuredValueAttributeCallback() { JNIEnv * env = chip::JniReferences::GetInstance().GetEnvForCurrentThread(); if (env == nullptr) @@ -45307,7 +45307,7 @@ void CHIPCarbonDioxideConcentrationMeasurementPeakMeasuredValueAttributeCallback } CHIPCarbonDioxideConcentrationMeasurementAverageMeasuredValueAttributeCallback:: -CHIPCarbonDioxideConcentrationMeasurementAverageMeasuredValueAttributeCallback(jobject javaCallback, bool keepAlive) : + CHIPCarbonDioxideConcentrationMeasurementAverageMeasuredValueAttributeCallback(jobject javaCallback, bool keepAlive) : chip::Callback::Callback(CallbackFn, this), keepAlive(keepAlive) @@ -45326,8 +45326,8 @@ CHIPCarbonDioxideConcentrationMeasurementAverageMeasuredValueAttributeCallback(j } } -CHIPCarbonDioxideConcentrationMeasurementAverageMeasuredValueAttributeCallback::~ -CHIPCarbonDioxideConcentrationMeasurementAverageMeasuredValueAttributeCallback() +CHIPCarbonDioxideConcentrationMeasurementAverageMeasuredValueAttributeCallback:: + ~CHIPCarbonDioxideConcentrationMeasurementAverageMeasuredValueAttributeCallback() { JNIEnv * env = chip::JniReferences::GetInstance().GetEnvForCurrentThread(); if (env == nullptr) @@ -45378,7 +45378,7 @@ void CHIPCarbonDioxideConcentrationMeasurementAverageMeasuredValueAttributeCallb } CHIPCarbonDioxideConcentrationMeasurementGeneratedCommandListAttributeCallback:: -CHIPCarbonDioxideConcentrationMeasurementGeneratedCommandListAttributeCallback(jobject javaCallback, bool keepAlive) : + CHIPCarbonDioxideConcentrationMeasurementGeneratedCommandListAttributeCallback(jobject javaCallback, bool keepAlive) : chip::Callback::Callback(CallbackFn, this), keepAlive(keepAlive) @@ -45397,8 +45397,8 @@ CHIPCarbonDioxideConcentrationMeasurementGeneratedCommandListAttributeCallback(j } } -CHIPCarbonDioxideConcentrationMeasurementGeneratedCommandListAttributeCallback::~ -CHIPCarbonDioxideConcentrationMeasurementGeneratedCommandListAttributeCallback() +CHIPCarbonDioxideConcentrationMeasurementGeneratedCommandListAttributeCallback:: + ~CHIPCarbonDioxideConcentrationMeasurementGeneratedCommandListAttributeCallback() { JNIEnv * env = chip::JniReferences::GetInstance().GetEnvForCurrentThread(); if (env == nullptr) @@ -45453,7 +45453,7 @@ void CHIPCarbonDioxideConcentrationMeasurementGeneratedCommandListAttributeCallb } CHIPCarbonDioxideConcentrationMeasurementAcceptedCommandListAttributeCallback:: -CHIPCarbonDioxideConcentrationMeasurementAcceptedCommandListAttributeCallback(jobject javaCallback, bool keepAlive) : + CHIPCarbonDioxideConcentrationMeasurementAcceptedCommandListAttributeCallback(jobject javaCallback, bool keepAlive) : chip::Callback::Callback(CallbackFn, this), keepAlive(keepAlive) @@ -45472,8 +45472,8 @@ CHIPCarbonDioxideConcentrationMeasurementAcceptedCommandListAttributeCallback(jo } } -CHIPCarbonDioxideConcentrationMeasurementAcceptedCommandListAttributeCallback::~ -CHIPCarbonDioxideConcentrationMeasurementAcceptedCommandListAttributeCallback() +CHIPCarbonDioxideConcentrationMeasurementAcceptedCommandListAttributeCallback:: + ~CHIPCarbonDioxideConcentrationMeasurementAcceptedCommandListAttributeCallback() { JNIEnv * env = chip::JniReferences::GetInstance().GetEnvForCurrentThread(); if (env == nullptr) @@ -45528,7 +45528,7 @@ void CHIPCarbonDioxideConcentrationMeasurementAcceptedCommandListAttributeCallba } CHIPCarbonDioxideConcentrationMeasurementEventListAttributeCallback:: -CHIPCarbonDioxideConcentrationMeasurementEventListAttributeCallback(jobject javaCallback, bool keepAlive) : + CHIPCarbonDioxideConcentrationMeasurementEventListAttributeCallback(jobject javaCallback, bool keepAlive) : chip::Callback::Callback(CallbackFn, this), keepAlive(keepAlive) { @@ -45546,8 +45546,8 @@ CHIPCarbonDioxideConcentrationMeasurementEventListAttributeCallback(jobject java } } -CHIPCarbonDioxideConcentrationMeasurementEventListAttributeCallback::~ -CHIPCarbonDioxideConcentrationMeasurementEventListAttributeCallback() +CHIPCarbonDioxideConcentrationMeasurementEventListAttributeCallback:: + ~CHIPCarbonDioxideConcentrationMeasurementEventListAttributeCallback() { JNIEnv * env = chip::JniReferences::GetInstance().GetEnvForCurrentThread(); if (env == nullptr) @@ -45601,7 +45601,7 @@ void CHIPCarbonDioxideConcentrationMeasurementEventListAttributeCallback::Callba } CHIPCarbonDioxideConcentrationMeasurementAttributeListAttributeCallback:: -CHIPCarbonDioxideConcentrationMeasurementAttributeListAttributeCallback(jobject javaCallback, bool keepAlive) : + CHIPCarbonDioxideConcentrationMeasurementAttributeListAttributeCallback(jobject javaCallback, bool keepAlive) : chip::Callback::Callback(CallbackFn, this), keepAlive(keepAlive) { @@ -45619,8 +45619,8 @@ CHIPCarbonDioxideConcentrationMeasurementAttributeListAttributeCallback(jobject } } -CHIPCarbonDioxideConcentrationMeasurementAttributeListAttributeCallback::~ -CHIPCarbonDioxideConcentrationMeasurementAttributeListAttributeCallback() +CHIPCarbonDioxideConcentrationMeasurementAttributeListAttributeCallback:: + ~CHIPCarbonDioxideConcentrationMeasurementAttributeListAttributeCallback() { JNIEnv * env = chip::JniReferences::GetInstance().GetEnvForCurrentThread(); if (env == nullptr) @@ -45674,7 +45674,7 @@ void CHIPCarbonDioxideConcentrationMeasurementAttributeListAttributeCallback::Ca } CHIPNitrogenDioxideConcentrationMeasurementMeasuredValueAttributeCallback:: -CHIPNitrogenDioxideConcentrationMeasurementMeasuredValueAttributeCallback(jobject javaCallback, bool keepAlive) : + CHIPNitrogenDioxideConcentrationMeasurementMeasuredValueAttributeCallback(jobject javaCallback, bool keepAlive) : chip::Callback::Callback(CallbackFn, this), keepAlive(keepAlive) @@ -45693,8 +45693,8 @@ CHIPNitrogenDioxideConcentrationMeasurementMeasuredValueAttributeCallback(jobjec } } -CHIPNitrogenDioxideConcentrationMeasurementMeasuredValueAttributeCallback::~ -CHIPNitrogenDioxideConcentrationMeasurementMeasuredValueAttributeCallback() +CHIPNitrogenDioxideConcentrationMeasurementMeasuredValueAttributeCallback:: + ~CHIPNitrogenDioxideConcentrationMeasurementMeasuredValueAttributeCallback() { JNIEnv * env = chip::JniReferences::GetInstance().GetEnvForCurrentThread(); if (env == nullptr) @@ -45744,7 +45744,7 @@ void CHIPNitrogenDioxideConcentrationMeasurementMeasuredValueAttributeCallback:: } CHIPNitrogenDioxideConcentrationMeasurementMinMeasuredValueAttributeCallback:: -CHIPNitrogenDioxideConcentrationMeasurementMinMeasuredValueAttributeCallback(jobject javaCallback, bool keepAlive) : + CHIPNitrogenDioxideConcentrationMeasurementMinMeasuredValueAttributeCallback(jobject javaCallback, bool keepAlive) : chip::Callback::Callback(CallbackFn, this), keepAlive(keepAlive) @@ -45763,8 +45763,8 @@ CHIPNitrogenDioxideConcentrationMeasurementMinMeasuredValueAttributeCallback(job } } -CHIPNitrogenDioxideConcentrationMeasurementMinMeasuredValueAttributeCallback::~ -CHIPNitrogenDioxideConcentrationMeasurementMinMeasuredValueAttributeCallback() +CHIPNitrogenDioxideConcentrationMeasurementMinMeasuredValueAttributeCallback:: + ~CHIPNitrogenDioxideConcentrationMeasurementMinMeasuredValueAttributeCallback() { JNIEnv * env = chip::JniReferences::GetInstance().GetEnvForCurrentThread(); if (env == nullptr) @@ -45815,7 +45815,7 @@ void CHIPNitrogenDioxideConcentrationMeasurementMinMeasuredValueAttributeCallbac } CHIPNitrogenDioxideConcentrationMeasurementMaxMeasuredValueAttributeCallback:: -CHIPNitrogenDioxideConcentrationMeasurementMaxMeasuredValueAttributeCallback(jobject javaCallback, bool keepAlive) : + CHIPNitrogenDioxideConcentrationMeasurementMaxMeasuredValueAttributeCallback(jobject javaCallback, bool keepAlive) : chip::Callback::Callback(CallbackFn, this), keepAlive(keepAlive) @@ -45834,8 +45834,8 @@ CHIPNitrogenDioxideConcentrationMeasurementMaxMeasuredValueAttributeCallback(job } } -CHIPNitrogenDioxideConcentrationMeasurementMaxMeasuredValueAttributeCallback::~ -CHIPNitrogenDioxideConcentrationMeasurementMaxMeasuredValueAttributeCallback() +CHIPNitrogenDioxideConcentrationMeasurementMaxMeasuredValueAttributeCallback:: + ~CHIPNitrogenDioxideConcentrationMeasurementMaxMeasuredValueAttributeCallback() { JNIEnv * env = chip::JniReferences::GetInstance().GetEnvForCurrentThread(); if (env == nullptr) @@ -45886,7 +45886,7 @@ void CHIPNitrogenDioxideConcentrationMeasurementMaxMeasuredValueAttributeCallbac } CHIPNitrogenDioxideConcentrationMeasurementPeakMeasuredValueAttributeCallback:: -CHIPNitrogenDioxideConcentrationMeasurementPeakMeasuredValueAttributeCallback(jobject javaCallback, bool keepAlive) : + CHIPNitrogenDioxideConcentrationMeasurementPeakMeasuredValueAttributeCallback(jobject javaCallback, bool keepAlive) : chip::Callback::Callback(CallbackFn, this), keepAlive(keepAlive) @@ -45905,8 +45905,8 @@ CHIPNitrogenDioxideConcentrationMeasurementPeakMeasuredValueAttributeCallback(jo } } -CHIPNitrogenDioxideConcentrationMeasurementPeakMeasuredValueAttributeCallback::~ -CHIPNitrogenDioxideConcentrationMeasurementPeakMeasuredValueAttributeCallback() +CHIPNitrogenDioxideConcentrationMeasurementPeakMeasuredValueAttributeCallback:: + ~CHIPNitrogenDioxideConcentrationMeasurementPeakMeasuredValueAttributeCallback() { JNIEnv * env = chip::JniReferences::GetInstance().GetEnvForCurrentThread(); if (env == nullptr) @@ -45957,7 +45957,7 @@ void CHIPNitrogenDioxideConcentrationMeasurementPeakMeasuredValueAttributeCallba } CHIPNitrogenDioxideConcentrationMeasurementAverageMeasuredValueAttributeCallback:: -CHIPNitrogenDioxideConcentrationMeasurementAverageMeasuredValueAttributeCallback(jobject javaCallback, bool keepAlive) : + CHIPNitrogenDioxideConcentrationMeasurementAverageMeasuredValueAttributeCallback(jobject javaCallback, bool keepAlive) : chip::Callback::Callback( CallbackFn, this), keepAlive(keepAlive) @@ -45976,8 +45976,8 @@ CHIPNitrogenDioxideConcentrationMeasurementAverageMeasuredValueAttributeCallback } } -CHIPNitrogenDioxideConcentrationMeasurementAverageMeasuredValueAttributeCallback::~ -CHIPNitrogenDioxideConcentrationMeasurementAverageMeasuredValueAttributeCallback() +CHIPNitrogenDioxideConcentrationMeasurementAverageMeasuredValueAttributeCallback:: + ~CHIPNitrogenDioxideConcentrationMeasurementAverageMeasuredValueAttributeCallback() { JNIEnv * env = chip::JniReferences::GetInstance().GetEnvForCurrentThread(); if (env == nullptr) @@ -46028,7 +46028,7 @@ void CHIPNitrogenDioxideConcentrationMeasurementAverageMeasuredValueAttributeCal } CHIPNitrogenDioxideConcentrationMeasurementGeneratedCommandListAttributeCallback:: -CHIPNitrogenDioxideConcentrationMeasurementGeneratedCommandListAttributeCallback(jobject javaCallback, bool keepAlive) : + CHIPNitrogenDioxideConcentrationMeasurementGeneratedCommandListAttributeCallback(jobject javaCallback, bool keepAlive) : chip::Callback::Callback( CallbackFn, this), keepAlive(keepAlive) @@ -46047,8 +46047,8 @@ CHIPNitrogenDioxideConcentrationMeasurementGeneratedCommandListAttributeCallback } } -CHIPNitrogenDioxideConcentrationMeasurementGeneratedCommandListAttributeCallback::~ -CHIPNitrogenDioxideConcentrationMeasurementGeneratedCommandListAttributeCallback() +CHIPNitrogenDioxideConcentrationMeasurementGeneratedCommandListAttributeCallback:: + ~CHIPNitrogenDioxideConcentrationMeasurementGeneratedCommandListAttributeCallback() { JNIEnv * env = chip::JniReferences::GetInstance().GetEnvForCurrentThread(); if (env == nullptr) @@ -46103,7 +46103,7 @@ void CHIPNitrogenDioxideConcentrationMeasurementGeneratedCommandListAttributeCal } CHIPNitrogenDioxideConcentrationMeasurementAcceptedCommandListAttributeCallback:: -CHIPNitrogenDioxideConcentrationMeasurementAcceptedCommandListAttributeCallback(jobject javaCallback, bool keepAlive) : + CHIPNitrogenDioxideConcentrationMeasurementAcceptedCommandListAttributeCallback(jobject javaCallback, bool keepAlive) : chip::Callback::Callback(CallbackFn, this), keepAlive(keepAlive) @@ -46122,8 +46122,8 @@ CHIPNitrogenDioxideConcentrationMeasurementAcceptedCommandListAttributeCallback( } } -CHIPNitrogenDioxideConcentrationMeasurementAcceptedCommandListAttributeCallback::~ -CHIPNitrogenDioxideConcentrationMeasurementAcceptedCommandListAttributeCallback() +CHIPNitrogenDioxideConcentrationMeasurementAcceptedCommandListAttributeCallback:: + ~CHIPNitrogenDioxideConcentrationMeasurementAcceptedCommandListAttributeCallback() { JNIEnv * env = chip::JniReferences::GetInstance().GetEnvForCurrentThread(); if (env == nullptr) @@ -46178,7 +46178,7 @@ void CHIPNitrogenDioxideConcentrationMeasurementAcceptedCommandListAttributeCall } CHIPNitrogenDioxideConcentrationMeasurementEventListAttributeCallback:: -CHIPNitrogenDioxideConcentrationMeasurementEventListAttributeCallback(jobject javaCallback, bool keepAlive) : + CHIPNitrogenDioxideConcentrationMeasurementEventListAttributeCallback(jobject javaCallback, bool keepAlive) : chip::Callback::Callback(CallbackFn, this), keepAlive(keepAlive) { @@ -46196,8 +46196,8 @@ CHIPNitrogenDioxideConcentrationMeasurementEventListAttributeCallback(jobject ja } } -CHIPNitrogenDioxideConcentrationMeasurementEventListAttributeCallback::~ -CHIPNitrogenDioxideConcentrationMeasurementEventListAttributeCallback() +CHIPNitrogenDioxideConcentrationMeasurementEventListAttributeCallback:: + ~CHIPNitrogenDioxideConcentrationMeasurementEventListAttributeCallback() { JNIEnv * env = chip::JniReferences::GetInstance().GetEnvForCurrentThread(); if (env == nullptr) @@ -46251,7 +46251,7 @@ void CHIPNitrogenDioxideConcentrationMeasurementEventListAttributeCallback::Call } CHIPNitrogenDioxideConcentrationMeasurementAttributeListAttributeCallback:: -CHIPNitrogenDioxideConcentrationMeasurementAttributeListAttributeCallback(jobject javaCallback, bool keepAlive) : + CHIPNitrogenDioxideConcentrationMeasurementAttributeListAttributeCallback(jobject javaCallback, bool keepAlive) : chip::Callback::Callback(CallbackFn, this), keepAlive(keepAlive) @@ -46270,8 +46270,8 @@ CHIPNitrogenDioxideConcentrationMeasurementAttributeListAttributeCallback(jobjec } } -CHIPNitrogenDioxideConcentrationMeasurementAttributeListAttributeCallback::~ -CHIPNitrogenDioxideConcentrationMeasurementAttributeListAttributeCallback() +CHIPNitrogenDioxideConcentrationMeasurementAttributeListAttributeCallback:: + ~CHIPNitrogenDioxideConcentrationMeasurementAttributeListAttributeCallback() { JNIEnv * env = chip::JniReferences::GetInstance().GetEnvForCurrentThread(); if (env == nullptr) @@ -46393,7 +46393,7 @@ void CHIPOzoneConcentrationMeasurementMeasuredValueAttributeCallback::CallbackFn } CHIPOzoneConcentrationMeasurementMinMeasuredValueAttributeCallback:: -CHIPOzoneConcentrationMeasurementMinMeasuredValueAttributeCallback(jobject javaCallback, bool keepAlive) : + CHIPOzoneConcentrationMeasurementMinMeasuredValueAttributeCallback(jobject javaCallback, bool keepAlive) : chip::Callback::Callback(CallbackFn, this), keepAlive(keepAlive) { @@ -46411,8 +46411,8 @@ CHIPOzoneConcentrationMeasurementMinMeasuredValueAttributeCallback(jobject javaC } } -CHIPOzoneConcentrationMeasurementMinMeasuredValueAttributeCallback::~ -CHIPOzoneConcentrationMeasurementMinMeasuredValueAttributeCallback() +CHIPOzoneConcentrationMeasurementMinMeasuredValueAttributeCallback:: + ~CHIPOzoneConcentrationMeasurementMinMeasuredValueAttributeCallback() { JNIEnv * env = chip::JniReferences::GetInstance().GetEnvForCurrentThread(); if (env == nullptr) @@ -46462,7 +46462,7 @@ void CHIPOzoneConcentrationMeasurementMinMeasuredValueAttributeCallback::Callbac } CHIPOzoneConcentrationMeasurementMaxMeasuredValueAttributeCallback:: -CHIPOzoneConcentrationMeasurementMaxMeasuredValueAttributeCallback(jobject javaCallback, bool keepAlive) : + CHIPOzoneConcentrationMeasurementMaxMeasuredValueAttributeCallback(jobject javaCallback, bool keepAlive) : chip::Callback::Callback(CallbackFn, this), keepAlive(keepAlive) { @@ -46480,8 +46480,8 @@ CHIPOzoneConcentrationMeasurementMaxMeasuredValueAttributeCallback(jobject javaC } } -CHIPOzoneConcentrationMeasurementMaxMeasuredValueAttributeCallback::~ -CHIPOzoneConcentrationMeasurementMaxMeasuredValueAttributeCallback() +CHIPOzoneConcentrationMeasurementMaxMeasuredValueAttributeCallback:: + ~CHIPOzoneConcentrationMeasurementMaxMeasuredValueAttributeCallback() { JNIEnv * env = chip::JniReferences::GetInstance().GetEnvForCurrentThread(); if (env == nullptr) @@ -46531,7 +46531,7 @@ void CHIPOzoneConcentrationMeasurementMaxMeasuredValueAttributeCallback::Callbac } CHIPOzoneConcentrationMeasurementPeakMeasuredValueAttributeCallback:: -CHIPOzoneConcentrationMeasurementPeakMeasuredValueAttributeCallback(jobject javaCallback, bool keepAlive) : + CHIPOzoneConcentrationMeasurementPeakMeasuredValueAttributeCallback(jobject javaCallback, bool keepAlive) : chip::Callback::Callback(CallbackFn, this), keepAlive(keepAlive) { @@ -46549,8 +46549,8 @@ CHIPOzoneConcentrationMeasurementPeakMeasuredValueAttributeCallback(jobject java } } -CHIPOzoneConcentrationMeasurementPeakMeasuredValueAttributeCallback::~ -CHIPOzoneConcentrationMeasurementPeakMeasuredValueAttributeCallback() +CHIPOzoneConcentrationMeasurementPeakMeasuredValueAttributeCallback:: + ~CHIPOzoneConcentrationMeasurementPeakMeasuredValueAttributeCallback() { JNIEnv * env = chip::JniReferences::GetInstance().GetEnvForCurrentThread(); if (env == nullptr) @@ -46600,7 +46600,7 @@ void CHIPOzoneConcentrationMeasurementPeakMeasuredValueAttributeCallback::Callba } CHIPOzoneConcentrationMeasurementAverageMeasuredValueAttributeCallback:: -CHIPOzoneConcentrationMeasurementAverageMeasuredValueAttributeCallback(jobject javaCallback, bool keepAlive) : + CHIPOzoneConcentrationMeasurementAverageMeasuredValueAttributeCallback(jobject javaCallback, bool keepAlive) : chip::Callback::Callback(CallbackFn, this), keepAlive(keepAlive) { @@ -46618,8 +46618,8 @@ CHIPOzoneConcentrationMeasurementAverageMeasuredValueAttributeCallback(jobject j } } -CHIPOzoneConcentrationMeasurementAverageMeasuredValueAttributeCallback::~ -CHIPOzoneConcentrationMeasurementAverageMeasuredValueAttributeCallback() +CHIPOzoneConcentrationMeasurementAverageMeasuredValueAttributeCallback:: + ~CHIPOzoneConcentrationMeasurementAverageMeasuredValueAttributeCallback() { JNIEnv * env = chip::JniReferences::GetInstance().GetEnvForCurrentThread(); if (env == nullptr) @@ -46669,7 +46669,7 @@ void CHIPOzoneConcentrationMeasurementAverageMeasuredValueAttributeCallback::Cal } CHIPOzoneConcentrationMeasurementGeneratedCommandListAttributeCallback:: -CHIPOzoneConcentrationMeasurementGeneratedCommandListAttributeCallback(jobject javaCallback, bool keepAlive) : + CHIPOzoneConcentrationMeasurementGeneratedCommandListAttributeCallback(jobject javaCallback, bool keepAlive) : chip::Callback::Callback(CallbackFn, this), keepAlive(keepAlive) { @@ -46687,8 +46687,8 @@ CHIPOzoneConcentrationMeasurementGeneratedCommandListAttributeCallback(jobject j } } -CHIPOzoneConcentrationMeasurementGeneratedCommandListAttributeCallback::~ -CHIPOzoneConcentrationMeasurementGeneratedCommandListAttributeCallback() +CHIPOzoneConcentrationMeasurementGeneratedCommandListAttributeCallback:: + ~CHIPOzoneConcentrationMeasurementGeneratedCommandListAttributeCallback() { JNIEnv * env = chip::JniReferences::GetInstance().GetEnvForCurrentThread(); if (env == nullptr) @@ -46742,7 +46742,7 @@ void CHIPOzoneConcentrationMeasurementGeneratedCommandListAttributeCallback::Cal } CHIPOzoneConcentrationMeasurementAcceptedCommandListAttributeCallback:: -CHIPOzoneConcentrationMeasurementAcceptedCommandListAttributeCallback(jobject javaCallback, bool keepAlive) : + CHIPOzoneConcentrationMeasurementAcceptedCommandListAttributeCallback(jobject javaCallback, bool keepAlive) : chip::Callback::Callback(CallbackFn, this), keepAlive(keepAlive) { @@ -46760,8 +46760,8 @@ CHIPOzoneConcentrationMeasurementAcceptedCommandListAttributeCallback(jobject ja } } -CHIPOzoneConcentrationMeasurementAcceptedCommandListAttributeCallback::~ -CHIPOzoneConcentrationMeasurementAcceptedCommandListAttributeCallback() +CHIPOzoneConcentrationMeasurementAcceptedCommandListAttributeCallback:: + ~CHIPOzoneConcentrationMeasurementAcceptedCommandListAttributeCallback() { JNIEnv * env = chip::JniReferences::GetInstance().GetEnvForCurrentThread(); if (env == nullptr) @@ -47027,7 +47027,7 @@ void CHIPPm25ConcentrationMeasurementMeasuredValueAttributeCallback::CallbackFn( } CHIPPm25ConcentrationMeasurementMinMeasuredValueAttributeCallback:: -CHIPPm25ConcentrationMeasurementMinMeasuredValueAttributeCallback(jobject javaCallback, bool keepAlive) : + CHIPPm25ConcentrationMeasurementMinMeasuredValueAttributeCallback(jobject javaCallback, bool keepAlive) : chip::Callback::Callback(CallbackFn, this), keepAlive(keepAlive) { @@ -47045,8 +47045,8 @@ CHIPPm25ConcentrationMeasurementMinMeasuredValueAttributeCallback(jobject javaCa } } -CHIPPm25ConcentrationMeasurementMinMeasuredValueAttributeCallback::~ -CHIPPm25ConcentrationMeasurementMinMeasuredValueAttributeCallback() +CHIPPm25ConcentrationMeasurementMinMeasuredValueAttributeCallback:: + ~CHIPPm25ConcentrationMeasurementMinMeasuredValueAttributeCallback() { JNIEnv * env = chip::JniReferences::GetInstance().GetEnvForCurrentThread(); if (env == nullptr) @@ -47096,7 +47096,7 @@ void CHIPPm25ConcentrationMeasurementMinMeasuredValueAttributeCallback::Callback } CHIPPm25ConcentrationMeasurementMaxMeasuredValueAttributeCallback:: -CHIPPm25ConcentrationMeasurementMaxMeasuredValueAttributeCallback(jobject javaCallback, bool keepAlive) : + CHIPPm25ConcentrationMeasurementMaxMeasuredValueAttributeCallback(jobject javaCallback, bool keepAlive) : chip::Callback::Callback(CallbackFn, this), keepAlive(keepAlive) { @@ -47114,8 +47114,8 @@ CHIPPm25ConcentrationMeasurementMaxMeasuredValueAttributeCallback(jobject javaCa } } -CHIPPm25ConcentrationMeasurementMaxMeasuredValueAttributeCallback::~ -CHIPPm25ConcentrationMeasurementMaxMeasuredValueAttributeCallback() +CHIPPm25ConcentrationMeasurementMaxMeasuredValueAttributeCallback:: + ~CHIPPm25ConcentrationMeasurementMaxMeasuredValueAttributeCallback() { JNIEnv * env = chip::JniReferences::GetInstance().GetEnvForCurrentThread(); if (env == nullptr) @@ -47165,7 +47165,7 @@ void CHIPPm25ConcentrationMeasurementMaxMeasuredValueAttributeCallback::Callback } CHIPPm25ConcentrationMeasurementPeakMeasuredValueAttributeCallback:: -CHIPPm25ConcentrationMeasurementPeakMeasuredValueAttributeCallback(jobject javaCallback, bool keepAlive) : + CHIPPm25ConcentrationMeasurementPeakMeasuredValueAttributeCallback(jobject javaCallback, bool keepAlive) : chip::Callback::Callback(CallbackFn, this), keepAlive(keepAlive) { @@ -47183,8 +47183,8 @@ CHIPPm25ConcentrationMeasurementPeakMeasuredValueAttributeCallback(jobject javaC } } -CHIPPm25ConcentrationMeasurementPeakMeasuredValueAttributeCallback::~ -CHIPPm25ConcentrationMeasurementPeakMeasuredValueAttributeCallback() +CHIPPm25ConcentrationMeasurementPeakMeasuredValueAttributeCallback:: + ~CHIPPm25ConcentrationMeasurementPeakMeasuredValueAttributeCallback() { JNIEnv * env = chip::JniReferences::GetInstance().GetEnvForCurrentThread(); if (env == nullptr) @@ -47234,7 +47234,7 @@ void CHIPPm25ConcentrationMeasurementPeakMeasuredValueAttributeCallback::Callbac } CHIPPm25ConcentrationMeasurementAverageMeasuredValueAttributeCallback:: -CHIPPm25ConcentrationMeasurementAverageMeasuredValueAttributeCallback(jobject javaCallback, bool keepAlive) : + CHIPPm25ConcentrationMeasurementAverageMeasuredValueAttributeCallback(jobject javaCallback, bool keepAlive) : chip::Callback::Callback(CallbackFn, this), keepAlive(keepAlive) { @@ -47252,8 +47252,8 @@ CHIPPm25ConcentrationMeasurementAverageMeasuredValueAttributeCallback(jobject ja } } -CHIPPm25ConcentrationMeasurementAverageMeasuredValueAttributeCallback::~ -CHIPPm25ConcentrationMeasurementAverageMeasuredValueAttributeCallback() +CHIPPm25ConcentrationMeasurementAverageMeasuredValueAttributeCallback:: + ~CHIPPm25ConcentrationMeasurementAverageMeasuredValueAttributeCallback() { JNIEnv * env = chip::JniReferences::GetInstance().GetEnvForCurrentThread(); if (env == nullptr) @@ -47303,7 +47303,7 @@ void CHIPPm25ConcentrationMeasurementAverageMeasuredValueAttributeCallback::Call } CHIPPm25ConcentrationMeasurementGeneratedCommandListAttributeCallback:: -CHIPPm25ConcentrationMeasurementGeneratedCommandListAttributeCallback(jobject javaCallback, bool keepAlive) : + CHIPPm25ConcentrationMeasurementGeneratedCommandListAttributeCallback(jobject javaCallback, bool keepAlive) : chip::Callback::Callback(CallbackFn, this), keepAlive(keepAlive) { @@ -47321,8 +47321,8 @@ CHIPPm25ConcentrationMeasurementGeneratedCommandListAttributeCallback(jobject ja } } -CHIPPm25ConcentrationMeasurementGeneratedCommandListAttributeCallback::~ -CHIPPm25ConcentrationMeasurementGeneratedCommandListAttributeCallback() +CHIPPm25ConcentrationMeasurementGeneratedCommandListAttributeCallback:: + ~CHIPPm25ConcentrationMeasurementGeneratedCommandListAttributeCallback() { JNIEnv * env = chip::JniReferences::GetInstance().GetEnvForCurrentThread(); if (env == nullptr) @@ -47376,7 +47376,7 @@ void CHIPPm25ConcentrationMeasurementGeneratedCommandListAttributeCallback::Call } CHIPPm25ConcentrationMeasurementAcceptedCommandListAttributeCallback:: -CHIPPm25ConcentrationMeasurementAcceptedCommandListAttributeCallback(jobject javaCallback, bool keepAlive) : + CHIPPm25ConcentrationMeasurementAcceptedCommandListAttributeCallback(jobject javaCallback, bool keepAlive) : chip::Callback::Callback(CallbackFn, this), keepAlive(keepAlive) { @@ -47394,8 +47394,8 @@ CHIPPm25ConcentrationMeasurementAcceptedCommandListAttributeCallback(jobject jav } } -CHIPPm25ConcentrationMeasurementAcceptedCommandListAttributeCallback::~ -CHIPPm25ConcentrationMeasurementAcceptedCommandListAttributeCallback() +CHIPPm25ConcentrationMeasurementAcceptedCommandListAttributeCallback:: + ~CHIPPm25ConcentrationMeasurementAcceptedCommandListAttributeCallback() { JNIEnv * env = chip::JniReferences::GetInstance().GetEnvForCurrentThread(); if (env == nullptr) @@ -47593,7 +47593,7 @@ void CHIPPm25ConcentrationMeasurementAttributeListAttributeCallback::CallbackFn( } CHIPFormaldehydeConcentrationMeasurementMeasuredValueAttributeCallback:: -CHIPFormaldehydeConcentrationMeasurementMeasuredValueAttributeCallback(jobject javaCallback, bool keepAlive) : + CHIPFormaldehydeConcentrationMeasurementMeasuredValueAttributeCallback(jobject javaCallback, bool keepAlive) : chip::Callback::Callback(CallbackFn, this), keepAlive(keepAlive) { @@ -47611,8 +47611,8 @@ CHIPFormaldehydeConcentrationMeasurementMeasuredValueAttributeCallback(jobject j } } -CHIPFormaldehydeConcentrationMeasurementMeasuredValueAttributeCallback::~ -CHIPFormaldehydeConcentrationMeasurementMeasuredValueAttributeCallback() +CHIPFormaldehydeConcentrationMeasurementMeasuredValueAttributeCallback:: + ~CHIPFormaldehydeConcentrationMeasurementMeasuredValueAttributeCallback() { JNIEnv * env = chip::JniReferences::GetInstance().GetEnvForCurrentThread(); if (env == nullptr) @@ -47662,7 +47662,7 @@ void CHIPFormaldehydeConcentrationMeasurementMeasuredValueAttributeCallback::Cal } CHIPFormaldehydeConcentrationMeasurementMinMeasuredValueAttributeCallback:: -CHIPFormaldehydeConcentrationMeasurementMinMeasuredValueAttributeCallback(jobject javaCallback, bool keepAlive) : + CHIPFormaldehydeConcentrationMeasurementMinMeasuredValueAttributeCallback(jobject javaCallback, bool keepAlive) : chip::Callback::Callback(CallbackFn, this), keepAlive(keepAlive) @@ -47681,8 +47681,8 @@ CHIPFormaldehydeConcentrationMeasurementMinMeasuredValueAttributeCallback(jobjec } } -CHIPFormaldehydeConcentrationMeasurementMinMeasuredValueAttributeCallback::~ -CHIPFormaldehydeConcentrationMeasurementMinMeasuredValueAttributeCallback() +CHIPFormaldehydeConcentrationMeasurementMinMeasuredValueAttributeCallback:: + ~CHIPFormaldehydeConcentrationMeasurementMinMeasuredValueAttributeCallback() { JNIEnv * env = chip::JniReferences::GetInstance().GetEnvForCurrentThread(); if (env == nullptr) @@ -47732,7 +47732,7 @@ void CHIPFormaldehydeConcentrationMeasurementMinMeasuredValueAttributeCallback:: } CHIPFormaldehydeConcentrationMeasurementMaxMeasuredValueAttributeCallback:: -CHIPFormaldehydeConcentrationMeasurementMaxMeasuredValueAttributeCallback(jobject javaCallback, bool keepAlive) : + CHIPFormaldehydeConcentrationMeasurementMaxMeasuredValueAttributeCallback(jobject javaCallback, bool keepAlive) : chip::Callback::Callback(CallbackFn, this), keepAlive(keepAlive) @@ -47751,8 +47751,8 @@ CHIPFormaldehydeConcentrationMeasurementMaxMeasuredValueAttributeCallback(jobjec } } -CHIPFormaldehydeConcentrationMeasurementMaxMeasuredValueAttributeCallback::~ -CHIPFormaldehydeConcentrationMeasurementMaxMeasuredValueAttributeCallback() +CHIPFormaldehydeConcentrationMeasurementMaxMeasuredValueAttributeCallback:: + ~CHIPFormaldehydeConcentrationMeasurementMaxMeasuredValueAttributeCallback() { JNIEnv * env = chip::JniReferences::GetInstance().GetEnvForCurrentThread(); if (env == nullptr) @@ -47802,7 +47802,7 @@ void CHIPFormaldehydeConcentrationMeasurementMaxMeasuredValueAttributeCallback:: } CHIPFormaldehydeConcentrationMeasurementPeakMeasuredValueAttributeCallback:: -CHIPFormaldehydeConcentrationMeasurementPeakMeasuredValueAttributeCallback(jobject javaCallback, bool keepAlive) : + CHIPFormaldehydeConcentrationMeasurementPeakMeasuredValueAttributeCallback(jobject javaCallback, bool keepAlive) : chip::Callback::Callback(CallbackFn, this), keepAlive(keepAlive) @@ -47821,8 +47821,8 @@ CHIPFormaldehydeConcentrationMeasurementPeakMeasuredValueAttributeCallback(jobje } } -CHIPFormaldehydeConcentrationMeasurementPeakMeasuredValueAttributeCallback::~ -CHIPFormaldehydeConcentrationMeasurementPeakMeasuredValueAttributeCallback() +CHIPFormaldehydeConcentrationMeasurementPeakMeasuredValueAttributeCallback:: + ~CHIPFormaldehydeConcentrationMeasurementPeakMeasuredValueAttributeCallback() { JNIEnv * env = chip::JniReferences::GetInstance().GetEnvForCurrentThread(); if (env == nullptr) @@ -47873,7 +47873,7 @@ void CHIPFormaldehydeConcentrationMeasurementPeakMeasuredValueAttributeCallback: } CHIPFormaldehydeConcentrationMeasurementAverageMeasuredValueAttributeCallback:: -CHIPFormaldehydeConcentrationMeasurementAverageMeasuredValueAttributeCallback(jobject javaCallback, bool keepAlive) : + CHIPFormaldehydeConcentrationMeasurementAverageMeasuredValueAttributeCallback(jobject javaCallback, bool keepAlive) : chip::Callback::Callback(CallbackFn, this), keepAlive(keepAlive) @@ -47892,8 +47892,8 @@ CHIPFormaldehydeConcentrationMeasurementAverageMeasuredValueAttributeCallback(jo } } -CHIPFormaldehydeConcentrationMeasurementAverageMeasuredValueAttributeCallback::~ -CHIPFormaldehydeConcentrationMeasurementAverageMeasuredValueAttributeCallback() +CHIPFormaldehydeConcentrationMeasurementAverageMeasuredValueAttributeCallback:: + ~CHIPFormaldehydeConcentrationMeasurementAverageMeasuredValueAttributeCallback() { JNIEnv * env = chip::JniReferences::GetInstance().GetEnvForCurrentThread(); if (env == nullptr) @@ -47944,7 +47944,7 @@ void CHIPFormaldehydeConcentrationMeasurementAverageMeasuredValueAttributeCallba } CHIPFormaldehydeConcentrationMeasurementGeneratedCommandListAttributeCallback:: -CHIPFormaldehydeConcentrationMeasurementGeneratedCommandListAttributeCallback(jobject javaCallback, bool keepAlive) : + CHIPFormaldehydeConcentrationMeasurementGeneratedCommandListAttributeCallback(jobject javaCallback, bool keepAlive) : chip::Callback::Callback(CallbackFn, this), keepAlive(keepAlive) @@ -47963,8 +47963,8 @@ CHIPFormaldehydeConcentrationMeasurementGeneratedCommandListAttributeCallback(jo } } -CHIPFormaldehydeConcentrationMeasurementGeneratedCommandListAttributeCallback::~ -CHIPFormaldehydeConcentrationMeasurementGeneratedCommandListAttributeCallback() +CHIPFormaldehydeConcentrationMeasurementGeneratedCommandListAttributeCallback:: + ~CHIPFormaldehydeConcentrationMeasurementGeneratedCommandListAttributeCallback() { JNIEnv * env = chip::JniReferences::GetInstance().GetEnvForCurrentThread(); if (env == nullptr) @@ -48019,7 +48019,7 @@ void CHIPFormaldehydeConcentrationMeasurementGeneratedCommandListAttributeCallba } CHIPFormaldehydeConcentrationMeasurementAcceptedCommandListAttributeCallback:: -CHIPFormaldehydeConcentrationMeasurementAcceptedCommandListAttributeCallback(jobject javaCallback, bool keepAlive) : + CHIPFormaldehydeConcentrationMeasurementAcceptedCommandListAttributeCallback(jobject javaCallback, bool keepAlive) : chip::Callback::Callback(CallbackFn, this), keepAlive(keepAlive) @@ -48038,8 +48038,8 @@ CHIPFormaldehydeConcentrationMeasurementAcceptedCommandListAttributeCallback(job } } -CHIPFormaldehydeConcentrationMeasurementAcceptedCommandListAttributeCallback::~ -CHIPFormaldehydeConcentrationMeasurementAcceptedCommandListAttributeCallback() +CHIPFormaldehydeConcentrationMeasurementAcceptedCommandListAttributeCallback:: + ~CHIPFormaldehydeConcentrationMeasurementAcceptedCommandListAttributeCallback() { JNIEnv * env = chip::JniReferences::GetInstance().GetEnvForCurrentThread(); if (env == nullptr) @@ -48094,7 +48094,7 @@ void CHIPFormaldehydeConcentrationMeasurementAcceptedCommandListAttributeCallbac } CHIPFormaldehydeConcentrationMeasurementEventListAttributeCallback:: -CHIPFormaldehydeConcentrationMeasurementEventListAttributeCallback(jobject javaCallback, bool keepAlive) : + CHIPFormaldehydeConcentrationMeasurementEventListAttributeCallback(jobject javaCallback, bool keepAlive) : chip::Callback::Callback(CallbackFn, this), keepAlive(keepAlive) { @@ -48112,8 +48112,8 @@ CHIPFormaldehydeConcentrationMeasurementEventListAttributeCallback(jobject javaC } } -CHIPFormaldehydeConcentrationMeasurementEventListAttributeCallback::~ -CHIPFormaldehydeConcentrationMeasurementEventListAttributeCallback() +CHIPFormaldehydeConcentrationMeasurementEventListAttributeCallback:: + ~CHIPFormaldehydeConcentrationMeasurementEventListAttributeCallback() { JNIEnv * env = chip::JniReferences::GetInstance().GetEnvForCurrentThread(); if (env == nullptr) @@ -48167,7 +48167,7 @@ void CHIPFormaldehydeConcentrationMeasurementEventListAttributeCallback::Callbac } CHIPFormaldehydeConcentrationMeasurementAttributeListAttributeCallback:: -CHIPFormaldehydeConcentrationMeasurementAttributeListAttributeCallback(jobject javaCallback, bool keepAlive) : + CHIPFormaldehydeConcentrationMeasurementAttributeListAttributeCallback(jobject javaCallback, bool keepAlive) : chip::Callback::Callback(CallbackFn, this), keepAlive(keepAlive) { @@ -48185,8 +48185,8 @@ CHIPFormaldehydeConcentrationMeasurementAttributeListAttributeCallback(jobject j } } -CHIPFormaldehydeConcentrationMeasurementAttributeListAttributeCallback::~ -CHIPFormaldehydeConcentrationMeasurementAttributeListAttributeCallback() +CHIPFormaldehydeConcentrationMeasurementAttributeListAttributeCallback:: + ~CHIPFormaldehydeConcentrationMeasurementAttributeListAttributeCallback() { JNIEnv * env = chip::JniReferences::GetInstance().GetEnvForCurrentThread(); if (env == nullptr) @@ -48326,8 +48326,8 @@ CHIPPm1ConcentrationMeasurementMinMeasuredValueAttributeCallback::CHIPPm1Concent } } -CHIPPm1ConcentrationMeasurementMinMeasuredValueAttributeCallback::~ -CHIPPm1ConcentrationMeasurementMinMeasuredValueAttributeCallback() +CHIPPm1ConcentrationMeasurementMinMeasuredValueAttributeCallback:: + ~CHIPPm1ConcentrationMeasurementMinMeasuredValueAttributeCallback() { JNIEnv * env = chip::JniReferences::GetInstance().GetEnvForCurrentThread(); if (env == nullptr) @@ -48395,8 +48395,8 @@ CHIPPm1ConcentrationMeasurementMaxMeasuredValueAttributeCallback::CHIPPm1Concent } } -CHIPPm1ConcentrationMeasurementMaxMeasuredValueAttributeCallback::~ -CHIPPm1ConcentrationMeasurementMaxMeasuredValueAttributeCallback() +CHIPPm1ConcentrationMeasurementMaxMeasuredValueAttributeCallback:: + ~CHIPPm1ConcentrationMeasurementMaxMeasuredValueAttributeCallback() { JNIEnv * env = chip::JniReferences::GetInstance().GetEnvForCurrentThread(); if (env == nullptr) @@ -48446,7 +48446,7 @@ void CHIPPm1ConcentrationMeasurementMaxMeasuredValueAttributeCallback::CallbackF } CHIPPm1ConcentrationMeasurementPeakMeasuredValueAttributeCallback:: -CHIPPm1ConcentrationMeasurementPeakMeasuredValueAttributeCallback(jobject javaCallback, bool keepAlive) : + CHIPPm1ConcentrationMeasurementPeakMeasuredValueAttributeCallback(jobject javaCallback, bool keepAlive) : chip::Callback::Callback(CallbackFn, this), keepAlive(keepAlive) { @@ -48464,8 +48464,8 @@ CHIPPm1ConcentrationMeasurementPeakMeasuredValueAttributeCallback(jobject javaCa } } -CHIPPm1ConcentrationMeasurementPeakMeasuredValueAttributeCallback::~ -CHIPPm1ConcentrationMeasurementPeakMeasuredValueAttributeCallback() +CHIPPm1ConcentrationMeasurementPeakMeasuredValueAttributeCallback:: + ~CHIPPm1ConcentrationMeasurementPeakMeasuredValueAttributeCallback() { JNIEnv * env = chip::JniReferences::GetInstance().GetEnvForCurrentThread(); if (env == nullptr) @@ -48515,7 +48515,7 @@ void CHIPPm1ConcentrationMeasurementPeakMeasuredValueAttributeCallback::Callback } CHIPPm1ConcentrationMeasurementAverageMeasuredValueAttributeCallback:: -CHIPPm1ConcentrationMeasurementAverageMeasuredValueAttributeCallback(jobject javaCallback, bool keepAlive) : + CHIPPm1ConcentrationMeasurementAverageMeasuredValueAttributeCallback(jobject javaCallback, bool keepAlive) : chip::Callback::Callback(CallbackFn, this), keepAlive(keepAlive) { @@ -48533,8 +48533,8 @@ CHIPPm1ConcentrationMeasurementAverageMeasuredValueAttributeCallback(jobject jav } } -CHIPPm1ConcentrationMeasurementAverageMeasuredValueAttributeCallback::~ -CHIPPm1ConcentrationMeasurementAverageMeasuredValueAttributeCallback() +CHIPPm1ConcentrationMeasurementAverageMeasuredValueAttributeCallback:: + ~CHIPPm1ConcentrationMeasurementAverageMeasuredValueAttributeCallback() { JNIEnv * env = chip::JniReferences::GetInstance().GetEnvForCurrentThread(); if (env == nullptr) @@ -48584,7 +48584,7 @@ void CHIPPm1ConcentrationMeasurementAverageMeasuredValueAttributeCallback::Callb } CHIPPm1ConcentrationMeasurementGeneratedCommandListAttributeCallback:: -CHIPPm1ConcentrationMeasurementGeneratedCommandListAttributeCallback(jobject javaCallback, bool keepAlive) : + CHIPPm1ConcentrationMeasurementGeneratedCommandListAttributeCallback(jobject javaCallback, bool keepAlive) : chip::Callback::Callback(CallbackFn, this), keepAlive(keepAlive) { @@ -48602,8 +48602,8 @@ CHIPPm1ConcentrationMeasurementGeneratedCommandListAttributeCallback(jobject jav } } -CHIPPm1ConcentrationMeasurementGeneratedCommandListAttributeCallback::~ -CHIPPm1ConcentrationMeasurementGeneratedCommandListAttributeCallback() +CHIPPm1ConcentrationMeasurementGeneratedCommandListAttributeCallback:: + ~CHIPPm1ConcentrationMeasurementGeneratedCommandListAttributeCallback() { JNIEnv * env = chip::JniReferences::GetInstance().GetEnvForCurrentThread(); if (env == nullptr) @@ -48657,7 +48657,7 @@ void CHIPPm1ConcentrationMeasurementGeneratedCommandListAttributeCallback::Callb } CHIPPm1ConcentrationMeasurementAcceptedCommandListAttributeCallback:: -CHIPPm1ConcentrationMeasurementAcceptedCommandListAttributeCallback(jobject javaCallback, bool keepAlive) : + CHIPPm1ConcentrationMeasurementAcceptedCommandListAttributeCallback(jobject javaCallback, bool keepAlive) : chip::Callback::Callback(CallbackFn, this), keepAlive(keepAlive) { @@ -48675,8 +48675,8 @@ CHIPPm1ConcentrationMeasurementAcceptedCommandListAttributeCallback(jobject java } } -CHIPPm1ConcentrationMeasurementAcceptedCommandListAttributeCallback::~ -CHIPPm1ConcentrationMeasurementAcceptedCommandListAttributeCallback() +CHIPPm1ConcentrationMeasurementAcceptedCommandListAttributeCallback:: + ~CHIPPm1ConcentrationMeasurementAcceptedCommandListAttributeCallback() { JNIEnv * env = chip::JniReferences::GetInstance().GetEnvForCurrentThread(); if (env == nullptr) @@ -48942,7 +48942,7 @@ void CHIPPm10ConcentrationMeasurementMeasuredValueAttributeCallback::CallbackFn( } CHIPPm10ConcentrationMeasurementMinMeasuredValueAttributeCallback:: -CHIPPm10ConcentrationMeasurementMinMeasuredValueAttributeCallback(jobject javaCallback, bool keepAlive) : + CHIPPm10ConcentrationMeasurementMinMeasuredValueAttributeCallback(jobject javaCallback, bool keepAlive) : chip::Callback::Callback(CallbackFn, this), keepAlive(keepAlive) { @@ -48960,8 +48960,8 @@ CHIPPm10ConcentrationMeasurementMinMeasuredValueAttributeCallback(jobject javaCa } } -CHIPPm10ConcentrationMeasurementMinMeasuredValueAttributeCallback::~ -CHIPPm10ConcentrationMeasurementMinMeasuredValueAttributeCallback() +CHIPPm10ConcentrationMeasurementMinMeasuredValueAttributeCallback:: + ~CHIPPm10ConcentrationMeasurementMinMeasuredValueAttributeCallback() { JNIEnv * env = chip::JniReferences::GetInstance().GetEnvForCurrentThread(); if (env == nullptr) @@ -49011,7 +49011,7 @@ void CHIPPm10ConcentrationMeasurementMinMeasuredValueAttributeCallback::Callback } CHIPPm10ConcentrationMeasurementMaxMeasuredValueAttributeCallback:: -CHIPPm10ConcentrationMeasurementMaxMeasuredValueAttributeCallback(jobject javaCallback, bool keepAlive) : + CHIPPm10ConcentrationMeasurementMaxMeasuredValueAttributeCallback(jobject javaCallback, bool keepAlive) : chip::Callback::Callback(CallbackFn, this), keepAlive(keepAlive) { @@ -49029,8 +49029,8 @@ CHIPPm10ConcentrationMeasurementMaxMeasuredValueAttributeCallback(jobject javaCa } } -CHIPPm10ConcentrationMeasurementMaxMeasuredValueAttributeCallback::~ -CHIPPm10ConcentrationMeasurementMaxMeasuredValueAttributeCallback() +CHIPPm10ConcentrationMeasurementMaxMeasuredValueAttributeCallback:: + ~CHIPPm10ConcentrationMeasurementMaxMeasuredValueAttributeCallback() { JNIEnv * env = chip::JniReferences::GetInstance().GetEnvForCurrentThread(); if (env == nullptr) @@ -49080,7 +49080,7 @@ void CHIPPm10ConcentrationMeasurementMaxMeasuredValueAttributeCallback::Callback } CHIPPm10ConcentrationMeasurementPeakMeasuredValueAttributeCallback:: -CHIPPm10ConcentrationMeasurementPeakMeasuredValueAttributeCallback(jobject javaCallback, bool keepAlive) : + CHIPPm10ConcentrationMeasurementPeakMeasuredValueAttributeCallback(jobject javaCallback, bool keepAlive) : chip::Callback::Callback(CallbackFn, this), keepAlive(keepAlive) { @@ -49098,8 +49098,8 @@ CHIPPm10ConcentrationMeasurementPeakMeasuredValueAttributeCallback(jobject javaC } } -CHIPPm10ConcentrationMeasurementPeakMeasuredValueAttributeCallback::~ -CHIPPm10ConcentrationMeasurementPeakMeasuredValueAttributeCallback() +CHIPPm10ConcentrationMeasurementPeakMeasuredValueAttributeCallback:: + ~CHIPPm10ConcentrationMeasurementPeakMeasuredValueAttributeCallback() { JNIEnv * env = chip::JniReferences::GetInstance().GetEnvForCurrentThread(); if (env == nullptr) @@ -49149,7 +49149,7 @@ void CHIPPm10ConcentrationMeasurementPeakMeasuredValueAttributeCallback::Callbac } CHIPPm10ConcentrationMeasurementAverageMeasuredValueAttributeCallback:: -CHIPPm10ConcentrationMeasurementAverageMeasuredValueAttributeCallback(jobject javaCallback, bool keepAlive) : + CHIPPm10ConcentrationMeasurementAverageMeasuredValueAttributeCallback(jobject javaCallback, bool keepAlive) : chip::Callback::Callback(CallbackFn, this), keepAlive(keepAlive) { @@ -49167,8 +49167,8 @@ CHIPPm10ConcentrationMeasurementAverageMeasuredValueAttributeCallback(jobject ja } } -CHIPPm10ConcentrationMeasurementAverageMeasuredValueAttributeCallback::~ -CHIPPm10ConcentrationMeasurementAverageMeasuredValueAttributeCallback() +CHIPPm10ConcentrationMeasurementAverageMeasuredValueAttributeCallback:: + ~CHIPPm10ConcentrationMeasurementAverageMeasuredValueAttributeCallback() { JNIEnv * env = chip::JniReferences::GetInstance().GetEnvForCurrentThread(); if (env == nullptr) @@ -49218,7 +49218,7 @@ void CHIPPm10ConcentrationMeasurementAverageMeasuredValueAttributeCallback::Call } CHIPPm10ConcentrationMeasurementGeneratedCommandListAttributeCallback:: -CHIPPm10ConcentrationMeasurementGeneratedCommandListAttributeCallback(jobject javaCallback, bool keepAlive) : + CHIPPm10ConcentrationMeasurementGeneratedCommandListAttributeCallback(jobject javaCallback, bool keepAlive) : chip::Callback::Callback(CallbackFn, this), keepAlive(keepAlive) { @@ -49236,8 +49236,8 @@ CHIPPm10ConcentrationMeasurementGeneratedCommandListAttributeCallback(jobject ja } } -CHIPPm10ConcentrationMeasurementGeneratedCommandListAttributeCallback::~ -CHIPPm10ConcentrationMeasurementGeneratedCommandListAttributeCallback() +CHIPPm10ConcentrationMeasurementGeneratedCommandListAttributeCallback:: + ~CHIPPm10ConcentrationMeasurementGeneratedCommandListAttributeCallback() { JNIEnv * env = chip::JniReferences::GetInstance().GetEnvForCurrentThread(); if (env == nullptr) @@ -49291,7 +49291,7 @@ void CHIPPm10ConcentrationMeasurementGeneratedCommandListAttributeCallback::Call } CHIPPm10ConcentrationMeasurementAcceptedCommandListAttributeCallback:: -CHIPPm10ConcentrationMeasurementAcceptedCommandListAttributeCallback(jobject javaCallback, bool keepAlive) : + CHIPPm10ConcentrationMeasurementAcceptedCommandListAttributeCallback(jobject javaCallback, bool keepAlive) : chip::Callback::Callback(CallbackFn, this), keepAlive(keepAlive) { @@ -49309,8 +49309,8 @@ CHIPPm10ConcentrationMeasurementAcceptedCommandListAttributeCallback(jobject jav } } -CHIPPm10ConcentrationMeasurementAcceptedCommandListAttributeCallback::~ -CHIPPm10ConcentrationMeasurementAcceptedCommandListAttributeCallback() +CHIPPm10ConcentrationMeasurementAcceptedCommandListAttributeCallback:: + ~CHIPPm10ConcentrationMeasurementAcceptedCommandListAttributeCallback() { JNIEnv * env = chip::JniReferences::GetInstance().GetEnvForCurrentThread(); if (env == nullptr) @@ -49508,7 +49508,7 @@ void CHIPPm10ConcentrationMeasurementAttributeListAttributeCallback::CallbackFn( } CHIPTotalVolatileOrganicCompoundsConcentrationMeasurementMeasuredValueAttributeCallback:: -CHIPTotalVolatileOrganicCompoundsConcentrationMeasurementMeasuredValueAttributeCallback(jobject javaCallback, bool keepAlive) : + CHIPTotalVolatileOrganicCompoundsConcentrationMeasurementMeasuredValueAttributeCallback(jobject javaCallback, bool keepAlive) : chip::Callback::Callback( CallbackFn, this), keepAlive(keepAlive) @@ -49527,8 +49527,8 @@ CHIPTotalVolatileOrganicCompoundsConcentrationMeasurementMeasuredValueAttributeC } } -CHIPTotalVolatileOrganicCompoundsConcentrationMeasurementMeasuredValueAttributeCallback::~ -CHIPTotalVolatileOrganicCompoundsConcentrationMeasurementMeasuredValueAttributeCallback() +CHIPTotalVolatileOrganicCompoundsConcentrationMeasurementMeasuredValueAttributeCallback:: + ~CHIPTotalVolatileOrganicCompoundsConcentrationMeasurementMeasuredValueAttributeCallback() { JNIEnv * env = chip::JniReferences::GetInstance().GetEnvForCurrentThread(); if (env == nullptr) @@ -49581,7 +49581,8 @@ void CHIPTotalVolatileOrganicCompoundsConcentrationMeasurementMeasuredValueAttri } CHIPTotalVolatileOrganicCompoundsConcentrationMeasurementMinMeasuredValueAttributeCallback:: -CHIPTotalVolatileOrganicCompoundsConcentrationMeasurementMinMeasuredValueAttributeCallback(jobject javaCallback, bool keepAlive) : + CHIPTotalVolatileOrganicCompoundsConcentrationMeasurementMinMeasuredValueAttributeCallback(jobject javaCallback, + bool keepAlive) : chip::Callback::Callback( CallbackFn, this), keepAlive(keepAlive) @@ -49600,8 +49601,8 @@ CHIPTotalVolatileOrganicCompoundsConcentrationMeasurementMinMeasuredValueAttribu } } -CHIPTotalVolatileOrganicCompoundsConcentrationMeasurementMinMeasuredValueAttributeCallback::~ -CHIPTotalVolatileOrganicCompoundsConcentrationMeasurementMinMeasuredValueAttributeCallback() +CHIPTotalVolatileOrganicCompoundsConcentrationMeasurementMinMeasuredValueAttributeCallback:: + ~CHIPTotalVolatileOrganicCompoundsConcentrationMeasurementMinMeasuredValueAttributeCallback() { JNIEnv * env = chip::JniReferences::GetInstance().GetEnvForCurrentThread(); if (env == nullptr) @@ -49654,7 +49655,8 @@ void CHIPTotalVolatileOrganicCompoundsConcentrationMeasurementMinMeasuredValueAt } CHIPTotalVolatileOrganicCompoundsConcentrationMeasurementMaxMeasuredValueAttributeCallback:: -CHIPTotalVolatileOrganicCompoundsConcentrationMeasurementMaxMeasuredValueAttributeCallback(jobject javaCallback, bool keepAlive) : + CHIPTotalVolatileOrganicCompoundsConcentrationMeasurementMaxMeasuredValueAttributeCallback(jobject javaCallback, + bool keepAlive) : chip::Callback::Callback( CallbackFn, this), keepAlive(keepAlive) @@ -49673,8 +49675,8 @@ CHIPTotalVolatileOrganicCompoundsConcentrationMeasurementMaxMeasuredValueAttribu } } -CHIPTotalVolatileOrganicCompoundsConcentrationMeasurementMaxMeasuredValueAttributeCallback::~ -CHIPTotalVolatileOrganicCompoundsConcentrationMeasurementMaxMeasuredValueAttributeCallback() +CHIPTotalVolatileOrganicCompoundsConcentrationMeasurementMaxMeasuredValueAttributeCallback:: + ~CHIPTotalVolatileOrganicCompoundsConcentrationMeasurementMaxMeasuredValueAttributeCallback() { JNIEnv * env = chip::JniReferences::GetInstance().GetEnvForCurrentThread(); if (env == nullptr) @@ -49727,7 +49729,8 @@ void CHIPTotalVolatileOrganicCompoundsConcentrationMeasurementMaxMeasuredValueAt } CHIPTotalVolatileOrganicCompoundsConcentrationMeasurementPeakMeasuredValueAttributeCallback:: -CHIPTotalVolatileOrganicCompoundsConcentrationMeasurementPeakMeasuredValueAttributeCallback(jobject javaCallback, bool keepAlive) : + CHIPTotalVolatileOrganicCompoundsConcentrationMeasurementPeakMeasuredValueAttributeCallback(jobject javaCallback, + bool keepAlive) : chip::Callback::Callback< CHIPTotalVolatileOrganicCompoundsConcentrationMeasurementClusterPeakMeasuredValueAttributeCallbackType>(CallbackFn, this), keepAlive(keepAlive) @@ -49746,8 +49749,8 @@ CHIPTotalVolatileOrganicCompoundsConcentrationMeasurementPeakMeasuredValueAttrib } } -CHIPTotalVolatileOrganicCompoundsConcentrationMeasurementPeakMeasuredValueAttributeCallback::~ -CHIPTotalVolatileOrganicCompoundsConcentrationMeasurementPeakMeasuredValueAttributeCallback() +CHIPTotalVolatileOrganicCompoundsConcentrationMeasurementPeakMeasuredValueAttributeCallback:: + ~CHIPTotalVolatileOrganicCompoundsConcentrationMeasurementPeakMeasuredValueAttributeCallback() { JNIEnv * env = chip::JniReferences::GetInstance().GetEnvForCurrentThread(); if (env == nullptr) @@ -49800,8 +49803,8 @@ void CHIPTotalVolatileOrganicCompoundsConcentrationMeasurementPeakMeasuredValueA } CHIPTotalVolatileOrganicCompoundsConcentrationMeasurementAverageMeasuredValueAttributeCallback:: -CHIPTotalVolatileOrganicCompoundsConcentrationMeasurementAverageMeasuredValueAttributeCallback(jobject javaCallback, - bool keepAlive) : + CHIPTotalVolatileOrganicCompoundsConcentrationMeasurementAverageMeasuredValueAttributeCallback(jobject javaCallback, + bool keepAlive) : chip::Callback::Callback< CHIPTotalVolatileOrganicCompoundsConcentrationMeasurementClusterAverageMeasuredValueAttributeCallbackType>(CallbackFn, this), @@ -49821,8 +49824,8 @@ CHIPTotalVolatileOrganicCompoundsConcentrationMeasurementAverageMeasuredValueAtt } } -CHIPTotalVolatileOrganicCompoundsConcentrationMeasurementAverageMeasuredValueAttributeCallback::~ -CHIPTotalVolatileOrganicCompoundsConcentrationMeasurementAverageMeasuredValueAttributeCallback() +CHIPTotalVolatileOrganicCompoundsConcentrationMeasurementAverageMeasuredValueAttributeCallback:: + ~CHIPTotalVolatileOrganicCompoundsConcentrationMeasurementAverageMeasuredValueAttributeCallback() { JNIEnv * env = chip::JniReferences::GetInstance().GetEnvForCurrentThread(); if (env == nullptr) @@ -49876,8 +49879,8 @@ void CHIPTotalVolatileOrganicCompoundsConcentrationMeasurementAverageMeasuredVal } CHIPTotalVolatileOrganicCompoundsConcentrationMeasurementGeneratedCommandListAttributeCallback:: -CHIPTotalVolatileOrganicCompoundsConcentrationMeasurementGeneratedCommandListAttributeCallback(jobject javaCallback, - bool keepAlive) : + CHIPTotalVolatileOrganicCompoundsConcentrationMeasurementGeneratedCommandListAttributeCallback(jobject javaCallback, + bool keepAlive) : chip::Callback::Callback< CHIPTotalVolatileOrganicCompoundsConcentrationMeasurementClusterGeneratedCommandListAttributeCallbackType>(CallbackFn, this), @@ -49897,8 +49900,8 @@ CHIPTotalVolatileOrganicCompoundsConcentrationMeasurementGeneratedCommandListAtt } } -CHIPTotalVolatileOrganicCompoundsConcentrationMeasurementGeneratedCommandListAttributeCallback::~ -CHIPTotalVolatileOrganicCompoundsConcentrationMeasurementGeneratedCommandListAttributeCallback() +CHIPTotalVolatileOrganicCompoundsConcentrationMeasurementGeneratedCommandListAttributeCallback:: + ~CHIPTotalVolatileOrganicCompoundsConcentrationMeasurementGeneratedCommandListAttributeCallback() { JNIEnv * env = chip::JniReferences::GetInstance().GetEnvForCurrentThread(); if (env == nullptr) @@ -49956,8 +49959,8 @@ void CHIPTotalVolatileOrganicCompoundsConcentrationMeasurementGeneratedCommandLi } CHIPTotalVolatileOrganicCompoundsConcentrationMeasurementAcceptedCommandListAttributeCallback:: -CHIPTotalVolatileOrganicCompoundsConcentrationMeasurementAcceptedCommandListAttributeCallback(jobject javaCallback, - bool keepAlive) : + CHIPTotalVolatileOrganicCompoundsConcentrationMeasurementAcceptedCommandListAttributeCallback(jobject javaCallback, + bool keepAlive) : chip::Callback::Callback< CHIPTotalVolatileOrganicCompoundsConcentrationMeasurementClusterAcceptedCommandListAttributeCallbackType>(CallbackFn, this), keepAlive(keepAlive) @@ -49976,8 +49979,8 @@ CHIPTotalVolatileOrganicCompoundsConcentrationMeasurementAcceptedCommandListAttr } } -CHIPTotalVolatileOrganicCompoundsConcentrationMeasurementAcceptedCommandListAttributeCallback::~ -CHIPTotalVolatileOrganicCompoundsConcentrationMeasurementAcceptedCommandListAttributeCallback() +CHIPTotalVolatileOrganicCompoundsConcentrationMeasurementAcceptedCommandListAttributeCallback:: + ~CHIPTotalVolatileOrganicCompoundsConcentrationMeasurementAcceptedCommandListAttributeCallback() { JNIEnv * env = chip::JniReferences::GetInstance().GetEnvForCurrentThread(); if (env == nullptr) @@ -50035,7 +50038,7 @@ void CHIPTotalVolatileOrganicCompoundsConcentrationMeasurementAcceptedCommandLis } CHIPTotalVolatileOrganicCompoundsConcentrationMeasurementEventListAttributeCallback:: -CHIPTotalVolatileOrganicCompoundsConcentrationMeasurementEventListAttributeCallback(jobject javaCallback, bool keepAlive) : + CHIPTotalVolatileOrganicCompoundsConcentrationMeasurementEventListAttributeCallback(jobject javaCallback, bool keepAlive) : chip::Callback::Callback( CallbackFn, this), keepAlive(keepAlive) @@ -50054,8 +50057,8 @@ CHIPTotalVolatileOrganicCompoundsConcentrationMeasurementEventListAttributeCallb } } -CHIPTotalVolatileOrganicCompoundsConcentrationMeasurementEventListAttributeCallback::~ -CHIPTotalVolatileOrganicCompoundsConcentrationMeasurementEventListAttributeCallback() +CHIPTotalVolatileOrganicCompoundsConcentrationMeasurementEventListAttributeCallback:: + ~CHIPTotalVolatileOrganicCompoundsConcentrationMeasurementEventListAttributeCallback() { JNIEnv * env = chip::JniReferences::GetInstance().GetEnvForCurrentThread(); if (env == nullptr) @@ -50111,7 +50114,7 @@ void CHIPTotalVolatileOrganicCompoundsConcentrationMeasurementEventListAttribute } CHIPTotalVolatileOrganicCompoundsConcentrationMeasurementAttributeListAttributeCallback:: -CHIPTotalVolatileOrganicCompoundsConcentrationMeasurementAttributeListAttributeCallback(jobject javaCallback, bool keepAlive) : + CHIPTotalVolatileOrganicCompoundsConcentrationMeasurementAttributeListAttributeCallback(jobject javaCallback, bool keepAlive) : chip::Callback::Callback( CallbackFn, this), keepAlive(keepAlive) @@ -50130,8 +50133,8 @@ CHIPTotalVolatileOrganicCompoundsConcentrationMeasurementAttributeListAttributeC } } -CHIPTotalVolatileOrganicCompoundsConcentrationMeasurementAttributeListAttributeCallback::~ -CHIPTotalVolatileOrganicCompoundsConcentrationMeasurementAttributeListAttributeCallback() +CHIPTotalVolatileOrganicCompoundsConcentrationMeasurementAttributeListAttributeCallback:: + ~CHIPTotalVolatileOrganicCompoundsConcentrationMeasurementAttributeListAttributeCallback() { JNIEnv * env = chip::JniReferences::GetInstance().GetEnvForCurrentThread(); if (env == nullptr) @@ -50256,7 +50259,7 @@ void CHIPRadonConcentrationMeasurementMeasuredValueAttributeCallback::CallbackFn } CHIPRadonConcentrationMeasurementMinMeasuredValueAttributeCallback:: -CHIPRadonConcentrationMeasurementMinMeasuredValueAttributeCallback(jobject javaCallback, bool keepAlive) : + CHIPRadonConcentrationMeasurementMinMeasuredValueAttributeCallback(jobject javaCallback, bool keepAlive) : chip::Callback::Callback(CallbackFn, this), keepAlive(keepAlive) { @@ -50274,8 +50277,8 @@ CHIPRadonConcentrationMeasurementMinMeasuredValueAttributeCallback(jobject javaC } } -CHIPRadonConcentrationMeasurementMinMeasuredValueAttributeCallback::~ -CHIPRadonConcentrationMeasurementMinMeasuredValueAttributeCallback() +CHIPRadonConcentrationMeasurementMinMeasuredValueAttributeCallback:: + ~CHIPRadonConcentrationMeasurementMinMeasuredValueAttributeCallback() { JNIEnv * env = chip::JniReferences::GetInstance().GetEnvForCurrentThread(); if (env == nullptr) @@ -50325,7 +50328,7 @@ void CHIPRadonConcentrationMeasurementMinMeasuredValueAttributeCallback::Callbac } CHIPRadonConcentrationMeasurementMaxMeasuredValueAttributeCallback:: -CHIPRadonConcentrationMeasurementMaxMeasuredValueAttributeCallback(jobject javaCallback, bool keepAlive) : + CHIPRadonConcentrationMeasurementMaxMeasuredValueAttributeCallback(jobject javaCallback, bool keepAlive) : chip::Callback::Callback(CallbackFn, this), keepAlive(keepAlive) { @@ -50343,8 +50346,8 @@ CHIPRadonConcentrationMeasurementMaxMeasuredValueAttributeCallback(jobject javaC } } -CHIPRadonConcentrationMeasurementMaxMeasuredValueAttributeCallback::~ -CHIPRadonConcentrationMeasurementMaxMeasuredValueAttributeCallback() +CHIPRadonConcentrationMeasurementMaxMeasuredValueAttributeCallback:: + ~CHIPRadonConcentrationMeasurementMaxMeasuredValueAttributeCallback() { JNIEnv * env = chip::JniReferences::GetInstance().GetEnvForCurrentThread(); if (env == nullptr) @@ -50394,7 +50397,7 @@ void CHIPRadonConcentrationMeasurementMaxMeasuredValueAttributeCallback::Callbac } CHIPRadonConcentrationMeasurementPeakMeasuredValueAttributeCallback:: -CHIPRadonConcentrationMeasurementPeakMeasuredValueAttributeCallback(jobject javaCallback, bool keepAlive) : + CHIPRadonConcentrationMeasurementPeakMeasuredValueAttributeCallback(jobject javaCallback, bool keepAlive) : chip::Callback::Callback(CallbackFn, this), keepAlive(keepAlive) { @@ -50412,8 +50415,8 @@ CHIPRadonConcentrationMeasurementPeakMeasuredValueAttributeCallback(jobject java } } -CHIPRadonConcentrationMeasurementPeakMeasuredValueAttributeCallback::~ -CHIPRadonConcentrationMeasurementPeakMeasuredValueAttributeCallback() +CHIPRadonConcentrationMeasurementPeakMeasuredValueAttributeCallback:: + ~CHIPRadonConcentrationMeasurementPeakMeasuredValueAttributeCallback() { JNIEnv * env = chip::JniReferences::GetInstance().GetEnvForCurrentThread(); if (env == nullptr) @@ -50463,7 +50466,7 @@ void CHIPRadonConcentrationMeasurementPeakMeasuredValueAttributeCallback::Callba } CHIPRadonConcentrationMeasurementAverageMeasuredValueAttributeCallback:: -CHIPRadonConcentrationMeasurementAverageMeasuredValueAttributeCallback(jobject javaCallback, bool keepAlive) : + CHIPRadonConcentrationMeasurementAverageMeasuredValueAttributeCallback(jobject javaCallback, bool keepAlive) : chip::Callback::Callback(CallbackFn, this), keepAlive(keepAlive) { @@ -50481,8 +50484,8 @@ CHIPRadonConcentrationMeasurementAverageMeasuredValueAttributeCallback(jobject j } } -CHIPRadonConcentrationMeasurementAverageMeasuredValueAttributeCallback::~ -CHIPRadonConcentrationMeasurementAverageMeasuredValueAttributeCallback() +CHIPRadonConcentrationMeasurementAverageMeasuredValueAttributeCallback:: + ~CHIPRadonConcentrationMeasurementAverageMeasuredValueAttributeCallback() { JNIEnv * env = chip::JniReferences::GetInstance().GetEnvForCurrentThread(); if (env == nullptr) @@ -50532,7 +50535,7 @@ void CHIPRadonConcentrationMeasurementAverageMeasuredValueAttributeCallback::Cal } CHIPRadonConcentrationMeasurementGeneratedCommandListAttributeCallback:: -CHIPRadonConcentrationMeasurementGeneratedCommandListAttributeCallback(jobject javaCallback, bool keepAlive) : + CHIPRadonConcentrationMeasurementGeneratedCommandListAttributeCallback(jobject javaCallback, bool keepAlive) : chip::Callback::Callback(CallbackFn, this), keepAlive(keepAlive) { @@ -50550,8 +50553,8 @@ CHIPRadonConcentrationMeasurementGeneratedCommandListAttributeCallback(jobject j } } -CHIPRadonConcentrationMeasurementGeneratedCommandListAttributeCallback::~ -CHIPRadonConcentrationMeasurementGeneratedCommandListAttributeCallback() +CHIPRadonConcentrationMeasurementGeneratedCommandListAttributeCallback:: + ~CHIPRadonConcentrationMeasurementGeneratedCommandListAttributeCallback() { JNIEnv * env = chip::JniReferences::GetInstance().GetEnvForCurrentThread(); if (env == nullptr) @@ -50605,7 +50608,7 @@ void CHIPRadonConcentrationMeasurementGeneratedCommandListAttributeCallback::Cal } CHIPRadonConcentrationMeasurementAcceptedCommandListAttributeCallback:: -CHIPRadonConcentrationMeasurementAcceptedCommandListAttributeCallback(jobject javaCallback, bool keepAlive) : + CHIPRadonConcentrationMeasurementAcceptedCommandListAttributeCallback(jobject javaCallback, bool keepAlive) : chip::Callback::Callback(CallbackFn, this), keepAlive(keepAlive) { @@ -50623,8 +50626,8 @@ CHIPRadonConcentrationMeasurementAcceptedCommandListAttributeCallback(jobject ja } } -CHIPRadonConcentrationMeasurementAcceptedCommandListAttributeCallback::~ -CHIPRadonConcentrationMeasurementAcceptedCommandListAttributeCallback() +CHIPRadonConcentrationMeasurementAcceptedCommandListAttributeCallback:: + ~CHIPRadonConcentrationMeasurementAcceptedCommandListAttributeCallback() { JNIEnv * env = chip::JniReferences::GetInstance().GetEnvForCurrentThread(); if (env == nullptr) From 320b5e1e38a9705bb04bf891e5fa38622a1135da Mon Sep 17 00:00:00 2001 From: James Harrow Date: Mon, 8 Jan 2024 23:33:42 +0000 Subject: [PATCH 079/114] Added provisional handling for Faults --- .../include/EnergyEvseDelegateImpl.h | 6 + .../src/EnergyEvseDelegateImpl.cpp | 148 +++++++++++++----- 2 files changed, 119 insertions(+), 35 deletions(-) diff --git a/examples/energy-management-app/energy-management-common/include/EnergyEvseDelegateImpl.h b/examples/energy-management-app/energy-management-common/include/EnergyEvseDelegateImpl.h index 6cd6dd37f8df34..6eb2241638d84f 100644 --- a/examples/energy-management-app/energy-management-common/include/EnergyEvseDelegateImpl.h +++ b/examples/energy-management-app/energy-management-common/include/EnergyEvseDelegateImpl.h @@ -153,6 +153,7 @@ class EnergyEvseDelegate : public EnergyEvse::Delegate Status SendEVNotDetectedEvent(); Status SendEnergyTransferStartedEvent(); Status SendEnergyTransferStoppedEvent(EnergyTransferStoppedReasonEnum reason); + Status SendFaultEvent(FaultStateEnum newFaultState); // ------------------------------------------------------------------ // Get attribute methods @@ -225,6 +226,10 @@ class EnergyEvseDelegate : public EnergyEvse::Delegate int64_t mActualChargingCurrentLimit = 0; StateEnum mHwState = StateEnum::kNotPluggedIn; /* Hardware state */ + /* Variables to hold State and SupplyState in case a fault is raised */ + StateEnum mStateBeforeFault = StateEnum::kUnknownEnumValue; + SupplyStateEnum mSupplyStateBeforeFault = SupplyStateEnum::kUnknownEnumValue; + /* Callback related */ EVSECallbackWrapper mCallbacks = { .handler = nullptr, .arg = 0 }; /* Wrapper to allow callbacks to be registered */ Status NotifyApplicationCurrentLimitChange(int64_t maximumChargeCurrent); @@ -232,6 +237,7 @@ class EnergyEvseDelegate : public EnergyEvse::Delegate Status GetEVSEEnergyMeterValue(ChargingDischargingType meterType, int64_t & aMeterValue); /* Local State machine handling */ + Status CheckFaultOrDiagnostic(); Status HandleStateMachineEvent(EVSEStateMachineEvent event); Status HandleEVPluggedInEvent(); Status HandleEVNotDetectedEvent(); diff --git a/examples/energy-management-app/energy-management-common/src/EnergyEvseDelegateImpl.cpp b/examples/energy-management-app/energy-management-common/src/EnergyEvseDelegateImpl.cpp index d122de7921dac3..602d136fe4dd33 100644 --- a/examples/energy-management-app/energy-management-common/src/EnergyEvseDelegateImpl.cpp +++ b/examples/energy-management-app/energy-management-common/src/EnergyEvseDelegateImpl.cpp @@ -145,9 +145,11 @@ Status EnergyEvseDelegate::StartDiagnostics() ChipLogProgress(AppServer, "EnergyEvseDelegate::StartDiagnostics()"); /* update SupplyState to indicate we are now in Diagnostics mode */ + // TODO save the value of SupplyState so it can be restored later SetSupplyState(SupplyStateEnum::kDisabledDiagnostics); - // TODO: Generate events + // TODO Application code would need to put the SupplyState back + // once diagnostics have been completed return Status::Success; } @@ -245,23 +247,6 @@ Status EnergyEvseDelegate::HwSetCableAssemblyLimit(int64_t currentmA) return ComputeMaxChargeCurrentLimit(); } -bool IsEvPluggedIn(StateEnum state) -{ - if ((state == StateEnum::kNotPluggedIn) || (state == StateEnum::kFault) || (state == StateEnum::kSessionEnding)) - { - return false; - } - return true; -} - -bool IsEvTransferringEnergy(StateEnum state) -{ - if ((state == StateEnum::kPluggedInCharging) || (state == StateEnum::kPluggedInDischarging)) - { - return true; - } - return false; -} /** * @brief Called by EVSE Hardware to indicate if EV is detected * @@ -333,29 +318,35 @@ Status EnergyEvseDelegate::HwSetState(StateEnum newState) * * @param FaultStateEnum - the fault condition detected */ -Status EnergyEvseDelegate::HwSetFault(FaultStateEnum fault) +Status EnergyEvseDelegate::HwSetFault(FaultStateEnum newFaultState) { ChipLogProgress(AppServer, "EnergyEvseDelegate::Fault()"); - if (fault == FaultStateEnum::kNoError) + if (mFaultState == newFaultState) { - /* Update State to previous state */ - // TODO: need to work out the logic here! + ChipLogError(AppServer, "No change in fault state, ignoring call"); + return Status::Failure; + } + + /** Before we do anything we log the fault + * any change in FaultState reports previous fault and new fault + * and the state prior to the fault being raised */ + SendFaultEvent(newFaultState); - /* Update SupplyState to previous state */ + /* Updated FaultState before we call into the handlers */ + SetFaultState(newFaultState); + + if (newFaultState == FaultStateEnum::kNoError) + { + /* Fault has been cleared */ + HandleStateMachineEvent(EVSEStateMachineEvent::FaultCleared); } else { - /* Update State & SupplyState */ - SetState(StateEnum::kFault); - SetSupplyState(SupplyStateEnum::kDisabledError); + /* a new Fault has been raised */ + HandleStateMachineEvent(EVSEStateMachineEvent::FaultRaised); } - /* Update FaultState */ - SetFaultState(fault); - - // TODO: Generate events - return Status::Success; } @@ -551,10 +542,30 @@ Status EnergyEvseDelegate::HandleEVDemandEvent() return Status::Success; } +Status EnergyEvseDelegate::CheckFaultOrDiagnostic() +{ + if (mFaultState != FaultStateEnum::kNoError) + { + ChipLogError(AppServer, "EVSE: Trying to handle command when fault is present"); + return Status::Failure; + } + + if (mSupplyState == SupplyStateEnum::kDisabledDiagnostics) + { + ChipLogError(AppServer, "EVSE: Trying to handle command when in diagnostics mode"); + return Status::Failure; + } + return Status::Success; +} + Status EnergyEvseDelegate::HandleChargingEnabledEvent() { /* Check there is no Fault or Diagnostics condition */ - // TODO -! + Status status = CheckFaultOrDiagnostic(); + if (status != Status::Success) + { + return status; + } /* update SupplyState to say that charging is now enabled */ SetSupplyState(SupplyStateEnum::kChargingEnabled); @@ -587,8 +598,11 @@ Status EnergyEvseDelegate::HandleChargingEnabledEvent() Status EnergyEvseDelegate::HandleDischargingEnabledEvent() { /* Check there is no Fault or Diagnostics condition */ - // TODO -! - + Status status = CheckFaultOrDiagnostic(); + if (status != Status::Success) + { + return status; + } /* update SupplyState to say that charging is now enabled */ SetSupplyState(SupplyStateEnum::kDischargingEnabled); @@ -619,7 +633,11 @@ Status EnergyEvseDelegate::HandleDischargingEnabledEvent() Status EnergyEvseDelegate::HandleDisabledEvent() { /* Check there is no Fault or Diagnostics condition */ - // TODO -! + Status status = CheckFaultOrDiagnostic(); + if (status != Status::Success) + { + return status; + } /* update SupplyState to say that charging is now enabled */ SetSupplyState(SupplyStateEnum::kDisabled); @@ -642,12 +660,53 @@ Status EnergyEvseDelegate::HandleDisabledEvent() return Status::Success; } +/** + * @brief This handles the new fault + * + * Note that if multiple faults happen and this is called repeatedly + * We only save the previous State and SupplyState if its the first raising + * of the fault, so we can restore the state back once all faults have cleared +)*/ Status EnergyEvseDelegate::HandleFaultRaised() { + /* Save the current State and SupplyState so we can restore them if the fault clears */ + if (mStateBeforeFault == StateEnum::kUnknownEnumValue) + { + /* No existing fault - save this value to restore it later if it clears */ + mStateBeforeFault = mState; + } + + if (mSupplyStateBeforeFault == SupplyStateEnum::kUnknownEnumValue) + { + /* No existing fault */ + mSupplyStateBeforeFault = mSupplyState; + } + + /* Update State & SupplyState */ + SetState(StateEnum::kFault); + SetSupplyState(SupplyStateEnum::kDisabledError); + return Status::Success; } Status EnergyEvseDelegate::HandleFaultCleared() { + /* Check that something strange hasn't happened */ + if ((mStateBeforeFault == StateEnum::kUnknownEnumValue) || (mSupplyStateBeforeFault == SupplyStateEnum::kUnknownEnumValue)) + { + ChipLogError(AppServer, "EVSE: Something wrong trying to clear fault"); + return Status::Failure; + } + + /* Restore the State and SupplyState back to old values once all the faults have cleared + * Changing the State should notify the application, so it can continue charging etc + */ + SetState(mStateBeforeFault); + SetSupplyState(mSupplyStateBeforeFault); + + /* put back the sentinel to catch new faults if more are raised */ + mStateBeforeFault = StateEnum::kUnknownEnumValue; + mSupplyStateBeforeFault = SupplyStateEnum::kUnknownEnumValue; + return Status::Success; } @@ -865,6 +924,25 @@ Status EnergyEvseDelegate::SendEnergyTransferStoppedEvent(EnergyTransferStoppedR return Status::Success; } +Status EnergyEvseDelegate::SendFaultEvent(FaultStateEnum newFaultState) +{ + Events::Fault::Type event; + EventNumber eventNumber; + + event.sessionID = mSession.mSessionID; // Note here the event sessionID can be Null! + event.state = mState; // This is the state prior to the fault being raised + event.faultStatePreviousState = mFaultState; + event.faultStateCurrentState = newFaultState; + + CHIP_ERROR err = LogEvent(event, mEndpointId, eventNumber); + if (CHIP_NO_ERROR != err) + { + ChipLogError(AppServer, "Unable to send notify event: %" CHIP_ERROR_FORMAT, err.Format()); + return Status::Failure; + } + return Status::Success; +} + /** * Attribute methods */ From 3a7ace4dc82d6eef93db022b848bec0ef58584b8 Mon Sep 17 00:00:00 2001 From: James Harrow Date: Tue, 9 Jan 2024 01:05:22 +0000 Subject: [PATCH 080/114] Added new test event triggers to help test Fault and Diagnostics --- .../include/EnergyEvseDelegateImpl.h | 7 +-- .../src/EVSEManufacturerImpl.cpp | 44 ++++++++++++++++++- .../src/EnergyEvseDelegateImpl.cpp | 40 +++++++++++++++-- .../EnergyEvseTestEventTriggerDelegate.h | 29 ++++++++---- 4 files changed, 104 insertions(+), 16 deletions(-) diff --git a/examples/energy-management-app/energy-management-common/include/EnergyEvseDelegateImpl.h b/examples/energy-management-app/energy-management-common/include/EnergyEvseDelegateImpl.h index 6eb2241638d84f..97da46322fd5d4 100644 --- a/examples/energy-management-app/energy-management-common/include/EnergyEvseDelegateImpl.h +++ b/examples/energy-management-app/energy-management-common/include/EnergyEvseDelegateImpl.h @@ -148,7 +148,7 @@ class EnergyEvseDelegate : public EnergyEvse::Delegate Status HwSetFault(FaultStateEnum fault); Status HwSetRFID(ByteSpan uid); Status HwSetVehicleID(const CharSpan & vehID); - + Status HwDiagnosticsComplete(); Status SendEVConnectedEvent(); Status SendEVNotDetectedEvent(); Status SendEnergyTransferStartedEvent(); @@ -227,8 +227,9 @@ class EnergyEvseDelegate : public EnergyEvse::Delegate StateEnum mHwState = StateEnum::kNotPluggedIn; /* Hardware state */ /* Variables to hold State and SupplyState in case a fault is raised */ - StateEnum mStateBeforeFault = StateEnum::kUnknownEnumValue; - SupplyStateEnum mSupplyStateBeforeFault = SupplyStateEnum::kUnknownEnumValue; + StateEnum mStateBeforeFault = StateEnum::kUnknownEnumValue; + SupplyStateEnum mSupplyStateBeforeFault = SupplyStateEnum::kUnknownEnumValue; + SupplyStateEnum mSupplyStateBeforeDiagnostics = SupplyStateEnum::kUnknownEnumValue; /* Callback related */ EVSECallbackWrapper mCallbacks = { .handler = nullptr, .arg = 0 }; /* Wrapper to allow callbacks to be registered */ diff --git a/examples/energy-management-app/energy-management-common/src/EVSEManufacturerImpl.cpp b/examples/energy-management-app/energy-management-common/src/EVSEManufacturerImpl.cpp index 8d4279601bd92a..c71db0047b8f20 100644 --- a/examples/energy-management-app/energy-management-common/src/EVSEManufacturerImpl.cpp +++ b/examples/energy-management-app/energy-management-common/src/EVSEManufacturerImpl.cpp @@ -181,6 +181,33 @@ void SetTestEventTrigger_EVChargeDemandClear() dg->HwSetState(sEVSETestEventSaveData.mOldHwStatePluggedInDemand); } +void SetTestEventTrigger_EVSEGroundFault() +{ + EnergyEvseDelegate * dg = GetEvseDelegate(); + + dg->HwSetFault(FaultStateEnum::kGroundFault); +} + +void SetTestEventTrigger_EVSEOverTemperatureFault() +{ + EnergyEvseDelegate * dg = GetEvseDelegate(); + + dg->HwSetFault(FaultStateEnum::kOverTemperature); +} + +void SetTestEventTrigger_EVSEFaultClear() +{ + EnergyEvseDelegate * dg = GetEvseDelegate(); + + dg->HwSetFault(FaultStateEnum::kNoError); +} + +void SetTestEventTrigger_EVSEDiagnosticsComplete() +{ + EnergyEvseDelegate * dg = GetEvseDelegate(); + + dg->HwDiagnosticsComplete(); +} bool HandleEnergyEvseTestEventTrigger(uint64_t eventTrigger) { @@ -212,9 +239,24 @@ bool HandleEnergyEvseTestEventTrigger(uint64_t eventTrigger) ChipLogProgress(Support, "[EnergyEVSE-Test-Event] => EV Charge NoDemand"); SetTestEventTrigger_EVChargeDemandClear(); break; + case EnergyEvseTrigger::kEVSEGroundFault: + ChipLogProgress(Support, "[EnergyEVSE-Test-Event] => EVSE has a GroundFault fault"); + SetTestEventTrigger_EVSEGroundFault(); + break; + case EnergyEvseTrigger::kEVSEOverTemperatureFault: + ChipLogProgress(Support, "[EnergyEVSE-Test-Event] => EVSE has a OverTemperature fault"); + SetTestEventTrigger_EVSEOverTemperatureFault(); + break; + case EnergyEvseTrigger::kEVSEFaultClear: + ChipLogProgress(Support, "[EnergyEVSE-Test-Event] => EVSE faults have cleared"); + SetTestEventTrigger_EVSEFaultClear(); + break; + case EnergyEvseTrigger::kEVSEDiagnosticsComplete: + ChipLogProgress(Support, "[EnergyEVSE-Test-Event] => EVSE Diagnostics Completed"); + SetTestEventTrigger_EVSEDiagnosticsComplete(); + break; default: - return false; } diff --git a/examples/energy-management-app/energy-management-common/src/EnergyEvseDelegateImpl.cpp b/examples/energy-management-app/energy-management-common/src/EnergyEvseDelegateImpl.cpp index 602d136fe4dd33..468b6d5536a678 100644 --- a/examples/energy-management-app/energy-management-common/src/EnergyEvseDelegateImpl.cpp +++ b/examples/energy-management-app/energy-management-common/src/EnergyEvseDelegateImpl.cpp @@ -138,18 +138,31 @@ Status EnergyEvseDelegate::EnableDischarging(const DataModel::Nullable /** * @brief Called when EVSE cluster receives StartDiagnostics command + * + * NOTE: Application code needs to call HwDiagnosticsComplete + * once diagnostics have been completed. */ Status EnergyEvseDelegate::StartDiagnostics() { /* For EVSE manufacturers to customize */ ChipLogProgress(AppServer, "EnergyEvseDelegate::StartDiagnostics()"); + if (mSupplyState == SupplyStateEnum::kDisabledDiagnostics) + { + ChipLogError(AppServer, "EVSE: Already in diagnostics mode!"); + return Status::Failure; + } + /* update SupplyState to indicate we are now in Diagnostics mode */ - // TODO save the value of SupplyState so it can be restored later - SetSupplyState(SupplyStateEnum::kDisabledDiagnostics); + if (mSupplyStateBeforeDiagnostics != SupplyStateEnum::kUnknownEnumValue) + { + ChipLogError(AppServer, "EVSE: Something wrong trying to go into diagnostics mode"); + return Status::Failure; + } - // TODO Application code would need to put the SupplyState back - // once diagnostics have been completed + mSupplyStateBeforeDiagnostics = mSupplyState; + // Update the SupplyState - this will automatically callback the Application StateChanged callback + SetSupplyState(SupplyStateEnum::kDisabledDiagnostics); return Status::Success; } @@ -410,6 +423,25 @@ Status EnergyEvseDelegate::HwSetVehicleID(const CharSpan & newValue) return Status::Success; } +/** + * @brief Called by EVSE Hardware to indicate that it has finished its diagnostics test + */ +Status EnergyEvseDelegate::HwDiagnosticsComplete() +{ + if (mSupplyState != SupplyStateEnum::kDisabledDiagnostics) + { + ChipLogError(AppServer, "Incorrect state to be completing diagnostics"); + return Status::Failure; + } + + /* Restore the SupplyState to the saved state before diagnostics were triggered */ + SetSupplyState(mSupplyStateBeforeDiagnostics); + + /* Set the sentinel back for checking another diagnostics command */ + mSupplyStateBeforeDiagnostics = SupplyStateEnum::kUnknownEnumValue; + + return Status::Success; +} /* --------------------------------------------------------------------------- * Functions below are private helper functions internal to the delegate */ diff --git a/src/app/clusters/energy-evse-server/EnergyEvseTestEventTriggerDelegate.h b/src/app/clusters/energy-evse-server/EnergyEvseTestEventTriggerDelegate.h index 7f199b21cdc255..cb9abd29da77f4 100644 --- a/src/app/clusters/energy-evse-server/EnergyEvseTestEventTriggerDelegate.h +++ b/src/app/clusters/energy-evse-server/EnergyEvseTestEventTriggerDelegate.h @@ -32,14 +32,27 @@ namespace chip { enum class EnergyEvseTrigger : uint64_t { // Scenarios - kBasicFunctionality = 0x0099000000000000, // Basic Functionality Test Event | Simulate installation with - // _{A_CIRCUIT_CAPACITY}_=32A and _{A_USER_MAXIMUM_CHARGE_CURRENT}_=32A - kBasicFunctionalityClear = 0x0099000000000001, // Basic Functionality Test Event Clear | End simulation of installation - kEVPluggedIn = 0x0099000000000002, // EV Plugged-in Test Event | Simulate plugging - // the EV into the EVSE using a cable of 63A capacity - kEVPluggedInClear = 0x0099000000000003, // EV Plugged-in Test Event Clear | Simulate unplugging the EV - kEVChargeDemand = 0x0099000000000004, // EV Charge Demand Test Event | Simulate the EV presenting charge demand to the EVSE - kEVChargeDemandClear = 0x0099000000000005, // EV Charge Demand Test Event Clear | Simulate the EV becoming fully charged + // Basic Functionality Test Event | Simulate installation with _{A_CIRCUIT_CAPACITY}_=32A and + // _{A_USER_MAXIMUM_CHARGE_CURRENT}_=32A + kBasicFunctionality = 0x0099000000000000, + // Basic Functionality Test Event Clear | End simulation of installation + kBasicFunctionalityClear = 0x0099000000000001, + // EV Plugged-in Test Event | Simulate plugging the EV into the EVSE using a cable of 63A capacity + kEVPluggedIn = 0x0099000000000002, + // EV Plugged-in Test Event Clear | Simulate unplugging the EV + kEVPluggedInClear = 0x0099000000000003, + // EV Charge Demand Test Event | Simulate the EV presenting charge demand to the EVSE + kEVChargeDemand = 0x0099000000000004, + // EV Charge Demand Test Event Clear | Simulate the EV becoming fully charged + kEVChargeDemandClear = 0x0099000000000005, + // EVSE has a GroundFault fault + kEVSEGroundFault = 0x0099000000000010, + // EVSE has a OverTemperature fault + kEVSEOverTemperatureFault = 0x0099000000000011, + // EVSE faults have cleared + kEVSEFaultClear = 0x0099000000000012, + // EVSE Diagnostics Complete | Simulate diagnostics have been completed and return to normal + kEVSEDiagnosticsComplete = 0x0099000000000020, }; class EnergyEvseTestEventTriggerDelegate : public TestEventTriggerDelegate From 309b8f6932f6fb2db1471f3235be80bf1fd244a2 Mon Sep 17 00:00:00 2001 From: James Harrow Date: Tue, 9 Jan 2024 14:42:38 +0000 Subject: [PATCH 081/114] Added TC_EEVSE_2_4 --- src/python_testing/TC_EEVSE_2_4.py | 344 +++++++++++++++++++++++++++++ 1 file changed, 344 insertions(+) create mode 100644 src/python_testing/TC_EEVSE_2_4.py diff --git a/src/python_testing/TC_EEVSE_2_4.py b/src/python_testing/TC_EEVSE_2_4.py new file mode 100644 index 00000000000000..e07b6602a9f000 --- /dev/null +++ b/src/python_testing/TC_EEVSE_2_4.py @@ -0,0 +1,344 @@ +# +# Copyright (c) 2023 Project CHIP Authors +# All rights reserved. +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + + +import logging +import queue +import time +from datetime import datetime, timedelta, timezone + +import chip.clusters as Clusters +from chip.clusters import ClusterObjects as ClusterObjects +from chip.clusters.Attribute import EventReadResult, SubscriptionTransaction +from chip.clusters.Types import NullValue +from chip.interaction_model import InteractionModelError, Status +from matter_testing_support import MatterBaseTest, TestStep, async_test_body, default_matter_test_main +from mobly import asserts + +logger = logging.getLogger(__name__) + + +class EventChangeCallback: + def __init__(self, expected_cluster: ClusterObjects): + self._q = queue.Queue() + self._expected_cluster = expected_cluster + + async def start(self, dev_ctrl, nodeid): + self._subscription = await dev_ctrl.ReadEvent(nodeid, + events=[(1, self._expected_cluster, 1)], reportInterval=(1, 5), + fabricFiltered=False, keepSubscriptions=True, autoResubscribe=False) + self._subscription.SetEventUpdateCallback(self.__call__) + + def __call__(self, res: EventReadResult, transaction: SubscriptionTransaction): + if res.Status == Status.Success and res.Header.ClusterId == self._expected_cluster.id: + logging.info( + f'Got subscription report for event on cluster {self._expected_cluster}: {res.Data}') + self._q.put(res) + + def WaitForEventReport(self, expected_event: ClusterObjects.ClusterEvent): + try: + res = self._q.get(block=True, timeout=10) + except queue.Empty: + asserts.fail("Failed to receive a report for the event {}".format(expected_event)) + + asserts.assert_equal(res.Header.ClusterId, expected_event.cluster_id, "Expected cluster ID not found in event report") + asserts.assert_equal(res.Header.EventId, expected_event.event_id, "Expected event ID not found in event report") + return res.Data + + +class TC_EEVSE_2_4(MatterBaseTest): + async def read_evse_attribute_expect_success(self, endpoint, attribute): + full_attr = getattr(Clusters.EnergyEvse.Attributes, attribute) + cluster = Clusters.Objects.EnergyEvse + return await self.read_single_attribute_check_success(endpoint=endpoint, cluster=cluster, attribute=full_attr) + + async def check_evse_attribute(self, attribute, expected_value): + value = await self.read_evse_attribute_expect_success(endpoint=1, attribute=attribute) + asserts.assert_equal(value, expected_value, + f"Unexpected '{attribute}' value - expected {expected_value}, was {value}") + + async def get_supported_energy_evse_attributes(self, endpoint): + return await self.read_evse_attribute_expect_success(endpoint, "AttributeList") + + async def write_user_max_charge(self, endpoint, user_max_charge): + result = await self.default_controller.WriteAttribute(self.dut_node_id, + [(endpoint, + Clusters.EnergyEvse.Attributes.UserMaximumChargeCurrent(user_max_charge))]) + asserts.assert_equal(result[0].Status, Status.Success, "UserMaximumChargeCurrent write failed") + + async def send_enable_charge_command(self, endpoint: int = 0, charge_until: int = None, timedRequestTimeoutMs: int = 3000, + min_charge: int = None, max_charge: int = None, expected_status: Status = Status.Success): + try: + await self.send_single_cmd(cmd=Clusters.EnergyEvse.Commands.EnableCharging( + chargingEnabledUntil=charge_until, + minimumChargeCurrent=min_charge, + maximumChargeCurrent=max_charge), + endpoint=1, + timedRequestTimeoutMs=timedRequestTimeoutMs) + + except InteractionModelError as e: + asserts.assert_equal(e.status, expected_status, "Unexpected error returned") + + async def send_disable_command(self, endpoint: int = 0, timedRequestTimeoutMs: int = 3000, expected_status: Status = Status.Success): + try: + await self.send_single_cmd(cmd=Clusters.EnergyEvse.Commands.Disable(), + endpoint=1, + timedRequestTimeoutMs=timedRequestTimeoutMs) + + except InteractionModelError as e: + asserts.assert_equal(e.status, expected_status, "Unexpected error returned") + + def desc_TC_EEVSE_2_4(self) -> str: + """Returns a description of this test""" + return "5.1.XXX. [TC-EEVSE-2.4] Fault test functionality with DUT as Server" + + def pics_TC_EEVSE_2_4(self): + """ This function returns a list of PICS for this test case that must be True for the test to be run""" + # In this case - there is no feature flags needed to run this test case + return None + + def steps_TC_EEVSE_2_4(self) -> list[TestStep]: + steps = [ + TestStep("1", "Commissioning, already done", is_commissioning=True), + TestStep("2", "TH reads TestEventTriggersEnabled attribute from General Diagnostics Cluster. Verify that TestEventTriggersEnabled attribute has a value of 1 (True)"), + TestStep("3", "TH sends TestEventTrigger command to General Diagnostics Cluster on Endpoint 0 with EnableKey field set to PIXIT.EEVSE.TEST_EVENT_TRIGGER_KEY and EventTrigger field set to PIXIT.EEVSE.TEST_EVENT_TRIGGER for Basic Functionality Test Event"), + TestStep("3a", "After a few seconds TH reads from the DUT the State attribute. Verify value is 0x00 (NotPluggedIn)"), + TestStep("3b", "TH reads from the DUT the SupplyState attribute. Verify value is 0x00 (Disabled)"), + TestStep("3c", "TH reads from the DUT the FaultState attribute. Verify value is 0x00 (NoError)"), + TestStep("4", "TH sends TestEventTrigger command to General Diagnostics Cluster on Endpoint 0 with EnableKey field set to PIXIT.EEVSE.TEST_EVENT_TRIGGER_KEY and EventTrigger field set to PIXIT.EEVSE.TEST_EVENT_TRIGGER for EV Plugged-in Test Event. Verify Event EEVSE.S.E00(EVConnected) sent"), + TestStep("4a", "TH reads from the DUT the State attribute. Verify value is 0x01 (PluggedInNoDemand)"), + TestStep("4b", "TH reads from the DUT the SessionID attribute. Value is saved for later"), + TestStep("5", "TH sends command EnableCharging with ChargingEnabledUntil=Null, minimumChargeCurrent=6000, maximumChargeCurrent=60000"), + TestStep("6", "TH sends TestEventTrigger command to General Diagnostics Cluster on Endpoint 0 with EnableKey field set to PIXIT.EEVSE.TEST_EVENT_TRIGGER_KEY and EventTrigger field set to PIXIT.EEVSE.TEST_EVENT_TRIGGER for EV Charge Demand Test Event. Verify Event EEVSE.S.E02(EnergyTransferStarted) sent."), + TestStep("6a", "TH reads from the DUT the State attribute. Verify value is 0x3 (PluggedInCharging)"), + TestStep("6b", "TH reads from the DUT the SupplyState attribute. Verify value is 0x1 (ChargingEnabled)"), + TestStep("7", "TH sends TestEventTrigger command to General Diagnostics Cluster on Endpoint 0 with EnableKey field set to PIXIT.EEVSE.TEST_EVENT_TRIGGER_KEY and EventTrigger field set to PIXIT.EEVSE.TEST_EVENT_TRIGGER for EVSE Ground Fault Test Event. Verify Event EEVSE.S.E04(Fault) sent with SessionID matching value in step 4b, FaultStatePreviousFaultState = 0x00 (NoError), FaultStateCurrentFaultState = 0x07 (GroundFault)"), + TestStep("7a", "TH reads from the DUT the State attribute. Verify value is 0x6 (Fault)"), + TestStep("7b", "TH reads from the DUT the SupplyState attribute. Verify value is 0x4 (DisabledError)"), + TestStep("8", "TH sends TestEventTrigger command to General Diagnostics Cluster on Endpoint 0 with EnableKey field set to PIXIT.EEVSE.TEST_EVENT_TRIGGER_KEY and EventTrigger field set to PIXIT.EEVSE.TEST_EVENT_TRIGGER for EVSE Over Temperature Fault Test Event. Verify Event EEVSE.S.E04(Fault) sent with SessionID matching value in step 4b, FaultStatePreviousFaultState = 0x07 (GroundFault), FaultStateCurrentFaultState = 0x0F (OverTemperature)"), + TestStep("8a", "TH reads from the DUT the State attribute. Verify value is 0x6 (Fault)"), + TestStep("8b", "TH reads from the DUT the SupplyState attribute. Verify value is 0x4 (DisabledError)"), + TestStep("9", "TH sends TestEventTrigger command to General Diagnostics Cluster on Endpoint 0 with EnableKey field set to PIXIT.EEVSE.TEST_EVENT_TRIGGER_KEY and EventTrigger field set to PIXIT.EEVSE.TEST_EVENT_TRIGGER for EVSE Fault Test Event Clear. Verify Event EEVSE.S.E04(Fault) sent with SessionID matching value in step 4b, FaultStatePreviousFaultState = 0x0F (OverTemperature), FaultStateCurrentFaultState = 0x00 (NoError)"), + TestStep("9a", "TH reads from the DUT the State attribute. Verify value is 0x3 (PluggedInCharging)"), + TestStep("9b", "TH reads from the DUT the SupplyState attribute. Verify value is 0x1 (ChargingEnabled)"), + TestStep("10", "TH sends TestEventTrigger command to General Diagnostics Cluster on Endpoint 0 with EnableKey field set to PIXIT.EEVSE.TEST_EVENT_TRIGGER_KEY and EventTrigger field set to PIXIT.EEVSE.TEST_EVENT_TRIGGER for EV Charge Demand Test Event Clear."), + TestStep("11", "TH sends TestEventTrigger command to General Diagnostics Cluster on Endpoint 0 with EnableKey field set to PIXIT.EEVSE.TEST_EVENT_TRIGGER_KEY and EventTrigger field set to PIXIT.EEVSE.TEST_EVENT_TRIGGER for EV Plugged-in Test Event Clear. Verify Event EEVSE.S.E01(EVNotDetected) sent"), + TestStep("12", "TH sends TestEventTrigger command to General Diagnostics Cluster on Endpoint 0 with EnableKey field set to PIXIT.EEVSE.TEST_EVENT_TRIGGER_KEY and EventTrigger field set to PIXIT.EEVSE.TEST_EVENT_TRIGGER for Basic Functionality Test Event Clear."), + ] + + return steps + + async def send_test_event_triggers(self, enableKey=bytes([b for b in range(16)]), eventTrigger=0x0099000000000000): + try: + await self.send_single_cmd(endpoint=0, + cmd=Clusters.GeneralDiagnostics.Commands.TestEventTrigger( + enableKey, + eventTrigger) + ) + + except InteractionModelError as e: + asserts.fail(f"Unexpected error returned - {e.status}") + + # TC_EEVSE_2_4 tests steps + async def check_test_event_triggers_enabled(self): + full_attr = Clusters.GeneralDiagnostics.Attributes.TestEventTriggersEnabled + cluster = Clusters.Objects.GeneralDiagnostics + test_event_enabled = await self.read_single_attribute_check_success(endpoint=0, cluster=cluster, attribute=full_attr) + asserts.assert_equal(test_event_enabled, True, "TestEventTriggersEnabled is False") + + async def send_test_event_trigger_basic(self): + await self.send_test_event_triggers(eventTrigger=0x0099000000000000) + + async def send_test_event_trigger_basic_clear(self): + await self.send_test_event_triggers(eventTrigger=0x0099000000000001) + + async def send_test_event_trigger_pluggedin(self): + await self.send_test_event_triggers(eventTrigger=0x0099000000000002) + + async def send_test_event_trigger_pluggedin_clear(self): + await self.send_test_event_triggers(eventTrigger=0x0099000000000003) + + async def send_test_event_trigger_charge_demand(self): + await self.send_test_event_triggers(eventTrigger=0x0099000000000004) + + async def send_test_event_trigger_charge_demand_clear(self): + await self.send_test_event_triggers(eventTrigger=0x0099000000000005) + + async def send_test_event_trigger_evse_ground_fault(self): + await self.send_test_event_triggers(eventTrigger=0x0099000000000010) + + async def send_test_event_trigger_evse_over_temperature_fault(self): + await self.send_test_event_triggers(eventTrigger=0x0099000000000011) + + async def send_test_event_trigger_evse_fault_clear(self): + await self.send_test_event_triggers(eventTrigger=0x0099000000000012) + + async def send_test_event_trigger_evse_diagnostics_complete(self): + await self.send_test_event_triggers(eventTrigger=0x0099000000000020) + + def validate_energy_transfer_started_event(self, event_data, session_id, expected_state, expected_max_charge): + asserts.assert_equal(session_id, event_data.sessionID, + f"EnergyTransferStarted event session ID was {event_data.sessionID}, expected {session_id}") + asserts.assert_equal(expected_state, event_data.state, + f"EnergyTransferStarted event State was {event_data.state} expected {expected_state}") + asserts.assert_equal(expected_max_charge, event_data.maximumCurrent, + f"EnergyTransferStarted event maximumCurrent was {event_data.maximumCurrent}, expected {expected_max_charge}") + + def validate_energy_transfer_stopped_event(self, event_data, session_id, expected_state, expected_reason): + asserts.assert_equal(session_id, event_data.sessionID, + f"EnergyTransferStopped event session ID was {event_data.sessionID}, expected {session_id}") + asserts.assert_equal(expected_state, event_data.state, + f"EnergyTransferStopped event State was {event_data.state} expected {expected_state}") + asserts.assert_equal(expected_reason, event_data.reason, + f"EnergyTransferStopped event reason was {event_data.reason}, expected {expected_reason}") + + def validate_ev_connected_event(self, event_data, session_id): + asserts.assert_equal(session_id, event_data.sessionID, + f"EvConnected event session ID was {event_data.sessionID}, expected {session_id}") + + def validate_ev_not_detected_event(self, event_data, session_id, expected_state, expected_duration, expected_charged): + asserts.assert_equal(session_id, event_data.sessionID, + f"EvNotDetected event session ID was {event_data.sessionID}, expected {session_id}") + asserts.assert_equal(expected_state, event_data.state, + f"EvNotDetected event event State was {event_data.state} expected {expected_state}") + asserts.assert_greater_equal(event_data.sessionDuration, expected_duration, + f"EvNotDetected event sessionDuration was {event_data.sessionDuration}, expected >= {expected_duration}") + asserts.assert_greater_equal(event_data.sessionEnergyCharged, expected_charged, + f"EvNotDetected event sessionEnergyCharged was {event_data.sessionEnergyCharged}, expected >= {expected_charged}") + + def validate_evse_fault_event(self, event_data, session_id, expected_state, previous_fault, current_fault): + asserts.assert_equal(session_id, event_data.sessionID, + f"Fault event session ID was {event_data.sessionID}, expected {session_id}") + asserts.assert_equal(expected_state, event_data.state, + f"Fault event State was {event_data.state} expected {expected_state}") + asserts.assert_equal(event_data.faultStatePreviousState, previous_fault, + f"Fault event faultStatePreviousState was {event_data.faultStatePreviousState}, expected {previous_fault}") + asserts.assert_equal(event_data.faultStateCurrentState, current_fault, + f"Fault event faultStateCurrentState was {event_data.faultStateCurrentState}, expected {current_fault}") + + @async_test_body + async def test_TC_EEVSE_2_4(self): + self.step("1") + # Commission DUT - already done + + # Subscribe to Events and when they are sent push them to a queue for checking later + events_callback = EventChangeCallback(Clusters.EnergyEvse) + await events_callback.start(self.default_controller, self.dut_node_id) + + self.step("2") + await self.check_test_event_triggers_enabled() + + self.step("3") + await self.send_test_event_trigger_basic() + + # After a few seconds... + time.sleep(3) + + self.step("3a") + await self.check_evse_attribute("State", Clusters.EnergyEvse.Enums.StateEnum.kNotPluggedIn) + + self.step("3b") + await self.check_evse_attribute("SupplyState", Clusters.EnergyEvse.Enums.SupplyStateEnum.kDisabled) + + self.step("3c") + await self.check_evse_attribute("FaultState", Clusters.EnergyEvse.Enums.FaultStateEnum.kNoError) + + self.step("4") + await self.send_test_event_trigger_pluggedin() + event_data = events_callback.WaitForEventReport(Clusters.EnergyEvse.Events.EVConnected) + + self.step("4a") + await self.check_evse_attribute("State", Clusters.EnergyEvse.Enums.StateEnum.kPluggedInNoDemand) + + self.step("4b") + # Save Session ID for later and check it against the value in the event + session_id = await self.read_evse_attribute_expect_success(endpoint=1, attribute="SessionID") + self.validate_ev_connected_event(event_data, session_id) + + self.step("5") + charge_until = NullValue + min_charge_current = 6000 + max_charge_current = 60000 + await self.send_enable_charge_command(endpoint=1, charge_until=charge_until, min_charge=min_charge_current, max_charge=max_charge_current) + + self.step("6") + await self.send_test_event_trigger_charge_demand() + event_data = events_callback.WaitForEventReport(Clusters.EnergyEvse.Events.EnergyTransferStarted) + + self.step("6a") + await self.check_evse_attribute("State", Clusters.EnergyEvse.Enums.StateEnum.kPluggedInCharging) + + self.step("6b") + await self.check_evse_attribute("SupplyState", Clusters.EnergyEvse.Enums.SupplyStateEnum.kChargingEnabled) + + self.step("7") + await self.send_test_event_trigger_evse_ground_fault() + event_data = events_callback.WaitForEventReport(Clusters.EnergyEvse.Events.Fault) + expected_state = Clusters.EnergyEvse.Enums.StateEnum.kPluggedInCharging + previous_fault = Clusters.EnergyEvse.Enums.FaultStateEnum.kNoError + current_fault = Clusters.EnergyEvse.Enums.FaultStateEnum.kGroundFault + self.validate_evse_fault_event(event_data, session_id, expected_state, previous_fault, current_fault) + + self.step("7a") + await self.check_evse_attribute("State", Clusters.EnergyEvse.Enums.StateEnum.kFault) + + self.step("7b") + await self.check_evse_attribute("SupplyState", Clusters.EnergyEvse.Enums.SupplyStateEnum.kDisabledError) + + self.step("8") + await self.send_test_event_trigger_evse_over_temperature_fault() + event_data = events_callback.WaitForEventReport(Clusters.EnergyEvse.Events.Fault) + expected_state = Clusters.EnergyEvse.Enums.StateEnum.kFault + previous_fault = Clusters.EnergyEvse.Enums.FaultStateEnum.kGroundFault + current_fault = Clusters.EnergyEvse.Enums.FaultStateEnum.kOverTemperature + self.validate_evse_fault_event(event_data, session_id, expected_state, previous_fault, current_fault) + + self.step("8a") + await self.check_evse_attribute("State", Clusters.EnergyEvse.Enums.StateEnum.kFault) + + self.step("8b") + await self.check_evse_attribute("SupplyState", Clusters.EnergyEvse.Enums.SupplyStateEnum.kDisabledError) + + self.step("9") + await self.send_test_event_trigger_evse_fault_clear() + event_data = events_callback.WaitForEventReport(Clusters.EnergyEvse.Events.Fault) + expected_state = Clusters.EnergyEvse.Enums.StateEnum.kFault + previous_fault = Clusters.EnergyEvse.Enums.FaultStateEnum.kOverTemperature + current_fault = Clusters.EnergyEvse.Enums.FaultStateEnum.kNoError + self.validate_evse_fault_event(event_data, session_id, expected_state, previous_fault, current_fault) + + self.step("9a") + await self.check_evse_attribute("State", Clusters.EnergyEvse.Enums.StateEnum.kPluggedInCharging) + + self.step("9b") + await self.check_evse_attribute("SupplyState", Clusters.EnergyEvse.Enums.SupplyStateEnum.kChargingEnabled) + + self.step("10") + await self.send_test_event_trigger_charge_demand_clear() + event_data = events_callback.WaitForEventReport(Clusters.EnergyEvse.Events.EnergyTransferStopped) + + self.step("11") + await self.send_test_event_trigger_pluggedin_clear() + event_data = events_callback.WaitForEventReport(Clusters.EnergyEvse.Events.EVNotDetected) + expected_state = Clusters.EnergyEvse.Enums.StateEnum.kPluggedInNoDemand + self.validate_ev_not_detected_event(event_data, session_id, expected_state, expected_duration=0, expected_charged=0) + + self.step("12") + await self.send_test_event_trigger_basic_clear() + + +if __name__ == "__main__": + default_matter_test_main() From 9b02ef8c14a49702cf030ca4d6342e6492f98b7b Mon Sep 17 00:00:00 2001 From: James Harrow Date: Tue, 9 Jan 2024 17:00:08 +0000 Subject: [PATCH 082/114] Fix lint issue - unused datetime modules. --- src/python_testing/TC_EEVSE_2_4.py | 1 - 1 file changed, 1 deletion(-) diff --git a/src/python_testing/TC_EEVSE_2_4.py b/src/python_testing/TC_EEVSE_2_4.py index e07b6602a9f000..a686f4a657f572 100644 --- a/src/python_testing/TC_EEVSE_2_4.py +++ b/src/python_testing/TC_EEVSE_2_4.py @@ -18,7 +18,6 @@ import logging import queue import time -from datetime import datetime, timedelta, timezone import chip.clusters as Clusters from chip.clusters import ClusterObjects as ClusterObjects From 228ffeda92ad0477b38d70b35873aba9b0095e43 Mon Sep 17 00:00:00 2001 From: James Harrow Date: Wed, 10 Jan 2024 11:58:36 +0000 Subject: [PATCH 083/114] Committed suggested change to comment --- .../device-energy-management-server.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/app/clusters/device-energy-management-server/device-energy-management-server.cpp b/src/app/clusters/device-energy-management-server/device-energy-management-server.cpp index 255976b61da748..eb63aa31da330f 100644 --- a/src/app/clusters/device-energy-management-server/device-energy-management-server.cpp +++ b/src/app/clusters/device-energy-management-server/device-energy-management-server.cpp @@ -336,7 +336,7 @@ void Instance::HandleStartTimeAdjustRequest(HandlerContext & ctx, /* earliestStartTime is optional based on the StartTimeAdjust (STA) feature AND is nullable */ if (!(forecast.earliestStartTime.HasValue()) || !(forecast.latestEndTime.HasValue())) { - /* These should not be NULL since this command requires STA feature and these are mandatory for that */ + /* These should have values, since this command requires STA feature and these are mandatory for that */ ChipLogError(Zcl, "DEM: EarliestStartTime / LatestEndTime do not have values"); ctx.mCommandHandler.AddStatus(ctx.mRequestPath, Status::Failure); return; From 925a701a12e76b6587027973737294a42fae084b Mon Sep 17 00:00:00 2001 From: James Harrow Date: Wed, 10 Jan 2024 22:58:03 +0000 Subject: [PATCH 084/114] Added TC_EEVSE_2_5.py to support DiagnosticsCommand testing. Also changed the SupplyState reverting to Disabled once diagnostics is complete to match the spec. --- .../include/EnergyEvseDelegateImpl.h | 5 +- .../src/EnergyEvseDelegateImpl.cpp | 16 +- src/python_testing/TC_EEVSE_2_5.py | 216 ++++++++++++++++++ 3 files changed, 221 insertions(+), 16 deletions(-) create mode 100644 src/python_testing/TC_EEVSE_2_5.py diff --git a/examples/energy-management-app/energy-management-common/include/EnergyEvseDelegateImpl.h b/examples/energy-management-app/energy-management-common/include/EnergyEvseDelegateImpl.h index 97da46322fd5d4..dc46e58d5021a7 100644 --- a/examples/energy-management-app/energy-management-common/include/EnergyEvseDelegateImpl.h +++ b/examples/energy-management-app/energy-management-common/include/EnergyEvseDelegateImpl.h @@ -227,9 +227,8 @@ class EnergyEvseDelegate : public EnergyEvse::Delegate StateEnum mHwState = StateEnum::kNotPluggedIn; /* Hardware state */ /* Variables to hold State and SupplyState in case a fault is raised */ - StateEnum mStateBeforeFault = StateEnum::kUnknownEnumValue; - SupplyStateEnum mSupplyStateBeforeFault = SupplyStateEnum::kUnknownEnumValue; - SupplyStateEnum mSupplyStateBeforeDiagnostics = SupplyStateEnum::kUnknownEnumValue; + StateEnum mStateBeforeFault = StateEnum::kUnknownEnumValue; + SupplyStateEnum mSupplyStateBeforeFault = SupplyStateEnum::kUnknownEnumValue; /* Callback related */ EVSECallbackWrapper mCallbacks = { .handler = nullptr, .arg = 0 }; /* Wrapper to allow callbacks to be registered */ diff --git a/examples/energy-management-app/energy-management-common/src/EnergyEvseDelegateImpl.cpp b/examples/energy-management-app/energy-management-common/src/EnergyEvseDelegateImpl.cpp index 468b6d5536a678..095d8914660cd4 100644 --- a/examples/energy-management-app/energy-management-common/src/EnergyEvseDelegateImpl.cpp +++ b/examples/energy-management-app/energy-management-common/src/EnergyEvseDelegateImpl.cpp @@ -153,14 +153,6 @@ Status EnergyEvseDelegate::StartDiagnostics() return Status::Failure; } - /* update SupplyState to indicate we are now in Diagnostics mode */ - if (mSupplyStateBeforeDiagnostics != SupplyStateEnum::kUnknownEnumValue) - { - ChipLogError(AppServer, "EVSE: Something wrong trying to go into diagnostics mode"); - return Status::Failure; - } - - mSupplyStateBeforeDiagnostics = mSupplyState; // Update the SupplyState - this will automatically callback the Application StateChanged callback SetSupplyState(SupplyStateEnum::kDisabledDiagnostics); @@ -434,11 +426,9 @@ Status EnergyEvseDelegate::HwDiagnosticsComplete() return Status::Failure; } - /* Restore the SupplyState to the saved state before diagnostics were triggered */ - SetSupplyState(mSupplyStateBeforeDiagnostics); - - /* Set the sentinel back for checking another diagnostics command */ - mSupplyStateBeforeDiagnostics = SupplyStateEnum::kUnknownEnumValue; + /* Restore the SupplyState to Disabled (per spec) - client will need to + * re-enable charging or discharging to get out of this state */ + SetSupplyState(SupplyStateEnum::kDisabled); return Status::Success; } diff --git a/src/python_testing/TC_EEVSE_2_5.py b/src/python_testing/TC_EEVSE_2_5.py new file mode 100644 index 00000000000000..78737af4b6637a --- /dev/null +++ b/src/python_testing/TC_EEVSE_2_5.py @@ -0,0 +1,216 @@ +# +# Copyright (c) 2023 Project CHIP Authors +# All rights reserved. +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + + +import logging +import queue +import time + +import chip.clusters as Clusters +from chip.clusters import ClusterObjects as ClusterObjects +from chip.clusters.Attribute import EventReadResult, SubscriptionTransaction +from chip.clusters.Types import NullValue +from chip.interaction_model import InteractionModelError, Status +from matter_testing_support import MatterBaseTest, TestStep, async_test_body, default_matter_test_main +from mobly import asserts + +logger = logging.getLogger(__name__) + + +class EventChangeCallback: + def __init__(self, expected_cluster: ClusterObjects): + self._q = queue.Queue() + self._expected_cluster = expected_cluster + + async def start(self, dev_ctrl, nodeid): + self._subscription = await dev_ctrl.ReadEvent(nodeid, + events=[(1, self._expected_cluster, 1)], reportInterval=(1, 5), + fabricFiltered=False, keepSubscriptions=True, autoResubscribe=False) + self._subscription.SetEventUpdateCallback(self.__call__) + + def __call__(self, res: EventReadResult, transaction: SubscriptionTransaction): + if res.Status == Status.Success and res.Header.ClusterId == self._expected_cluster.id: + logging.info( + f'Got subscription report for event on cluster {self._expected_cluster}: {res.Data}') + self._q.put(res) + + def WaitForEventReport(self, expected_event: ClusterObjects.ClusterEvent): + try: + res = self._q.get(block=True, timeout=10) + except queue.Empty: + asserts.fail("Failed to receive a report for the event {}".format(expected_event)) + + asserts.assert_equal(res.Header.ClusterId, expected_event.cluster_id, "Expected cluster ID not found in event report") + asserts.assert_equal(res.Header.EventId, expected_event.event_id, "Expected event ID not found in event report") + return res.Data + + +class TC_EEVSE_2_5(MatterBaseTest): + async def read_evse_attribute_expect_success(self, endpoint, attribute): + full_attr = getattr(Clusters.EnergyEvse.Attributes, attribute) + cluster = Clusters.Objects.EnergyEvse + return await self.read_single_attribute_check_success(endpoint=endpoint, cluster=cluster, attribute=full_attr) + + async def check_evse_attribute(self, attribute, expected_value): + value = await self.read_evse_attribute_expect_success(endpoint=1, attribute=attribute) + asserts.assert_equal(value, expected_value, + f"Unexpected '{attribute}' value - expected {expected_value}, was {value}") + + async def send_enable_charge_command(self, endpoint: int = 0, charge_until: int = None, timedRequestTimeoutMs: int = 3000, + min_charge: int = None, max_charge: int = None, expected_status: Status = Status.Success): + try: + await self.send_single_cmd(cmd=Clusters.EnergyEvse.Commands.EnableCharging( + chargingEnabledUntil=charge_until, + minimumChargeCurrent=min_charge, + maximumChargeCurrent=max_charge), + endpoint=1, + timedRequestTimeoutMs=timedRequestTimeoutMs) + + except InteractionModelError as e: + asserts.assert_equal(e.status, expected_status, "Unexpected error returned") + + async def send_start_diagnostics_command(self, endpoint: int = 0, timedRequestTimeoutMs: int = 3000, + expected_status: Status = Status.Success): + try: + await self.send_single_cmd(cmd=Clusters.EnergyEvse.Commands.StartDiagnostics(), + endpoint=1, + timedRequestTimeoutMs=timedRequestTimeoutMs) + + except InteractionModelError as e: + asserts.assert_equal(e.status, expected_status, "Unexpected error returned") + + def desc_TC_EEVSE_2_5(self) -> str: + """Returns a description of this test""" + return "5.1.XXX. [TC-EEVSE-2.4] Fault test functionality with DUT as Server" + + def pics_TC_EEVSE_2_5(self): + """ This function returns a list of PICS for this test case that must be True for the test to be run""" + # In this case - there is no feature flags needed to run this test case + return None + + def steps_TC_EEVSE_2_5(self) -> list[TestStep]: + steps = [ + TestStep("1", "Commissioning, already done", is_commissioning=True), + TestStep("2", "TH reads TestEventTriggersEnabled attribute from General Diagnostics Cluster. Verify that TestEventTriggersEnabled attribute has a value of 1 (True)"), + TestStep("3", "TH sends TestEventTrigger command to General Diagnostics Cluster on Endpoint 0 with EnableKey field set to PIXIT.EEVSE.TEST_EVENT_TRIGGER_KEY and EventTrigger field set to PIXIT.EEVSE.TEST_EVENT_TRIGGER for Basic Functionality Test Event"), + TestStep("3a", "After a few seconds TH reads from the DUT the State attribute. Verify value is 0x00 (NotPluggedIn)"), + TestStep("3b", "TH reads from the DUT the SupplyState attribute. Verify value is 0x00 (Disabled)"), + TestStep("3c", "TH reads from the DUT the FaultState attribute. Verify value is 0x00 (NoError)"), + TestStep("4", "TH sends command EnableCharging with ChargingEnabledUntil=Null, minimumChargeCurrent=6000, maximumChargeCurrent=60000"), + TestStep("4a", "TH reads from the DUT the State attribute. Verify value is 0x00 (NotPluggedIn)"), + TestStep("4b", "TH reads from the DUT the SupplyState attribute. Verify value is 0x00 (ChargingEnabled)"), + TestStep("5", "TH sends command StartDiagnostics"), + TestStep("5a", "TH reads from the DUT the State attribute. Verify value is 0x00 (NotPluggedIn)"), + TestStep("5b", "TH reads from the DUT the SupplyState attribute. Verify value is 0x04 (DisabledDiagnostics)"), + TestStep("6", "A few seconds later TH sends TestEventTrigger command to General Diagnostics Cluster on Endpoint 0 with EnableKey field set to PIXIT.EEVSE.TEST_EVENT_TRIGGER_KEY and EventTrigger field set to PIXIT.EEVSE.TEST_EVENT_TRIGGER for EVSE Diagnostics Complete Event"), + TestStep("6a", "TH reads from the DUT the State attribute. Verify value is 0x00 (NotPluggedIn)"), + TestStep("6b", "TH reads from the DUT the SupplyState attribute. Verify value is 0x04 (Disabled)"), + TestStep("7", "TH sends TestEventTrigger command to General Diagnostics Cluster on Endpoint 0 with EnableKey field set to PIXIT.EEVSE.TEST_EVENT_TRIGGER_KEY and EventTrigger field set to PIXIT.EEVSE.TEST_EVENT_TRIGGER for Basic Functionality Test Event Clear."), + ] + + return steps + + async def send_test_event_triggers(self, enableKey=bytes([b for b in range(16)]), eventTrigger=0x0099000000000000): + try: + await self.send_single_cmd(endpoint=0, + cmd=Clusters.GeneralDiagnostics.Commands.TestEventTrigger( + enableKey, + eventTrigger) + ) + + except InteractionModelError as e: + asserts.fail(f"Unexpected error returned - {e.status}") + + # TC_EEVSE_2_5 tests steps + async def check_test_event_triggers_enabled(self): + full_attr = Clusters.GeneralDiagnostics.Attributes.TestEventTriggersEnabled + cluster = Clusters.Objects.GeneralDiagnostics + test_event_enabled = await self.read_single_attribute_check_success(endpoint=0, cluster=cluster, attribute=full_attr) + asserts.assert_equal(test_event_enabled, True, "TestEventTriggersEnabled is False") + + async def send_test_event_trigger_basic(self): + await self.send_test_event_triggers(eventTrigger=0x0099000000000000) + + async def send_test_event_trigger_basic_clear(self): + await self.send_test_event_triggers(eventTrigger=0x0099000000000001) + + async def send_test_event_trigger_evse_diagnostics_complete(self): + await self.send_test_event_triggers(eventTrigger=0x0099000000000020) + + @async_test_body + async def test_TC_EEVSE_2_5(self): + self.step("1") + # Commission DUT - already done + + # Subscribe to Events and when they are sent push them to a queue for checking later + events_callback = EventChangeCallback(Clusters.EnergyEvse) + await events_callback.start(self.default_controller, self.dut_node_id) + + self.step("2") + await self.check_test_event_triggers_enabled() + + self.step("3") + await self.send_test_event_trigger_basic() + + # After a few seconds... + time.sleep(1) + + self.step("3a") + await self.check_evse_attribute("State", Clusters.EnergyEvse.Enums.StateEnum.kNotPluggedIn) + + self.step("3b") + await self.check_evse_attribute("SupplyState", Clusters.EnergyEvse.Enums.SupplyStateEnum.kDisabled) + + self.step("3c") + await self.check_evse_attribute("FaultState", Clusters.EnergyEvse.Enums.FaultStateEnum.kNoError) + + self.step("4") + charge_until = NullValue + min_charge_current = 6000 + max_charge_current = 60000 + await self.send_enable_charge_command(endpoint=1, charge_until=charge_until, min_charge=min_charge_current, max_charge=max_charge_current) + + self.step("4a") + await self.check_evse_attribute("State", Clusters.EnergyEvse.Enums.StateEnum.kNotPluggedIn) + + self.step("4b") + await self.check_evse_attribute("SupplyState", Clusters.EnergyEvse.Enums.SupplyStateEnum.kChargingEnabled) + + self.step("5") + await self.send_start_diagnostics_command(endpoint=1) + + self.step("5a") + await self.check_evse_attribute("State", Clusters.EnergyEvse.Enums.StateEnum.kNotPluggedIn) + + self.step("5b") + await self.check_evse_attribute("SupplyState", Clusters.EnergyEvse.Enums.SupplyStateEnum.kDisabledDiagnostics) + + self.step("6") + await self.send_test_event_trigger_evse_diagnostics_complete() + + self.step("6a") + await self.check_evse_attribute("State", Clusters.EnergyEvse.Enums.StateEnum.kNotPluggedIn) + + self.step("6b") + # It should go to disabled after a diagnostics session + await self.check_evse_attribute("SupplyState", Clusters.EnergyEvse.Enums.SupplyStateEnum.kDisabled) + + self.step("7") + await self.send_test_event_trigger_basic_clear() + + +if __name__ == "__main__": + default_matter_test_main() From bd83ba4f2dd8fbf49e508e7af59d4750a6c495c4 Mon Sep 17 00:00:00 2001 From: James Harrow Date: Thu, 11 Jan 2024 01:39:24 +0000 Subject: [PATCH 085/114] Created a helper EEVSE base class to avoid repetition in the different test cases. --- src/python_testing/TC_EEVSE_2_2.py | 135 +------------------ src/python_testing/TC_EEVSE_2_4.py | 160 +--------------------- src/python_testing/TC_EEVSE_2_5.py | 91 +------------ src/python_testing/TC_EEVSE_Utils.py | 191 +++++++++++++++++++++++++++ 4 files changed, 202 insertions(+), 375 deletions(-) create mode 100644 src/python_testing/TC_EEVSE_Utils.py diff --git a/src/python_testing/TC_EEVSE_2_2.py b/src/python_testing/TC_EEVSE_2_2.py index faac9004e6909b..f92e577a9315ae 100644 --- a/src/python_testing/TC_EEVSE_2_2.py +++ b/src/python_testing/TC_EEVSE_2_2.py @@ -28,50 +28,12 @@ from matter_testing_support import MatterBaseTest, TestStep, async_test_body, default_matter_test_main from mobly import asserts -logger = logging.getLogger(__name__) - - -class EventChangeCallback: - def __init__(self, expected_cluster: ClusterObjects): - self._q = queue.Queue() - self._expected_cluster = expected_cluster - - async def start(self, dev_ctrl, nodeid): - self._subscription = await dev_ctrl.ReadEvent(nodeid, - events=[(1, self._expected_cluster, 1)], reportInterval=(1, 5), - fabricFiltered=False, keepSubscriptions=True, autoResubscribe=False) - self._subscription.SetEventUpdateCallback(self.__call__) - - def __call__(self, res: EventReadResult, transaction: SubscriptionTransaction): - if res.Status == Status.Success and res.Header.ClusterId == self._expected_cluster.id: - logging.info( - f'Got subscription report for event on cluster {self._expected_cluster}: {res.Data}') - self._q.put(res) - - def WaitForEventReport(self, expected_event: ClusterObjects.ClusterEvent): - try: - res = self._q.get(block=True, timeout=10) - except queue.Empty: - asserts.fail("Failed to receive a report for the event {}".format(expected_event)) - - asserts.assert_equal(res.Header.ClusterId, expected_event.cluster_id, "Expected cluster ID not found in event report") - asserts.assert_equal(res.Header.EventId, expected_event.event_id, "Expected event ID not found in event report") - return res.Data - +from TC_EEVSE_Utils import EventChangeCallback, EEVSEBaseTestHelper -class TC_EEVSE_2_2(MatterBaseTest): - async def read_evse_attribute_expect_success(self, endpoint, attribute): - full_attr = getattr(Clusters.EnergyEvse.Attributes, attribute) - cluster = Clusters.Objects.EnergyEvse - return await self.read_single_attribute_check_success(endpoint=endpoint, cluster=cluster, attribute=full_attr) +logger = logging.getLogger(__name__) - async def check_evse_attribute(self, attribute, expected_value): - value = await self.read_evse_attribute_expect_success(endpoint=1, attribute=attribute) - asserts.assert_equal(value, expected_value, - f"Unexpected '{attribute}' value - expected {expected_value}, was {value}") - async def get_supported_energy_evse_attributes(self, endpoint): - return await self.read_evse_attribute_expect_success(endpoint, "AttributeList") +class TC_EEVSE_2_2(MatterBaseTest, EEVSEBaseTestHelper): async def write_user_max_charge(self, endpoint, user_max_charge): result = await self.default_controller.WriteAttribute(self.dut_node_id, @@ -79,28 +41,6 @@ async def write_user_max_charge(self, endpoint, user_max_charge): Clusters.EnergyEvse.Attributes.UserMaximumChargeCurrent(user_max_charge))]) asserts.assert_equal(result[0].Status, Status.Success, "UserMaximumChargeCurrent write failed") - async def send_enable_charge_command(self, endpoint: int = 0, charge_until: int = None, timedRequestTimeoutMs: int = 3000, - min_charge: int = None, max_charge: int = None, expected_status: Status = Status.Success): - try: - await self.send_single_cmd(cmd=Clusters.EnergyEvse.Commands.EnableCharging( - chargingEnabledUntil=charge_until, - minimumChargeCurrent=min_charge, - maximumChargeCurrent=max_charge), - endpoint=1, - timedRequestTimeoutMs=timedRequestTimeoutMs) - - except InteractionModelError as e: - asserts.assert_equal(e.status, expected_status, "Unexpected error returned") - - async def send_disable_command(self, endpoint: int = 0, timedRequestTimeoutMs: int = 3000, expected_status: Status = Status.Success): - try: - await self.send_single_cmd(cmd=Clusters.EnergyEvse.Commands.Disable(), - endpoint=1, - timedRequestTimeoutMs=timedRequestTimeoutMs) - - except InteractionModelError as e: - asserts.assert_equal(e.status, expected_status, "Unexpected error returned") - def desc_TC_EEVSE_2_2(self) -> str: """Returns a description of this test""" return "5.1.3. [TC-EEVSE-2.2] Primary functionality with DUT as Server" @@ -162,74 +102,9 @@ def steps_TC_EEVSE_2_2(self) -> list[TestStep]: return steps - async def send_test_event_triggers(self, enableKey=bytes([b for b in range(16)]), eventTrigger=0x0099000000000000): - try: - await self.send_single_cmd(endpoint=0, - cmd=Clusters.GeneralDiagnostics.Commands.TestEventTrigger( - enableKey, - eventTrigger) - ) - - except InteractionModelError as e: - asserts.fail(f"Unexpected error returned - {e.status}") - - # TC_EEVSE_2_2 tests steps - async def check_test_event_triggers_enabled(self): - full_attr = Clusters.GeneralDiagnostics.Attributes.TestEventTriggersEnabled - cluster = Clusters.Objects.GeneralDiagnostics - test_event_enabled = await self.read_single_attribute_check_success(endpoint=0, cluster=cluster, attribute=full_attr) - asserts.assert_equal(test_event_enabled, True, "TestEventTriggersEnabled is False") - - async def send_test_event_trigger_basic(self): - await self.send_test_event_triggers(eventTrigger=0x0099000000000000) - - async def send_test_event_trigger_basic_clear(self): - await self.send_test_event_triggers(eventTrigger=0x0099000000000001) - - async def send_test_event_trigger_pluggedin(self): - await self.send_test_event_triggers(eventTrigger=0x0099000000000002) - - async def send_test_event_trigger_pluggedin_clear(self): - await self.send_test_event_triggers(eventTrigger=0x0099000000000003) - - async def send_test_event_trigger_charge_demand(self): - await self.send_test_event_triggers(eventTrigger=0x0099000000000004) - - async def send_test_event_trigger_charge_demand_clear(self): - await self.send_test_event_triggers(eventTrigger=0x0099000000000005) - - def validate_energy_transfer_started_event(self, event_data, session_id, expected_state, expected_max_charge): - asserts.assert_equal(session_id, event_data.sessionID, - f"EnergyTransferStarted event session ID was {event_data.sessionID}, expected {session_id}") - asserts.assert_equal(expected_state, event_data.state, - f"EnergyTransferStarted event State was {event_data.state} expected {expected_state}") - asserts.assert_equal(expected_max_charge, event_data.maximumCurrent, - f"EnergyTransferStarted event maximumCurrent was {event_data.maximumCurrent}, expected {expected_max_charge}") - - def validate_energy_transfer_stopped_event(self, event_data, session_id, expected_state, expected_reason): - asserts.assert_equal(session_id, event_data.sessionID, - f"EnergyTransferStopped event session ID was {event_data.sessionID}, expected {session_id}") - asserts.assert_equal(expected_state, event_data.state, - f"EnergyTransferStopped event State was {event_data.state} expected {expected_state}") - asserts.assert_equal(expected_reason, event_data.reason, - f"EnergyTransferStopped event reason was {event_data.reason}, expected {expected_reason}") - - def validate_ev_connected_event(self, event_data, session_id): - asserts.assert_equal(session_id, event_data.sessionID, - f"EvConnected event session ID was {event_data.sessionID}, expected {session_id}") - - def validate_ev_not_detected_event(self, event_data, session_id, expected_state, expected_duration, expected_charged): - asserts.assert_equal(session_id, event_data.sessionID, - f"EvNotDetected event session ID was {event_data.sessionID}, expected {session_id}") - asserts.assert_equal(expected_state, event_data.state, - f"EvNotDetected event event State was {event_data.state} expected {expected_state}") - asserts.assert_greater_equal(event_data.sessionDuration, expected_duration, - f"EvNotDetected event sessionDuration was {event_data.sessionDuration}, expected >= {expected_duration}") - asserts.assert_greater_equal(event_data.sessionEnergyCharged, expected_charged, - f"EvNotDetected event sessionEnergyCharged was {event_data.sessionEnergyCharged}, expected >= {expected_charged}") - @async_test_body async def test_TC_EEVSE_2_2(self): + self.step("1") # Commission DUT - already done @@ -244,7 +119,7 @@ async def test_TC_EEVSE_2_2(self): await self.send_test_event_trigger_basic() # After a few seconds... - time.sleep(3) + time.sleep(1) self.step("3a") await self.check_evse_attribute("State", Clusters.EnergyEvse.Enums.StateEnum.kNotPluggedIn) diff --git a/src/python_testing/TC_EEVSE_2_4.py b/src/python_testing/TC_EEVSE_2_4.py index a686f4a657f572..3e7e947c60d9fb 100644 --- a/src/python_testing/TC_EEVSE_2_4.py +++ b/src/python_testing/TC_EEVSE_2_4.py @@ -27,78 +27,12 @@ from matter_testing_support import MatterBaseTest, TestStep, async_test_body, default_matter_test_main from mobly import asserts +from TC_EEVSE_Utils import EventChangeCallback, EEVSEBaseTestHelper + logger = logging.getLogger(__name__) -class EventChangeCallback: - def __init__(self, expected_cluster: ClusterObjects): - self._q = queue.Queue() - self._expected_cluster = expected_cluster - - async def start(self, dev_ctrl, nodeid): - self._subscription = await dev_ctrl.ReadEvent(nodeid, - events=[(1, self._expected_cluster, 1)], reportInterval=(1, 5), - fabricFiltered=False, keepSubscriptions=True, autoResubscribe=False) - self._subscription.SetEventUpdateCallback(self.__call__) - - def __call__(self, res: EventReadResult, transaction: SubscriptionTransaction): - if res.Status == Status.Success and res.Header.ClusterId == self._expected_cluster.id: - logging.info( - f'Got subscription report for event on cluster {self._expected_cluster}: {res.Data}') - self._q.put(res) - - def WaitForEventReport(self, expected_event: ClusterObjects.ClusterEvent): - try: - res = self._q.get(block=True, timeout=10) - except queue.Empty: - asserts.fail("Failed to receive a report for the event {}".format(expected_event)) - - asserts.assert_equal(res.Header.ClusterId, expected_event.cluster_id, "Expected cluster ID not found in event report") - asserts.assert_equal(res.Header.EventId, expected_event.event_id, "Expected event ID not found in event report") - return res.Data - - -class TC_EEVSE_2_4(MatterBaseTest): - async def read_evse_attribute_expect_success(self, endpoint, attribute): - full_attr = getattr(Clusters.EnergyEvse.Attributes, attribute) - cluster = Clusters.Objects.EnergyEvse - return await self.read_single_attribute_check_success(endpoint=endpoint, cluster=cluster, attribute=full_attr) - - async def check_evse_attribute(self, attribute, expected_value): - value = await self.read_evse_attribute_expect_success(endpoint=1, attribute=attribute) - asserts.assert_equal(value, expected_value, - f"Unexpected '{attribute}' value - expected {expected_value}, was {value}") - - async def get_supported_energy_evse_attributes(self, endpoint): - return await self.read_evse_attribute_expect_success(endpoint, "AttributeList") - - async def write_user_max_charge(self, endpoint, user_max_charge): - result = await self.default_controller.WriteAttribute(self.dut_node_id, - [(endpoint, - Clusters.EnergyEvse.Attributes.UserMaximumChargeCurrent(user_max_charge))]) - asserts.assert_equal(result[0].Status, Status.Success, "UserMaximumChargeCurrent write failed") - - async def send_enable_charge_command(self, endpoint: int = 0, charge_until: int = None, timedRequestTimeoutMs: int = 3000, - min_charge: int = None, max_charge: int = None, expected_status: Status = Status.Success): - try: - await self.send_single_cmd(cmd=Clusters.EnergyEvse.Commands.EnableCharging( - chargingEnabledUntil=charge_until, - minimumChargeCurrent=min_charge, - maximumChargeCurrent=max_charge), - endpoint=1, - timedRequestTimeoutMs=timedRequestTimeoutMs) - - except InteractionModelError as e: - asserts.assert_equal(e.status, expected_status, "Unexpected error returned") - - async def send_disable_command(self, endpoint: int = 0, timedRequestTimeoutMs: int = 3000, expected_status: Status = Status.Success): - try: - await self.send_single_cmd(cmd=Clusters.EnergyEvse.Commands.Disable(), - endpoint=1, - timedRequestTimeoutMs=timedRequestTimeoutMs) - - except InteractionModelError as e: - asserts.assert_equal(e.status, expected_status, "Unexpected error returned") +class TC_EEVSE_2_4(MatterBaseTest, EEVSEBaseTestHelper): def desc_TC_EEVSE_2_4(self) -> str: """Returns a description of this test""" @@ -140,94 +74,6 @@ def steps_TC_EEVSE_2_4(self) -> list[TestStep]: return steps - async def send_test_event_triggers(self, enableKey=bytes([b for b in range(16)]), eventTrigger=0x0099000000000000): - try: - await self.send_single_cmd(endpoint=0, - cmd=Clusters.GeneralDiagnostics.Commands.TestEventTrigger( - enableKey, - eventTrigger) - ) - - except InteractionModelError as e: - asserts.fail(f"Unexpected error returned - {e.status}") - - # TC_EEVSE_2_4 tests steps - async def check_test_event_triggers_enabled(self): - full_attr = Clusters.GeneralDiagnostics.Attributes.TestEventTriggersEnabled - cluster = Clusters.Objects.GeneralDiagnostics - test_event_enabled = await self.read_single_attribute_check_success(endpoint=0, cluster=cluster, attribute=full_attr) - asserts.assert_equal(test_event_enabled, True, "TestEventTriggersEnabled is False") - - async def send_test_event_trigger_basic(self): - await self.send_test_event_triggers(eventTrigger=0x0099000000000000) - - async def send_test_event_trigger_basic_clear(self): - await self.send_test_event_triggers(eventTrigger=0x0099000000000001) - - async def send_test_event_trigger_pluggedin(self): - await self.send_test_event_triggers(eventTrigger=0x0099000000000002) - - async def send_test_event_trigger_pluggedin_clear(self): - await self.send_test_event_triggers(eventTrigger=0x0099000000000003) - - async def send_test_event_trigger_charge_demand(self): - await self.send_test_event_triggers(eventTrigger=0x0099000000000004) - - async def send_test_event_trigger_charge_demand_clear(self): - await self.send_test_event_triggers(eventTrigger=0x0099000000000005) - - async def send_test_event_trigger_evse_ground_fault(self): - await self.send_test_event_triggers(eventTrigger=0x0099000000000010) - - async def send_test_event_trigger_evse_over_temperature_fault(self): - await self.send_test_event_triggers(eventTrigger=0x0099000000000011) - - async def send_test_event_trigger_evse_fault_clear(self): - await self.send_test_event_triggers(eventTrigger=0x0099000000000012) - - async def send_test_event_trigger_evse_diagnostics_complete(self): - await self.send_test_event_triggers(eventTrigger=0x0099000000000020) - - def validate_energy_transfer_started_event(self, event_data, session_id, expected_state, expected_max_charge): - asserts.assert_equal(session_id, event_data.sessionID, - f"EnergyTransferStarted event session ID was {event_data.sessionID}, expected {session_id}") - asserts.assert_equal(expected_state, event_data.state, - f"EnergyTransferStarted event State was {event_data.state} expected {expected_state}") - asserts.assert_equal(expected_max_charge, event_data.maximumCurrent, - f"EnergyTransferStarted event maximumCurrent was {event_data.maximumCurrent}, expected {expected_max_charge}") - - def validate_energy_transfer_stopped_event(self, event_data, session_id, expected_state, expected_reason): - asserts.assert_equal(session_id, event_data.sessionID, - f"EnergyTransferStopped event session ID was {event_data.sessionID}, expected {session_id}") - asserts.assert_equal(expected_state, event_data.state, - f"EnergyTransferStopped event State was {event_data.state} expected {expected_state}") - asserts.assert_equal(expected_reason, event_data.reason, - f"EnergyTransferStopped event reason was {event_data.reason}, expected {expected_reason}") - - def validate_ev_connected_event(self, event_data, session_id): - asserts.assert_equal(session_id, event_data.sessionID, - f"EvConnected event session ID was {event_data.sessionID}, expected {session_id}") - - def validate_ev_not_detected_event(self, event_data, session_id, expected_state, expected_duration, expected_charged): - asserts.assert_equal(session_id, event_data.sessionID, - f"EvNotDetected event session ID was {event_data.sessionID}, expected {session_id}") - asserts.assert_equal(expected_state, event_data.state, - f"EvNotDetected event event State was {event_data.state} expected {expected_state}") - asserts.assert_greater_equal(event_data.sessionDuration, expected_duration, - f"EvNotDetected event sessionDuration was {event_data.sessionDuration}, expected >= {expected_duration}") - asserts.assert_greater_equal(event_data.sessionEnergyCharged, expected_charged, - f"EvNotDetected event sessionEnergyCharged was {event_data.sessionEnergyCharged}, expected >= {expected_charged}") - - def validate_evse_fault_event(self, event_data, session_id, expected_state, previous_fault, current_fault): - asserts.assert_equal(session_id, event_data.sessionID, - f"Fault event session ID was {event_data.sessionID}, expected {session_id}") - asserts.assert_equal(expected_state, event_data.state, - f"Fault event State was {event_data.state} expected {expected_state}") - asserts.assert_equal(event_data.faultStatePreviousState, previous_fault, - f"Fault event faultStatePreviousState was {event_data.faultStatePreviousState}, expected {previous_fault}") - asserts.assert_equal(event_data.faultStateCurrentState, current_fault, - f"Fault event faultStateCurrentState was {event_data.faultStateCurrentState}, expected {current_fault}") - @async_test_body async def test_TC_EEVSE_2_4(self): self.step("1") diff --git a/src/python_testing/TC_EEVSE_2_5.py b/src/python_testing/TC_EEVSE_2_5.py index 78737af4b6637a..112c6552627053 100644 --- a/src/python_testing/TC_EEVSE_2_5.py +++ b/src/python_testing/TC_EEVSE_2_5.py @@ -27,70 +27,12 @@ from matter_testing_support import MatterBaseTest, TestStep, async_test_body, default_matter_test_main from mobly import asserts +from TC_EEVSE_Utils import EventChangeCallback, EEVSEBaseTestHelper + logger = logging.getLogger(__name__) -class EventChangeCallback: - def __init__(self, expected_cluster: ClusterObjects): - self._q = queue.Queue() - self._expected_cluster = expected_cluster - - async def start(self, dev_ctrl, nodeid): - self._subscription = await dev_ctrl.ReadEvent(nodeid, - events=[(1, self._expected_cluster, 1)], reportInterval=(1, 5), - fabricFiltered=False, keepSubscriptions=True, autoResubscribe=False) - self._subscription.SetEventUpdateCallback(self.__call__) - - def __call__(self, res: EventReadResult, transaction: SubscriptionTransaction): - if res.Status == Status.Success and res.Header.ClusterId == self._expected_cluster.id: - logging.info( - f'Got subscription report for event on cluster {self._expected_cluster}: {res.Data}') - self._q.put(res) - - def WaitForEventReport(self, expected_event: ClusterObjects.ClusterEvent): - try: - res = self._q.get(block=True, timeout=10) - except queue.Empty: - asserts.fail("Failed to receive a report for the event {}".format(expected_event)) - - asserts.assert_equal(res.Header.ClusterId, expected_event.cluster_id, "Expected cluster ID not found in event report") - asserts.assert_equal(res.Header.EventId, expected_event.event_id, "Expected event ID not found in event report") - return res.Data - - -class TC_EEVSE_2_5(MatterBaseTest): - async def read_evse_attribute_expect_success(self, endpoint, attribute): - full_attr = getattr(Clusters.EnergyEvse.Attributes, attribute) - cluster = Clusters.Objects.EnergyEvse - return await self.read_single_attribute_check_success(endpoint=endpoint, cluster=cluster, attribute=full_attr) - - async def check_evse_attribute(self, attribute, expected_value): - value = await self.read_evse_attribute_expect_success(endpoint=1, attribute=attribute) - asserts.assert_equal(value, expected_value, - f"Unexpected '{attribute}' value - expected {expected_value}, was {value}") - - async def send_enable_charge_command(self, endpoint: int = 0, charge_until: int = None, timedRequestTimeoutMs: int = 3000, - min_charge: int = None, max_charge: int = None, expected_status: Status = Status.Success): - try: - await self.send_single_cmd(cmd=Clusters.EnergyEvse.Commands.EnableCharging( - chargingEnabledUntil=charge_until, - minimumChargeCurrent=min_charge, - maximumChargeCurrent=max_charge), - endpoint=1, - timedRequestTimeoutMs=timedRequestTimeoutMs) - - except InteractionModelError as e: - asserts.assert_equal(e.status, expected_status, "Unexpected error returned") - - async def send_start_diagnostics_command(self, endpoint: int = 0, timedRequestTimeoutMs: int = 3000, - expected_status: Status = Status.Success): - try: - await self.send_single_cmd(cmd=Clusters.EnergyEvse.Commands.StartDiagnostics(), - endpoint=1, - timedRequestTimeoutMs=timedRequestTimeoutMs) - - except InteractionModelError as e: - asserts.assert_equal(e.status, expected_status, "Unexpected error returned") +class TC_EEVSE_2_5(MatterBaseTest, EEVSEBaseTestHelper): def desc_TC_EEVSE_2_5(self) -> str: """Returns a description of this test""" @@ -123,33 +65,6 @@ def steps_TC_EEVSE_2_5(self) -> list[TestStep]: return steps - async def send_test_event_triggers(self, enableKey=bytes([b for b in range(16)]), eventTrigger=0x0099000000000000): - try: - await self.send_single_cmd(endpoint=0, - cmd=Clusters.GeneralDiagnostics.Commands.TestEventTrigger( - enableKey, - eventTrigger) - ) - - except InteractionModelError as e: - asserts.fail(f"Unexpected error returned - {e.status}") - - # TC_EEVSE_2_5 tests steps - async def check_test_event_triggers_enabled(self): - full_attr = Clusters.GeneralDiagnostics.Attributes.TestEventTriggersEnabled - cluster = Clusters.Objects.GeneralDiagnostics - test_event_enabled = await self.read_single_attribute_check_success(endpoint=0, cluster=cluster, attribute=full_attr) - asserts.assert_equal(test_event_enabled, True, "TestEventTriggersEnabled is False") - - async def send_test_event_trigger_basic(self): - await self.send_test_event_triggers(eventTrigger=0x0099000000000000) - - async def send_test_event_trigger_basic_clear(self): - await self.send_test_event_triggers(eventTrigger=0x0099000000000001) - - async def send_test_event_trigger_evse_diagnostics_complete(self): - await self.send_test_event_triggers(eventTrigger=0x0099000000000020) - @async_test_body async def test_TC_EEVSE_2_5(self): self.step("1") diff --git a/src/python_testing/TC_EEVSE_Utils.py b/src/python_testing/TC_EEVSE_Utils.py new file mode 100644 index 00000000000000..dfd788b6e3b111 --- /dev/null +++ b/src/python_testing/TC_EEVSE_Utils.py @@ -0,0 +1,191 @@ +# +# Copyright (c) 2023 Project CHIP Authors +# All rights reserved. +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + + +import logging +import queue + +import chip.clusters as Clusters +from chip.clusters import ClusterObjects as ClusterObjects +from chip.clusters.Attribute import EventReadResult, SubscriptionTransaction +from chip.interaction_model import InteractionModelError, Status +from matter_testing_support import MatterBaseTest +from mobly import asserts + +logger = logging.getLogger(__name__) + + +class EventChangeCallback: + def __init__(self, expected_cluster: ClusterObjects): + self._q = queue.Queue() + self._expected_cluster = expected_cluster + + async def start(self, dev_ctrl, nodeid): + self._subscription = await dev_ctrl.ReadEvent(nodeid, + events=[(1, self._expected_cluster, 1)], reportInterval=(1, 5), + fabricFiltered=False, keepSubscriptions=True, autoResubscribe=False) + self._subscription.SetEventUpdateCallback(self.__call__) + + def __call__(self, res: EventReadResult, transaction: SubscriptionTransaction): + if res.Status == Status.Success and res.Header.ClusterId == self._expected_cluster.id: + logging.info( + f'Got subscription report for event on cluster {self._expected_cluster}: {res.Data}') + self._q.put(res) + + def WaitForEventReport(self, expected_event: ClusterObjects.ClusterEvent): + try: + res = self._q.get(block=True, timeout=10) + except queue.Empty: + asserts.fail("Failed to receive a report for the event {}".format(expected_event)) + + asserts.assert_equal(res.Header.ClusterId, expected_event.cluster_id, "Expected cluster ID not found in event report") + asserts.assert_equal(res.Header.EventId, expected_event.event_id, "Expected event ID not found in event report") + return res.Data + + +class EEVSEBaseTestHelper: + + async def read_evse_attribute_expect_success(self, endpoint, attribute): + full_attr = getattr(Clusters.EnergyEvse.Attributes, attribute) + cluster = Clusters.Objects.EnergyEvse + return await self.read_single_attribute_check_success(endpoint=endpoint, cluster=cluster, attribute=full_attr) + + async def check_evse_attribute(self, attribute, expected_value): + value = await self.read_evse_attribute_expect_success(endpoint=1, attribute=attribute) + asserts.assert_equal(value, expected_value, + f"Unexpected '{attribute}' value - expected {expected_value}, was {value}") + + async def get_supported_energy_evse_attributes(self, endpoint): + return await self.read_evse_attribute_expect_success(endpoint, "AttributeList") + + async def send_enable_charge_command(self, endpoint: int = 0, charge_until: int = None, timedRequestTimeoutMs: int = 3000, + min_charge: int = None, max_charge: int = None, expected_status: Status = Status.Success): + try: + await self.send_single_cmd(cmd=Clusters.EnergyEvse.Commands.EnableCharging( + chargingEnabledUntil=charge_until, + minimumChargeCurrent=min_charge, + maximumChargeCurrent=max_charge), + endpoint=1, + timedRequestTimeoutMs=timedRequestTimeoutMs) + + except InteractionModelError as e: + asserts.assert_equal(e.status, expected_status, "Unexpected error returned") + + async def send_disable_command(self, endpoint: int = 0, timedRequestTimeoutMs: int = 3000, expected_status: Status = Status.Success): + try: + await self.send_single_cmd(cmd=Clusters.EnergyEvse.Commands.Disable(), + endpoint=1, + timedRequestTimeoutMs=timedRequestTimeoutMs) + + except InteractionModelError as e: + asserts.assert_equal(e.status, expected_status, "Unexpected error returned") + + async def send_start_diagnostics_command(self, endpoint: int = 0, timedRequestTimeoutMs: int = 3000, + expected_status: Status = Status.Success): + try: + await self.send_single_cmd(cmd=Clusters.EnergyEvse.Commands.StartDiagnostics(), + endpoint=1, + timedRequestTimeoutMs=timedRequestTimeoutMs) + + except InteractionModelError as e: + asserts.assert_equal(e.status, expected_status, "Unexpected error returned") + + async def send_test_event_triggers(self, enableKey=bytes([b for b in range(16)]), eventTrigger=0x0099000000000000): + try: + await self.send_single_cmd(endpoint=0, + cmd=Clusters.GeneralDiagnostics.Commands.TestEventTrigger( + enableKey, + eventTrigger) + ) + + except InteractionModelError as e: + asserts.fail(f"Unexpected error returned - {e.status}") + + async def check_test_event_triggers_enabled(self): + full_attr = Clusters.GeneralDiagnostics.Attributes.TestEventTriggersEnabled + cluster = Clusters.Objects.GeneralDiagnostics + test_event_enabled = await self.read_single_attribute_check_success(endpoint=0, cluster=cluster, attribute=full_attr) + asserts.assert_equal(test_event_enabled, True, "TestEventTriggersEnabled is False") + + async def send_test_event_trigger_basic(self): + await self.send_test_event_triggers(eventTrigger=0x0099000000000000) + + async def send_test_event_trigger_basic_clear(self): + await self.send_test_event_triggers(eventTrigger=0x0099000000000001) + + async def send_test_event_trigger_pluggedin(self): + await self.send_test_event_triggers(eventTrigger=0x0099000000000002) + + async def send_test_event_trigger_pluggedin_clear(self): + await self.send_test_event_triggers(eventTrigger=0x0099000000000003) + + async def send_test_event_trigger_charge_demand(self): + await self.send_test_event_triggers(eventTrigger=0x0099000000000004) + + async def send_test_event_trigger_charge_demand_clear(self): + await self.send_test_event_triggers(eventTrigger=0x0099000000000005) + + async def send_test_event_trigger_evse_ground_fault(self): + await self.send_test_event_triggers(eventTrigger=0x0099000000000010) + + async def send_test_event_trigger_evse_over_temperature_fault(self): + await self.send_test_event_triggers(eventTrigger=0x0099000000000011) + + async def send_test_event_trigger_evse_fault_clear(self): + await self.send_test_event_triggers(eventTrigger=0x0099000000000012) + + async def send_test_event_trigger_evse_diagnostics_complete(self): + await self.send_test_event_triggers(eventTrigger=0x0099000000000020) + + def validate_energy_transfer_started_event(self, event_data, session_id, expected_state, expected_max_charge): + asserts.assert_equal(session_id, event_data.sessionID, + f"EnergyTransferStarted event session ID was {event_data.sessionID}, expected {session_id}") + asserts.assert_equal(expected_state, event_data.state, + f"EnergyTransferStarted event State was {event_data.state} expected {expected_state}") + asserts.assert_equal(expected_max_charge, event_data.maximumCurrent, + f"EnergyTransferStarted event maximumCurrent was {event_data.maximumCurrent}, expected {expected_max_charge}") + + def validate_energy_transfer_stopped_event(self, event_data, session_id, expected_state, expected_reason): + asserts.assert_equal(session_id, event_data.sessionID, + f"EnergyTransferStopped event session ID was {event_data.sessionID}, expected {session_id}") + asserts.assert_equal(expected_state, event_data.state, + f"EnergyTransferStopped event State was {event_data.state} expected {expected_state}") + asserts.assert_equal(expected_reason, event_data.reason, + f"EnergyTransferStopped event reason was {event_data.reason}, expected {expected_reason}") + + def validate_ev_connected_event(self, event_data, session_id): + asserts.assert_equal(session_id, event_data.sessionID, + f"EvConnected event session ID was {event_data.sessionID}, expected {session_id}") + + def validate_ev_not_detected_event(self, event_data, session_id, expected_state, expected_duration, expected_charged): + asserts.assert_equal(session_id, event_data.sessionID, + f"EvNotDetected event session ID was {event_data.sessionID}, expected {session_id}") + asserts.assert_equal(expected_state, event_data.state, + f"EvNotDetected event event State was {event_data.state} expected {expected_state}") + asserts.assert_greater_equal(event_data.sessionDuration, expected_duration, + f"EvNotDetected event sessionDuration was {event_data.sessionDuration}, expected >= {expected_duration}") + asserts.assert_greater_equal(event_data.sessionEnergyCharged, expected_charged, + f"EvNotDetected event sessionEnergyCharged was {event_data.sessionEnergyCharged}, expected >= {expected_charged}") + + def validate_evse_fault_event(self, event_data, session_id, expected_state, previous_fault, current_fault): + asserts.assert_equal(session_id, event_data.sessionID, + f"Fault event session ID was {event_data.sessionID}, expected {session_id}") + asserts.assert_equal(expected_state, event_data.state, + f"Fault event State was {event_data.state} expected {expected_state}") + asserts.assert_equal(event_data.faultStatePreviousState, previous_fault, + f"Fault event faultStatePreviousState was {event_data.faultStatePreviousState}, expected {previous_fault}") + asserts.assert_equal(event_data.faultStateCurrentState, current_fault, + f"Fault event faultStateCurrentState was {event_data.faultStateCurrentState}, expected {current_fault}") From 514e18e0fc09405c0c3aee0964ed13b318e3695a Mon Sep 17 00:00:00 2001 From: "Restyled.io" Date: Thu, 11 Jan 2024 01:40:19 +0000 Subject: [PATCH 086/114] Restyled by isort --- src/python_testing/TC_EEVSE_2_2.py | 3 +-- src/python_testing/TC_EEVSE_2_4.py | 3 +-- src/python_testing/TC_EEVSE_2_5.py | 3 +-- 3 files changed, 3 insertions(+), 6 deletions(-) diff --git a/src/python_testing/TC_EEVSE_2_2.py b/src/python_testing/TC_EEVSE_2_2.py index f92e577a9315ae..a27d8cf52ebbf9 100644 --- a/src/python_testing/TC_EEVSE_2_2.py +++ b/src/python_testing/TC_EEVSE_2_2.py @@ -27,8 +27,7 @@ from chip.interaction_model import InteractionModelError, Status from matter_testing_support import MatterBaseTest, TestStep, async_test_body, default_matter_test_main from mobly import asserts - -from TC_EEVSE_Utils import EventChangeCallback, EEVSEBaseTestHelper +from TC_EEVSE_Utils import EEVSEBaseTestHelper, EventChangeCallback logger = logging.getLogger(__name__) diff --git a/src/python_testing/TC_EEVSE_2_4.py b/src/python_testing/TC_EEVSE_2_4.py index 3e7e947c60d9fb..92e4d12409a541 100644 --- a/src/python_testing/TC_EEVSE_2_4.py +++ b/src/python_testing/TC_EEVSE_2_4.py @@ -26,8 +26,7 @@ from chip.interaction_model import InteractionModelError, Status from matter_testing_support import MatterBaseTest, TestStep, async_test_body, default_matter_test_main from mobly import asserts - -from TC_EEVSE_Utils import EventChangeCallback, EEVSEBaseTestHelper +from TC_EEVSE_Utils import EEVSEBaseTestHelper, EventChangeCallback logger = logging.getLogger(__name__) diff --git a/src/python_testing/TC_EEVSE_2_5.py b/src/python_testing/TC_EEVSE_2_5.py index 112c6552627053..9ea74065fd10bc 100644 --- a/src/python_testing/TC_EEVSE_2_5.py +++ b/src/python_testing/TC_EEVSE_2_5.py @@ -26,8 +26,7 @@ from chip.interaction_model import InteractionModelError, Status from matter_testing_support import MatterBaseTest, TestStep, async_test_body, default_matter_test_main from mobly import asserts - -from TC_EEVSE_Utils import EventChangeCallback, EEVSEBaseTestHelper +from TC_EEVSE_Utils import EEVSEBaseTestHelper, EventChangeCallback logger = logging.getLogger(__name__) From 21cd6d7bfa2fd459437b728f05f9da525f3f8bbb Mon Sep 17 00:00:00 2001 From: James Harrow Date: Thu, 11 Jan 2024 17:59:05 +0000 Subject: [PATCH 087/114] Fixed Lint issues --- src/python_testing/TC_EEVSE_2_2.py | 5 +---- src/python_testing/TC_EEVSE_2_4.py | 5 ----- src/python_testing/TC_EEVSE_2_5.py | 5 ----- src/python_testing/TC_EEVSE_Utils.py | 1 - 4 files changed, 1 insertion(+), 15 deletions(-) diff --git a/src/python_testing/TC_EEVSE_2_2.py b/src/python_testing/TC_EEVSE_2_2.py index a27d8cf52ebbf9..83bc676ed75b7c 100644 --- a/src/python_testing/TC_EEVSE_2_2.py +++ b/src/python_testing/TC_EEVSE_2_2.py @@ -16,15 +16,12 @@ import logging -import queue import time from datetime import datetime, timedelta, timezone import chip.clusters as Clusters -from chip.clusters import ClusterObjects as ClusterObjects -from chip.clusters.Attribute import EventReadResult, SubscriptionTransaction from chip.clusters.Types import NullValue -from chip.interaction_model import InteractionModelError, Status +from chip.interaction_model import Status from matter_testing_support import MatterBaseTest, TestStep, async_test_body, default_matter_test_main from mobly import asserts from TC_EEVSE_Utils import EEVSEBaseTestHelper, EventChangeCallback diff --git a/src/python_testing/TC_EEVSE_2_4.py b/src/python_testing/TC_EEVSE_2_4.py index 92e4d12409a541..8a28b562635390 100644 --- a/src/python_testing/TC_EEVSE_2_4.py +++ b/src/python_testing/TC_EEVSE_2_4.py @@ -16,16 +16,11 @@ import logging -import queue import time import chip.clusters as Clusters -from chip.clusters import ClusterObjects as ClusterObjects -from chip.clusters.Attribute import EventReadResult, SubscriptionTransaction from chip.clusters.Types import NullValue -from chip.interaction_model import InteractionModelError, Status from matter_testing_support import MatterBaseTest, TestStep, async_test_body, default_matter_test_main -from mobly import asserts from TC_EEVSE_Utils import EEVSEBaseTestHelper, EventChangeCallback logger = logging.getLogger(__name__) diff --git a/src/python_testing/TC_EEVSE_2_5.py b/src/python_testing/TC_EEVSE_2_5.py index 9ea74065fd10bc..a9da6c4df8bf94 100644 --- a/src/python_testing/TC_EEVSE_2_5.py +++ b/src/python_testing/TC_EEVSE_2_5.py @@ -16,16 +16,11 @@ import logging -import queue import time import chip.clusters as Clusters -from chip.clusters import ClusterObjects as ClusterObjects -from chip.clusters.Attribute import EventReadResult, SubscriptionTransaction from chip.clusters.Types import NullValue -from chip.interaction_model import InteractionModelError, Status from matter_testing_support import MatterBaseTest, TestStep, async_test_body, default_matter_test_main -from mobly import asserts from TC_EEVSE_Utils import EEVSEBaseTestHelper, EventChangeCallback logger = logging.getLogger(__name__) diff --git a/src/python_testing/TC_EEVSE_Utils.py b/src/python_testing/TC_EEVSE_Utils.py index dfd788b6e3b111..f4916b0900f033 100644 --- a/src/python_testing/TC_EEVSE_Utils.py +++ b/src/python_testing/TC_EEVSE_Utils.py @@ -22,7 +22,6 @@ from chip.clusters import ClusterObjects as ClusterObjects from chip.clusters.Attribute import EventReadResult, SubscriptionTransaction from chip.interaction_model import InteractionModelError, Status -from matter_testing_support import MatterBaseTest from mobly import asserts logger = logging.getLogger(__name__) From 9ab79d154b8892b039c2f99411b81a6d6200991f Mon Sep 17 00:00:00 2001 From: James Harrow Date: Thu, 11 Jan 2024 18:48:34 +0000 Subject: [PATCH 088/114] Revamped TC_EEVSE_2_5 to match spec behaviour (cannot start diagnostics unless Disabled). Also removed hard-coded endpoint ids in Utils --- .../src/EnergyEvseDelegateImpl.cpp | 4 +- src/python_testing/TC_EEVSE_2_5.py | 47 ++++++++++++------- src/python_testing/TC_EEVSE_Utils.py | 20 ++++---- 3 files changed, 41 insertions(+), 30 deletions(-) diff --git a/examples/energy-management-app/energy-management-common/src/EnergyEvseDelegateImpl.cpp b/examples/energy-management-app/energy-management-common/src/EnergyEvseDelegateImpl.cpp index 095d8914660cd4..98dc99ac22f156 100644 --- a/examples/energy-management-app/energy-management-common/src/EnergyEvseDelegateImpl.cpp +++ b/examples/energy-management-app/energy-management-common/src/EnergyEvseDelegateImpl.cpp @@ -147,9 +147,9 @@ Status EnergyEvseDelegate::StartDiagnostics() /* For EVSE manufacturers to customize */ ChipLogProgress(AppServer, "EnergyEvseDelegate::StartDiagnostics()"); - if (mSupplyState == SupplyStateEnum::kDisabledDiagnostics) + if (mSupplyState != SupplyStateEnum::kDisabled) { - ChipLogError(AppServer, "EVSE: Already in diagnostics mode!"); + ChipLogError(AppServer, "EVSE: cannot be put into diagnostics mode if it is not Disabled!"); return Status::Failure; } diff --git a/src/python_testing/TC_EEVSE_2_5.py b/src/python_testing/TC_EEVSE_2_5.py index a9da6c4df8bf94..27dfca05ced439 100644 --- a/src/python_testing/TC_EEVSE_2_5.py +++ b/src/python_testing/TC_EEVSE_2_5.py @@ -21,6 +21,7 @@ import chip.clusters as Clusters from chip.clusters.Types import NullValue from matter_testing_support import MatterBaseTest, TestStep, async_test_body, default_matter_test_main +from chip.interaction_model import Status from TC_EEVSE_Utils import EEVSEBaseTestHelper, EventChangeCallback logger = logging.getLogger(__name__) @@ -42,19 +43,22 @@ def steps_TC_EEVSE_2_5(self) -> list[TestStep]: TestStep("1", "Commissioning, already done", is_commissioning=True), TestStep("2", "TH reads TestEventTriggersEnabled attribute from General Diagnostics Cluster. Verify that TestEventTriggersEnabled attribute has a value of 1 (True)"), TestStep("3", "TH sends TestEventTrigger command to General Diagnostics Cluster on Endpoint 0 with EnableKey field set to PIXIT.EEVSE.TEST_EVENT_TRIGGER_KEY and EventTrigger field set to PIXIT.EEVSE.TEST_EVENT_TRIGGER for Basic Functionality Test Event"), - TestStep("3a", "After a few seconds TH reads from the DUT the State attribute. Verify value is 0x00 (NotPluggedIn)"), + TestStep("3a", "TH reads from the DUT the State attribute. Verify value is 0x00 (NotPluggedIn)"), TestStep("3b", "TH reads from the DUT the SupplyState attribute. Verify value is 0x00 (Disabled)"), TestStep("3c", "TH reads from the DUT the FaultState attribute. Verify value is 0x00 (NoError)"), TestStep("4", "TH sends command EnableCharging with ChargingEnabledUntil=Null, minimumChargeCurrent=6000, maximumChargeCurrent=60000"), TestStep("4a", "TH reads from the DUT the State attribute. Verify value is 0x00 (NotPluggedIn)"), - TestStep("4b", "TH reads from the DUT the SupplyState attribute. Verify value is 0x00 (ChargingEnabled)"), - TestStep("5", "TH sends command StartDiagnostics"), - TestStep("5a", "TH reads from the DUT the State attribute. Verify value is 0x00 (NotPluggedIn)"), - TestStep("5b", "TH reads from the DUT the SupplyState attribute. Verify value is 0x04 (DisabledDiagnostics)"), - TestStep("6", "A few seconds later TH sends TestEventTrigger command to General Diagnostics Cluster on Endpoint 0 with EnableKey field set to PIXIT.EEVSE.TEST_EVENT_TRIGGER_KEY and EventTrigger field set to PIXIT.EEVSE.TEST_EVENT_TRIGGER for EVSE Diagnostics Complete Event"), + TestStep("4b", "TH reads from the DUT the SupplyState attribute. Verify value is 0x01 (ChargingEnabled)"), + TestStep("5", "TH sends command StartDiagnostics. Verify that command is rejected with Failure"), + TestStep("6", "TH sends command Disable."), TestStep("6a", "TH reads from the DUT the State attribute. Verify value is 0x00 (NotPluggedIn)"), TestStep("6b", "TH reads from the DUT the SupplyState attribute. Verify value is 0x04 (Disabled)"), - TestStep("7", "TH sends TestEventTrigger command to General Diagnostics Cluster on Endpoint 0 with EnableKey field set to PIXIT.EEVSE.TEST_EVENT_TRIGGER_KEY and EventTrigger field set to PIXIT.EEVSE.TEST_EVENT_TRIGGER for Basic Functionality Test Event Clear."), + TestStep("7", "TH sends command StartDiagnostics. Verify that command is accepted with Success"), + TestStep("7a", "TH reads from the DUT the SupplyState attribute. Verify value is 0x04 (DisabledDiagnostics)"), + TestStep("8", "A few seconds later TH sends TestEventTrigger command to General Diagnostics Cluster on Endpoint 0 with EnableKey field set to PIXIT.EEVSE.TEST_EVENT_TRIGGER_KEY and EventTrigger field set to PIXIT.EEVSE.TEST_EVENT_TRIGGER for EVSE Diagnostics Complete Event"), + TestStep("8a", "TH reads from the DUT the State attribute. Verify value is 0x00 (NotPluggedIn)"), + TestStep("8b", "TH reads from the DUT the SupplyState attribute. Verify value is 0x04 (Disabled)"), + TestStep("9", "TH sends TestEventTrigger command to General Diagnostics Cluster on Endpoint 0 with EnableKey field set to PIXIT.EEVSE.TEST_EVENT_TRIGGER_KEY and EventTrigger field set to PIXIT.EEVSE.TEST_EVENT_TRIGGER for Basic Functionality Test Event Clear."), ] return steps @@ -74,9 +78,6 @@ async def test_TC_EEVSE_2_5(self): self.step("3") await self.send_test_event_trigger_basic() - # After a few seconds... - time.sleep(1) - self.step("3a") await self.check_evse_attribute("State", Clusters.EnergyEvse.Enums.StateEnum.kNotPluggedIn) @@ -99,25 +100,35 @@ async def test_TC_EEVSE_2_5(self): await self.check_evse_attribute("SupplyState", Clusters.EnergyEvse.Enums.SupplyStateEnum.kChargingEnabled) self.step("5") - await self.send_start_diagnostics_command(endpoint=1) + # Check we get a failure because the state needs to be Disabled to run a Diagnostic + await self.send_start_diagnostics_command(expected_status=Status.Failure) + + self.step("6") + await self.send_disable_command() - self.step("5a") + self.step("6a") await self.check_evse_attribute("State", Clusters.EnergyEvse.Enums.StateEnum.kNotPluggedIn) - self.step("5b") + self.step("6b") + await self.check_evse_attribute("SupplyState", Clusters.EnergyEvse.Enums.SupplyStateEnum.kDisabled) + + self.step("7") + await self.send_start_diagnostics_command() + + self.step("7a") await self.check_evse_attribute("SupplyState", Clusters.EnergyEvse.Enums.SupplyStateEnum.kDisabledDiagnostics) - self.step("6") + self.step("8") await self.send_test_event_trigger_evse_diagnostics_complete() - self.step("6a") + self.step("8a") await self.check_evse_attribute("State", Clusters.EnergyEvse.Enums.StateEnum.kNotPluggedIn) - self.step("6b") - # It should go to disabled after a diagnostics session + self.step("8b") + # It should stay disabled after a diagnostics session await self.check_evse_attribute("SupplyState", Clusters.EnergyEvse.Enums.SupplyStateEnum.kDisabled) - self.step("7") + self.step("9") await self.send_test_event_trigger_basic_clear() diff --git a/src/python_testing/TC_EEVSE_Utils.py b/src/python_testing/TC_EEVSE_Utils.py index f4916b0900f033..d2d5873c37d0b4 100644 --- a/src/python_testing/TC_EEVSE_Utils.py +++ b/src/python_testing/TC_EEVSE_Utils.py @@ -32,9 +32,9 @@ def __init__(self, expected_cluster: ClusterObjects): self._q = queue.Queue() self._expected_cluster = expected_cluster - async def start(self, dev_ctrl, nodeid): + async def start(self, dev_ctrl, nodeid, endpoint: int = 1): self._subscription = await dev_ctrl.ReadEvent(nodeid, - events=[(1, self._expected_cluster, 1)], reportInterval=(1, 5), + events=[(endpoint, self._expected_cluster, 1)], reportInterval=(1, 5), fabricFiltered=False, keepSubscriptions=True, autoResubscribe=False) self._subscription.SetEventUpdateCallback(self.__call__) @@ -62,41 +62,41 @@ async def read_evse_attribute_expect_success(self, endpoint, attribute): cluster = Clusters.Objects.EnergyEvse return await self.read_single_attribute_check_success(endpoint=endpoint, cluster=cluster, attribute=full_attr) - async def check_evse_attribute(self, attribute, expected_value): - value = await self.read_evse_attribute_expect_success(endpoint=1, attribute=attribute) + async def check_evse_attribute(self, attribute, expected_value, endpoint: int = 1): + value = await self.read_evse_attribute_expect_success(endpoint=endpoint, attribute=attribute) asserts.assert_equal(value, expected_value, f"Unexpected '{attribute}' value - expected {expected_value}, was {value}") async def get_supported_energy_evse_attributes(self, endpoint): return await self.read_evse_attribute_expect_success(endpoint, "AttributeList") - async def send_enable_charge_command(self, endpoint: int = 0, charge_until: int = None, timedRequestTimeoutMs: int = 3000, + async def send_enable_charge_command(self, endpoint: int = 1, charge_until: int = None, timedRequestTimeoutMs: int = 3000, min_charge: int = None, max_charge: int = None, expected_status: Status = Status.Success): try: await self.send_single_cmd(cmd=Clusters.EnergyEvse.Commands.EnableCharging( chargingEnabledUntil=charge_until, minimumChargeCurrent=min_charge, maximumChargeCurrent=max_charge), - endpoint=1, + endpoint=endpoint, timedRequestTimeoutMs=timedRequestTimeoutMs) except InteractionModelError as e: asserts.assert_equal(e.status, expected_status, "Unexpected error returned") - async def send_disable_command(self, endpoint: int = 0, timedRequestTimeoutMs: int = 3000, expected_status: Status = Status.Success): + async def send_disable_command(self, endpoint: int = 1, timedRequestTimeoutMs: int = 3000, expected_status: Status = Status.Success): try: await self.send_single_cmd(cmd=Clusters.EnergyEvse.Commands.Disable(), - endpoint=1, + endpoint=endpoint, timedRequestTimeoutMs=timedRequestTimeoutMs) except InteractionModelError as e: asserts.assert_equal(e.status, expected_status, "Unexpected error returned") - async def send_start_diagnostics_command(self, endpoint: int = 0, timedRequestTimeoutMs: int = 3000, + async def send_start_diagnostics_command(self, endpoint: int = 1, timedRequestTimeoutMs: int = 3000, expected_status: Status = Status.Success): try: await self.send_single_cmd(cmd=Clusters.EnergyEvse.Commands.StartDiagnostics(), - endpoint=1, + endpoint=endpoint, timedRequestTimeoutMs=timedRequestTimeoutMs) except InteractionModelError as e: From 2e774fe53de8ca01405aaca364ac36a11a98128f Mon Sep 17 00:00:00 2001 From: James Harrow Date: Fri, 12 Jan 2024 00:41:19 +0000 Subject: [PATCH 089/114] Implemented timer to disable the EVSE automatically. --- .../include/EnergyEvseDelegateImpl.h | 26 +++++- .../src/EVSEManufacturerImpl.cpp | 5 + .../src/EnergyEvseDelegateImpl.cpp | 93 ++++++++++++++++++- src/python_testing/TC_EEVSE_2_2.py | 19 ++-- 4 files changed, 127 insertions(+), 16 deletions(-) diff --git a/examples/energy-management-app/energy-management-common/include/EnergyEvseDelegateImpl.h b/examples/energy-management-app/energy-management-common/include/EnergyEvseDelegateImpl.h index dc46e58d5021a7..86a85363ed31a3 100644 --- a/examples/energy-management-app/energy-management-common/include/EnergyEvseDelegateImpl.h +++ b/examples/energy-management-app/energy-management-common/include/EnergyEvseDelegateImpl.h @@ -136,6 +136,15 @@ class EnergyEvseDelegate : public EnergyEvse::Delegate */ Status HwRegisterEvseCallbackHandler(EVSECallbackFunc handler, intptr_t arg); + /** + * @brief This is used to start a check on if the Enabled timer needs to be started + * + * It should be called after the EVSE is initialised and the persisted attributes + * have been loaded, and time has been synchronised. If time isn't sync'd + * yet it will call itself back periodically (if required). + */ + Status ScheduleCheckOnEnabledTimeout(); + // ----------------------------------------------------------------- // Internal API to allow an EVSE to change its internal state etc Status HwSetMaxHardwareCurrentLimit(int64_t currentmA); @@ -214,10 +223,11 @@ class EnergyEvseDelegate : public EnergyEvse::Delegate private: /* Constants */ - static constexpr int DEFAULT_MIN_CHARGE_CURRENT = 6000; /* 6A */ - static constexpr int DEFAULT_USER_MAXIMUM_CHARGE_CURRENT = kMaximumChargeCurrent; /* 80A */ - static constexpr int DEFAULT_RANDOMIZATION_DELAY_WINDOW = 600; /* 600s */ - static constexpr int kMaxVehicleIDBufSize = 32; + static constexpr int DEFAULT_MIN_CHARGE_CURRENT = 6000; /* 6A */ + static constexpr int DEFAULT_USER_MAXIMUM_CHARGE_CURRENT = kMaximumChargeCurrent; /* 80A */ + static constexpr int DEFAULT_RANDOMIZATION_DELAY_WINDOW = 600; /* 600s */ + static constexpr int kMaxVehicleIDBufSize = 32; + static constexpr int PERIODIC_CHECK_INTERVAL_REAL_TIME_CLOCK_NOT_SYNCED = 30; /* private variables for controlling the hardware - these are not attributes */ int64_t mMaxHardwareCurrentLimit = 0; /* Hardware current limit in mA */ @@ -254,6 +264,14 @@ class EnergyEvseDelegate : public EnergyEvse::Delegate */ Status ComputeMaxChargeCurrentLimit(); + /** + * @brief This checks if the charging or discharging needs to be disabled + * + * @params pointer to SystemLayer + * @params pointer to EnergyEvseDelegate + */ + static void EvseCheckTimerExpiry(System::Layer * systemLayer, void * delegate); + /* Attributes */ StateEnum mState = StateEnum::kNotPluggedIn; SupplyStateEnum mSupplyState = SupplyStateEnum::kDisabled; diff --git a/examples/energy-management-app/energy-management-common/src/EVSEManufacturerImpl.cpp b/examples/energy-management-app/energy-management-common/src/EVSEManufacturerImpl.cpp index c71db0047b8f20..183e8a176a4a45 100644 --- a/examples/energy-management-app/energy-management-common/src/EVSEManufacturerImpl.cpp +++ b/examples/energy-management-app/energy-management-common/src/EVSEManufacturerImpl.cpp @@ -59,6 +59,11 @@ CHIP_ERROR EVSEManufacturer::Init() // uint8_t uid[10] = { 0x01, 0x23, 0x45, 0x67, 0x89, 0xAA, 0xBB, 0xCC, 0xDD, 0xEE }; // dg->HwSetRFID(ByteSpan(uid)); + /* Once the system is initialised then check to see if the state was restored + * (e.g. after a power outage), and if the Enable timer check needs to be started + */ + dg->ScheduleCheckOnEnabledTimeout(); + return CHIP_NO_ERROR; } diff --git a/examples/energy-management-app/energy-management-common/src/EnergyEvseDelegateImpl.cpp b/examples/energy-management-app/energy-management-common/src/EnergyEvseDelegateImpl.cpp index 98dc99ac22f156..fdbd1c73638548 100644 --- a/examples/energy-management-app/energy-management-common/src/EnergyEvseDelegateImpl.cpp +++ b/examples/energy-management-app/energy-management-common/src/EnergyEvseDelegateImpl.cpp @@ -42,6 +42,13 @@ EnergyEvseDelegate::~EnergyEvseDelegate() } } +/** + * @brief Helper function to get current timestamp in Epoch format + * + * @param chipEpoch reference to hold return timestamp + */ +CHIP_ERROR GetEpochTS(uint32_t & chipEpoch); + /** * @brief Called when EVSE cluster receives Disable command */ @@ -105,8 +112,6 @@ Status EnergyEvseDelegate::EnableCharging(const DataModel::Nullable & /* check chargingEnabledUntil is in the future */ ChipLogError(AppServer, "Charging enabled until: %lu", static_cast(chargingEnabledUntil.Value())); SetChargingEnabledUntil(chargingEnabledUntil); - // TODO start a timer to disable charging later - // if (checkChargingEnabled) } /* If it looks ok, store the min & max charging current */ @@ -136,6 +141,76 @@ Status EnergyEvseDelegate::EnableDischarging(const DataModel::Nullable return HandleStateMachineEvent(EVSEStateMachineEvent::DischargingEnabledEvent); } +/** + * @brief Routine to help schedule a timer callback to check if the EVSE should go disabled + * + * If the clock is sync'd we can work out when to call back to check when to disable the EVSE + * automatically. If the clock isn't sync'd the we just set a timer to check once every 30s. + * + * We first check the SupplyState to check if it is EnabledCharging or EnabledDischarging + * Then if the EnabledCharging/DischargingUntil is not Null, then we compute a delay to come + * back and check. + */ +Status EnergyEvseDelegate::ScheduleCheckOnEnabledTimeout() +{ + + uint32_t chipEpoch = 0; + DataModel::Nullable enabledUntilTime; + + if (mSupplyState == SupplyStateEnum::kChargingEnabled) + { + enabledUntilTime = GetChargingEnabledUntil(); + } + else if (mSupplyState == SupplyStateEnum::kDischargingEnabled) + { + enabledUntilTime = GetDischargingEnabledUntil(); + } + else + { + // In all other states the EVSE is disabled + return Status::Success; + } + + if (enabledUntilTime.IsNull()) + { + /* This is enabled indefinitely so don't schedule a callback */ + return Status::Success; + } + + CHIP_ERROR err = GetEpochTS(chipEpoch); + if (err == CHIP_NO_ERROR) + { + /* time is sync'd */ + int32_t delta = static_cast(enabledUntilTime.Value() - chipEpoch); + if (delta > 0) + { + /* The timer hasn't expired yet - set a timer to check in the future */ + ChipLogDetail(AppServer, "Setting EVSE Enable check timer for %d seconds", delta); + DeviceLayer::SystemLayer().StartTimer(System::Clock::Seconds32(delta), EvseCheckTimerExpiry, this); + } + else + { + /* we have gone past the enabledUntilTime - so we need to disable */ + ChipLogDetail(AppServer, "EVSE enable time expired, disabling charging"); + Disable(); + } + } + else if (err == CHIP_ERROR_REAL_TIME_NOT_SYNCED) + { + /* Real time isn't sync'd -lets check again in 30 seconds - otherwise keep the charger enabled */ + DeviceLayer::SystemLayer().StartTimer(System::Clock::Seconds32(PERIODIC_CHECK_INTERVAL_REAL_TIME_CLOCK_NOT_SYNCED), + EvseCheckTimerExpiry, this); + } + return Status::Success; +} + +void EnergyEvseDelegate::EvseCheckTimerExpiry(System::Layer * systemLayer, void * delegate) +{ + EnergyEvseDelegate * dg = reinterpret_cast(delegate); + + dg->ScheduleCheckOnEnabledTimeout(); +} + /** * @brief Called when EVSE cluster receives StartDiagnostics command * @@ -615,6 +690,9 @@ Status EnergyEvseDelegate::HandleChargingEnabledEvent() default: break; } + + ScheduleCheckOnEnabledTimeout(); + return Status::Success; } Status EnergyEvseDelegate::HandleDischargingEnabledEvent() @@ -650,6 +728,9 @@ Status EnergyEvseDelegate::HandleDischargingEnabledEvent() default: break; } + + ScheduleCheckOnEnabledTimeout(); + return Status::Success; } Status EnergyEvseDelegate::HandleDisabledEvent() @@ -1366,6 +1447,14 @@ CHIP_ERROR GetEpochTS(uint32_t & chipEpoch) System::Clock::Milliseconds64 cTMs; CHIP_ERROR err = System::SystemClock().GetClock_RealTimeMS(cTMs); + + /* If the GetClock_RealTimeMS returns CHIP_ERROR_UNSUPPORTED_CHIP_FEATURE, then + * This platform cannot ever report real time ! + * This should not be certifiable since getting time is a Mandatory + * feature of EVSE Cluster + */ + VerifyOrDie(err != CHIP_ERROR_UNSUPPORTED_CHIP_FEATURE); + if (err != CHIP_NO_ERROR) { ChipLogError(Zcl, "EVSE: Unable to get current time - err:%" CHIP_ERROR_FORMAT, err.Format()); diff --git a/src/python_testing/TC_EEVSE_2_2.py b/src/python_testing/TC_EEVSE_2_2.py index 83bc676ed75b7c..ce4b543bc2d9c1 100644 --- a/src/python_testing/TC_EEVSE_2_2.py +++ b/src/python_testing/TC_EEVSE_2_2.py @@ -176,24 +176,24 @@ async def test_TC_EEVSE_2_2(self): self.step("7") # Sleep for the charging duration plus a couple of seconds to check it has stopped time.sleep(charging_duration + 2) - # TODO check EnergyTransferredStoped (EvseStopped) - # event_data = events_callback.WaitForEventReport(Clusters.EnergyEvse.Events.EnergyTransferStopped) - # expected_reason = Clusters.EnergyEvse.Enums.EnergyTransferStoppedReasonEnum.kEVSEStopped - # self.validate_energy_transfer_stopped_event(event_data, session_id, expected_state, expected_reason) + # check EnergyTransferredStoped (EvseStopped) + event_data = events_callback.WaitForEventReport(Clusters.EnergyEvse.Events.EnergyTransferStopped) + expected_reason = Clusters.EnergyEvse.Enums.EnergyTransferStoppedReasonEnum.kEVSEStopped + self.validate_energy_transfer_stopped_event(event_data, session_id, expected_state, expected_reason) self.step("7a") -# await self.check_evse_attribute("State", Clusters.EnergyEvse.Enums.StateEnum.kPluggedInDemand) + await self.check_evse_attribute("State", Clusters.EnergyEvse.Enums.StateEnum.kPluggedInDemand) self.step("7b") -# await self.check_evse_attribute("SupplyState", Clusters.EnergyEvse.Enums.SupplyStateEnum.kDisabled) + await self.check_evse_attribute("SupplyState", Clusters.EnergyEvse.Enums.SupplyStateEnum.kDisabled) self.step("8") charge_until = NullValue min_charge_current = 6000 max_charge_current = 12000 - # TODO reinstate this check + await self.send_enable_charge_command(endpoint=1, charge_until=charge_until, min_charge=min_charge_current, max_charge=max_charge_current) - # event_data = events_callback.WaitForEventReport(Clusters.EnergyEvse.Events.EnergyTransferStarted) + event_data = events_callback.WaitForEventReport(Clusters.EnergyEvse.Events.EnergyTransferStarted) self.step("8a") await self.check_evse_attribute("State", Clusters.EnergyEvse.Enums.StateEnum.kPluggedInCharging) @@ -213,8 +213,7 @@ async def test_TC_EEVSE_2_2(self): await self.check_evse_attribute("MaximumChargeCurrent", expected_max_charge) # from step 8 above - validate event - # TODO reinstate this check - # self.validate_energy_transfer_started_event(event_data, session_id, expected_state, expected_max_charge) + self.validate_energy_transfer_started_event(event_data, session_id, expected_state, expected_max_charge) self.step("9") # This will only work if the optional UserMaximumChargeCurrent attribute is supported From cafe1b45c026876a8f1804a025a94d0ebb1eec3a Mon Sep 17 00:00:00 2001 From: James Harrow Date: Fri, 12 Jan 2024 00:54:37 +0000 Subject: [PATCH 090/114] Added documentation to cover concern about long-lived bytespan in enableKey --- .../EnergyEvseTestEventTriggerDelegate.h | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/src/app/clusters/energy-evse-server/EnergyEvseTestEventTriggerDelegate.h b/src/app/clusters/energy-evse-server/EnergyEvseTestEventTriggerDelegate.h index cb9abd29da77f4..1828d30d19eed0 100644 --- a/src/app/clusters/energy-evse-server/EnergyEvseTestEventTriggerDelegate.h +++ b/src/app/clusters/energy-evse-server/EnergyEvseTestEventTriggerDelegate.h @@ -62,7 +62,17 @@ class EnergyEvseTestEventTriggerDelegate : public TestEventTriggerDelegate mEnableKey(enableKey), mOtherDelegate(otherDelegate) {} + /** + * This function expects the enableKey ByteSpan to be valid forever. + * Typically this feature is only enabled in certification testing + * and uses a static secret key in the device for testing (e.g. in factory data) + */ bool DoesEnableKeyMatch(const ByteSpan & enableKey) const override; + + /** This function must return True if the eventTrigger is recognised and handled + * It must return False to allow a higher level TestEvent handler to check other + * clusters that may handle it. + */ CHIP_ERROR HandleEventTrigger(uint64_t eventTrigger) override; private: From c52fe69c1a9a28f8b909f47d7cc538fb313782a2 Mon Sep 17 00:00:00 2001 From: James Harrow Date: Fri, 12 Jan 2024 08:11:47 +0000 Subject: [PATCH 091/114] Fixed Lint and build issues on other platforms --- .../energy-management-common/src/EnergyEvseDelegateImpl.cpp | 2 +- src/python_testing/TC_EEVSE_2_5.py | 1 - 2 files changed, 1 insertion(+), 2 deletions(-) diff --git a/examples/energy-management-app/energy-management-common/src/EnergyEvseDelegateImpl.cpp b/examples/energy-management-app/energy-management-common/src/EnergyEvseDelegateImpl.cpp index fdbd1c73638548..63498e204e850a 100644 --- a/examples/energy-management-app/energy-management-common/src/EnergyEvseDelegateImpl.cpp +++ b/examples/energy-management-app/energy-management-common/src/EnergyEvseDelegateImpl.cpp @@ -185,7 +185,7 @@ Status EnergyEvseDelegate::ScheduleCheckOnEnabledTimeout() if (delta > 0) { /* The timer hasn't expired yet - set a timer to check in the future */ - ChipLogDetail(AppServer, "Setting EVSE Enable check timer for %d seconds", delta); + ChipLogDetail(AppServer, "Setting EVSE Enable check timer for %ld seconds", static_cast(delta)); DeviceLayer::SystemLayer().StartTimer(System::Clock::Seconds32(delta), EvseCheckTimerExpiry, this); } else diff --git a/src/python_testing/TC_EEVSE_2_5.py b/src/python_testing/TC_EEVSE_2_5.py index 27dfca05ced439..0179df90892687 100644 --- a/src/python_testing/TC_EEVSE_2_5.py +++ b/src/python_testing/TC_EEVSE_2_5.py @@ -16,7 +16,6 @@ import logging -import time import chip.clusters as Clusters from chip.clusters.Types import NullValue From f50ef1e7be5f15f24c67c9ef45686458551bd055 Mon Sep 17 00:00:00 2001 From: "Restyled.io" Date: Fri, 12 Jan 2024 08:19:47 +0000 Subject: [PATCH 092/114] Restyled by isort --- src/python_testing/TC_EEVSE_2_5.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/python_testing/TC_EEVSE_2_5.py b/src/python_testing/TC_EEVSE_2_5.py index 0179df90892687..a4b35a7e9feae9 100644 --- a/src/python_testing/TC_EEVSE_2_5.py +++ b/src/python_testing/TC_EEVSE_2_5.py @@ -19,8 +19,8 @@ import chip.clusters as Clusters from chip.clusters.Types import NullValue -from matter_testing_support import MatterBaseTest, TestStep, async_test_body, default_matter_test_main from chip.interaction_model import Status +from matter_testing_support import MatterBaseTest, TestStep, async_test_body, default_matter_test_main from TC_EEVSE_Utils import EEVSEBaseTestHelper, EventChangeCallback logger = logging.getLogger(__name__) From bd975624e0745853acaf96e3bbaa96781cdc2020 Mon Sep 17 00:00:00 2001 From: James Harrow Date: Fri, 12 Jan 2024 18:45:58 +0000 Subject: [PATCH 093/114] Implemented some of the feedback on PR --- .../include/EnergyEvseDelegateImpl.h | 16 +++--- .../src/EVSEManufacturerImpl.cpp | 52 +++++++++++++------ .../src/EnergyEvseDelegateImpl.cpp | 3 +- .../src/EnergyEvseManager.cpp | 7 +-- 4 files changed, 46 insertions(+), 32 deletions(-) diff --git a/examples/energy-management-app/energy-management-common/include/EnergyEvseDelegateImpl.h b/examples/energy-management-app/energy-management-common/include/EnergyEvseDelegateImpl.h index 86a85363ed31a3..1b97fef5a8e54e 100644 --- a/examples/energy-management-app/energy-management-common/include/EnergyEvseDelegateImpl.h +++ b/examples/energy-management-app/energy-management-common/include/EnergyEvseDelegateImpl.h @@ -223,11 +223,11 @@ class EnergyEvseDelegate : public EnergyEvse::Delegate private: /* Constants */ - static constexpr int DEFAULT_MIN_CHARGE_CURRENT = 6000; /* 6A */ - static constexpr int DEFAULT_USER_MAXIMUM_CHARGE_CURRENT = kMaximumChargeCurrent; /* 80A */ - static constexpr int DEFAULT_RANDOMIZATION_DELAY_WINDOW = 600; /* 600s */ - static constexpr int kMaxVehicleIDBufSize = 32; - static constexpr int PERIODIC_CHECK_INTERVAL_REAL_TIME_CLOCK_NOT_SYNCED = 30; + static constexpr int kDefaultMinChargeCurrent = 6000; /* 6A */ + static constexpr int kDefaultUserMaximumChargeCurrent = kMaximumChargeCurrent; /* 80A */ + static constexpr int kDefaultRandomizationDelayWindow = 600; /* 600s */ + static constexpr int kMaxVehicleIDBufSize = 32; + static constexpr int kPeriodicCheckIntervalRealTimeClockNotSynced = 30; /* private variables for controlling the hardware - these are not attributes */ int64_t mMaxHardwareCurrentLimit = 0; /* Hardware current limit in mA */ @@ -279,11 +279,11 @@ class EnergyEvseDelegate : public EnergyEvse::Delegate DataModel::Nullable mChargingEnabledUntil; // TODO Default to 0 to indicate disabled DataModel::Nullable mDischargingEnabledUntil; // TODO Default to 0 to indicate disabled int64_t mCircuitCapacity = 0; - int64_t mMinimumChargeCurrent = DEFAULT_MIN_CHARGE_CURRENT; + int64_t mMinimumChargeCurrent = kDefaultMinChargeCurrent; int64_t mMaximumChargeCurrent = 0; int64_t mMaximumDischargeCurrent = 0; - int64_t mUserMaximumChargeCurrent = DEFAULT_USER_MAXIMUM_CHARGE_CURRENT; // TODO update spec - uint32_t mRandomizationDelayWindow = DEFAULT_RANDOMIZATION_DELAY_WINDOW; + int64_t mUserMaximumChargeCurrent = kDefaultUserMaximumChargeCurrent; // TODO update spec + uint32_t mRandomizationDelayWindow = kDefaultRandomizationDelayWindow; /* PREF attributes */ uint8_t mNumberOfWeeklyTargets = 0; uint8_t mNumberOfDailyTargets = 1; diff --git a/examples/energy-management-app/energy-management-common/src/EVSEManufacturerImpl.cpp b/examples/energy-management-app/energy-management-common/src/EVSEManufacturerImpl.cpp index 183e8a176a4a45..6e646a8dad42ee 100644 --- a/examples/energy-management-app/energy-management-common/src/EVSEManufacturerImpl.cpp +++ b/examples/energy-management-app/energy-management-common/src/EVSEManufacturerImpl.cpp @@ -42,22 +42,16 @@ CHIP_ERROR EVSEManufacturer::Init() dg->HwRegisterEvseCallbackHandler(ApplicationCallbackHandler, reinterpret_cast(this)); - // For Manufacturer to specify the hardware capability in mA - // dg->HwSetMaxHardwareCurrentLimit(32000); - - // For Manufacturer to specify the CircuitCapacity (e.g. from DIP switches) - // dg->HwSetCircuitCapacity(20000); - - // For now let's pretend the EV is plugged in, and asking for demand - // dg->HwSetState(StateEnum::kPluggedInDemand); - // dg->HwSetCableAssemblyLimit(63000); - - // For now let's pretend the vehicle ID is set - // dg->HwSetVehicleID(CharSpan::fromCharString("TEST_VEHICLE_123456789")); - - // For now let's pretend the RFID sensor was triggered - send an event - // uint8_t uid[10] = { 0x01, 0x23, 0x45, 0x67, 0x89, 0xAA, 0xBB, 0xCC, 0xDD, 0xEE }; - // dg->HwSetRFID(ByteSpan(uid)); + /* + * This is an example implementation for manufacturers to consider + * + * For Manufacturer to specify the hardware capability in mA: + * dg->HwSetMaxHardwareCurrentLimit(32000); // 32A + * + * For Manufacturer to specify the CircuitCapacity in mA (e.g. from DIP switches) + * dg->HwSetCircuitCapacity(20000); // 20A + * + */ /* Once the system is initialised then check to see if the state was restored * (e.g. after a power outage), and if the Enable timer check needs to be started @@ -67,6 +61,32 @@ CHIP_ERROR EVSEManufacturer::Init() return CHIP_NO_ERROR; } +/* + * When the EV is plugged in, and asking for demand change the state + * and set the CableAssembly current limit + * + * EnergyEvseDelegate * dg = GetEvseManufacturer()->GetDelegate(); + * if (dg == nullptr) + * { + * ChipLogError(AppServer, "Delegate is not initialized"); + * return CHIP_ERROR_UNINITIALIZED; + * } + * + * dg->HwSetState(StateEnum::kPluggedInDemand); + * dg->HwSetCableAssemblyLimit(63000); // 63A = 63000mA + * + * + * If the vehicle ID can be retrieved (e.g. over Powerline) + * dg->HwSetVehicleID(CharSpan::fromCharString("TEST_VEHICLE_123456789")); + * + * + * If the EVSE has an RFID sensor, the RFID value read can cause an event to be sent + * (e.g. can be used to indicate if a user as tried to activate the charging) + * + * uint8_t uid[10] = { 0x01, 0x23, 0x45, 0x67, 0x89, 0xAA, 0xBB, 0xCC, 0xDD, 0xEE }; + * dg->HwSetRFID(ByteSpan(uid)); + */ + CHIP_ERROR EVSEManufacturer::Shutdown() { return CHIP_NO_ERROR; diff --git a/examples/energy-management-app/energy-management-common/src/EnergyEvseDelegateImpl.cpp b/examples/energy-management-app/energy-management-common/src/EnergyEvseDelegateImpl.cpp index 63498e204e850a..dc3385c850c85f 100644 --- a/examples/energy-management-app/energy-management-common/src/EnergyEvseDelegateImpl.cpp +++ b/examples/energy-management-app/energy-management-common/src/EnergyEvseDelegateImpl.cpp @@ -198,7 +198,7 @@ Status EnergyEvseDelegate::ScheduleCheckOnEnabledTimeout() else if (err == CHIP_ERROR_REAL_TIME_NOT_SYNCED) { /* Real time isn't sync'd -lets check again in 30 seconds - otherwise keep the charger enabled */ - DeviceLayer::SystemLayer().StartTimer(System::Clock::Seconds32(PERIODIC_CHECK_INTERVAL_REAL_TIME_CLOCK_NOT_SYNCED), + DeviceLayer::SystemLayer().StartTimer(System::Clock::Seconds32(kPeriodicCheckIntervalRealTimeClockNotSynced), EvseCheckTimerExpiry, this); } return Status::Success; @@ -387,7 +387,6 @@ Status EnergyEvseDelegate::HwSetState(StateEnum newState) /* All other states should be managed by the Delegate */ ChipLogError(AppServer, "HwSetState received invalid enum from caller"); return Status::Failure; - break; } return Status::Success; diff --git a/examples/energy-management-app/energy-management-common/src/EnergyEvseManager.cpp b/examples/energy-management-app/energy-management-common/src/EnergyEvseManager.cpp index a71474f0913abb..710b13f9d342b8 100644 --- a/examples/energy-management-app/energy-management-common/src/EnergyEvseManager.cpp +++ b/examples/energy-management-app/energy-management-common/src/EnergyEvseManager.cpp @@ -105,12 +105,7 @@ CHIP_ERROR EnergyEvseManager::LoadPersistentAttributes() CHIP_ERROR EnergyEvseManager::Init() { - CHIP_ERROR err = Instance::Init(); - if (err != CHIP_NO_ERROR) - { - return err; - } - + ReturnErrorOnFailure(Instance::Init()); return LoadPersistentAttributes(); } From 895b55238ccb4183542e413801bb3e13d390d048 Mon Sep 17 00:00:00 2001 From: James Harrow Date: Fri, 12 Jan 2024 19:16:25 +0000 Subject: [PATCH 094/114] Refactored HwSetState to use nested switch statements to be clear that all enums are caught. --- .../src/EnergyEvseDelegateImpl.cpp | 48 +++++++++++++++---- 1 file changed, 39 insertions(+), 9 deletions(-) diff --git a/examples/energy-management-app/energy-management-common/src/EnergyEvseDelegateImpl.cpp b/examples/energy-management-app/energy-management-common/src/EnergyEvseDelegateImpl.cpp index dc3385c850c85f..14486d9528512f 100644 --- a/examples/energy-management-app/energy-management-common/src/EnergyEvseDelegateImpl.cpp +++ b/examples/energy-management-app/energy-management-common/src/EnergyEvseDelegateImpl.cpp @@ -345,41 +345,71 @@ Status EnergyEvseDelegate::HwSetState(StateEnum newState) switch (newState) { case StateEnum::kNotPluggedIn: - if (mHwState == StateEnum::kPluggedInNoDemand || mHwState == StateEnum::kPluggedInDemand) + switch (mHwState) { + case StateEnum::kNotPluggedIn: + // No change + break; + case StateEnum::kPluggedInNoDemand: + case StateEnum::kPluggedInDemand: /* EVSE has been unplugged now */ mHwState = newState; HandleStateMachineEvent(EVSEStateMachineEvent::EVNotDetectedEvent); + break; + + default: + // invalid value for mHwState + ChipLogError(AppServer, "HwSetState newstate(kNotPluggedIn) - Invalid value for mHwState"); + mHwState = newState; // set it to the new state + break; } break; case StateEnum::kPluggedInNoDemand: - if (mHwState == StateEnum::kNotPluggedIn) + switch (mHwState) { + case StateEnum::kNotPluggedIn: /* EV was unplugged, now is plugged in */ mHwState = newState; HandleStateMachineEvent(EVSEStateMachineEvent::EVPluggedInEvent); - } - else if (mHwState == StateEnum::kPluggedInDemand) - { + break; + case StateEnum::kPluggedInNoDemand: + // No change + break; + case StateEnum::kPluggedInDemand: /* EV was plugged in and wanted demand, now doesn't want demand */ mHwState = newState; HandleStateMachineEvent(EVSEStateMachineEvent::EVNoDemandEvent); + break; + default: + // invalid value for mHwState + ChipLogError(AppServer, "HwSetState newstate(kNotPluggedIn) - Invalid value for mHwState"); + mHwState = newState; // set it to the new state + break; } break; case StateEnum::kPluggedInDemand: - if (mHwState == StateEnum::kNotPluggedIn) + switch (mHwState) { + case StateEnum::kNotPluggedIn: /* EV was unplugged, now is plugged in and wants demand */ mHwState = newState; HandleStateMachineEvent(EVSEStateMachineEvent::EVPluggedInEvent); HandleStateMachineEvent(EVSEStateMachineEvent::EVDemandEvent); - } - else if (mHwState == StateEnum::kPluggedInNoDemand) - { + break; + case StateEnum::kPluggedInNoDemand: /* EV was plugged in and didn't want demand, now does want demand */ mHwState = newState; HandleStateMachineEvent(EVSEStateMachineEvent::EVDemandEvent); + break; + case StateEnum::kPluggedInDemand: + // No change + break; + default: + // invalid value for mHwState + ChipLogError(AppServer, "HwSetState newstate(kNotPluggedIn) - Invalid value for mHwState"); + mHwState = newState; // set it to the new state + break; } break; From 87fe6cca8cc63d0b595994dfcdeb72a9dc1aedf3 Mon Sep 17 00:00:00 2001 From: James Harrow Date: Fri, 12 Jan 2024 19:55:32 +0000 Subject: [PATCH 095/114] Fixed error messages --- .../src/EnergyEvseDelegateImpl.cpp | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/examples/energy-management-app/energy-management-common/src/EnergyEvseDelegateImpl.cpp b/examples/energy-management-app/energy-management-common/src/EnergyEvseDelegateImpl.cpp index 14486d9528512f..6704eda6fa0158 100644 --- a/examples/energy-management-app/energy-management-common/src/EnergyEvseDelegateImpl.cpp +++ b/examples/energy-management-app/energy-management-common/src/EnergyEvseDelegateImpl.cpp @@ -360,7 +360,7 @@ Status EnergyEvseDelegate::HwSetState(StateEnum newState) default: // invalid value for mHwState ChipLogError(AppServer, "HwSetState newstate(kNotPluggedIn) - Invalid value for mHwState"); - mHwState = newState; // set it to the new state + mHwState = newState; // set it to the new state anyway break; } break; @@ -383,8 +383,8 @@ Status EnergyEvseDelegate::HwSetState(StateEnum newState) break; default: // invalid value for mHwState - ChipLogError(AppServer, "HwSetState newstate(kNotPluggedIn) - Invalid value for mHwState"); - mHwState = newState; // set it to the new state + ChipLogError(AppServer, "HwSetState newstate(kPluggedInNoDemand) - Invalid value for mHwState"); + mHwState = newState; // set it to the new state anyway break; } break; @@ -407,8 +407,8 @@ Status EnergyEvseDelegate::HwSetState(StateEnum newState) break; default: // invalid value for mHwState - ChipLogError(AppServer, "HwSetState newstate(kNotPluggedIn) - Invalid value for mHwState"); - mHwState = newState; // set it to the new state + ChipLogError(AppServer, "HwSetState newstate(kPluggedInDemand) - Invalid value for mHwState"); + mHwState = newState; // set it to the new state anyway break; } break; From 6b12abe16ef943d4c8ef05aa3b20bd20690050c0 Mon Sep 17 00:00:00 2001 From: James Harrow Date: Fri, 12 Jan 2024 20:54:51 +0000 Subject: [PATCH 096/114] Test scripts: Removed hardcoded endpoint 1 (use --endpoint 1 in args), allowed the enableKey to be passed in using --hex-arg enableKey:000102030405060708090a0b0c0d0e0f --- src/python_testing/TC_EEVSE_2_2.py | 24 +++++++---------- src/python_testing/TC_EEVSE_2_4.py | 8 +++--- src/python_testing/TC_EEVSE_2_5.py | 6 +++-- src/python_testing/TC_EEVSE_Utils.py | 39 +++++++++++++++++++++------- 4 files changed, 48 insertions(+), 29 deletions(-) diff --git a/src/python_testing/TC_EEVSE_2_2.py b/src/python_testing/TC_EEVSE_2_2.py index ce4b543bc2d9c1..fd5a3a042f5fa8 100644 --- a/src/python_testing/TC_EEVSE_2_2.py +++ b/src/python_testing/TC_EEVSE_2_2.py @@ -31,12 +31,6 @@ class TC_EEVSE_2_2(MatterBaseTest, EEVSEBaseTestHelper): - async def write_user_max_charge(self, endpoint, user_max_charge): - result = await self.default_controller.WriteAttribute(self.dut_node_id, - [(endpoint, - Clusters.EnergyEvse.Attributes.UserMaximumChargeCurrent(user_max_charge))]) - asserts.assert_equal(result[0].Status, Status.Success, "UserMaximumChargeCurrent write failed") - def desc_TC_EEVSE_2_2(self) -> str: """Returns a description of this test""" return "5.1.3. [TC-EEVSE-2.2] Primary functionality with DUT as Server" @@ -106,7 +100,9 @@ async def test_TC_EEVSE_2_2(self): # Subscribe to Events and when they are sent push them to a queue for checking later events_callback = EventChangeCallback(Clusters.EnergyEvse) - await events_callback.start(self.default_controller, self.dut_node_id) + await events_callback.start(self.default_controller, + self.dut_node_id, + self.matter_test_config.endpoint) self.step("2") await self.check_test_event_triggers_enabled() @@ -135,7 +131,7 @@ async def test_TC_EEVSE_2_2(self): self.step("4b") # Save Session ID for later and check it against the value in the event - session_id = await self.read_evse_attribute_expect_success(endpoint=1, attribute="SessionID") + session_id = await self.read_evse_attribute_expect_success(attribute="SessionID") self.validate_ev_connected_event(event_data, session_id) self.step("5") @@ -167,7 +163,7 @@ async def test_TC_EEVSE_2_2(self): await self.check_evse_attribute("MinimumChargeCurrent", min_charge_current) self.step("6e") - circuit_capacity = await self.read_evse_attribute_expect_success(endpoint=1, attribute="CircuitCapacity") + circuit_capacity = await self.read_evse_attribute_expect_success(attribute="CircuitCapacity") expected_max_charge = min(max_charge_current, circuit_capacity) await self.check_evse_attribute("MaximumChargeCurrent", expected_max_charge) @@ -192,7 +188,7 @@ async def test_TC_EEVSE_2_2(self): min_charge_current = 6000 max_charge_current = 12000 - await self.send_enable_charge_command(endpoint=1, charge_until=charge_until, min_charge=min_charge_current, max_charge=max_charge_current) + await self.send_enable_charge_command(charge_until=charge_until, min_charge=min_charge_current, max_charge=max_charge_current) event_data = events_callback.WaitForEventReport(Clusters.EnergyEvse.Events.EnergyTransferStarted) self.step("8a") @@ -208,7 +204,7 @@ async def test_TC_EEVSE_2_2(self): await self.check_evse_attribute("MinimumChargeCurrent", min_charge_current) self.step("8e") - circuit_capacity = await self.read_evse_attribute_expect_success(endpoint=1, attribute="CircuitCapacity") + circuit_capacity = await self.read_evse_attribute_expect_success(attribute="CircuitCapacity") expected_max_charge = min(max_charge_current, circuit_capacity) await self.check_evse_attribute("MaximumChargeCurrent", expected_max_charge) @@ -217,7 +213,7 @@ async def test_TC_EEVSE_2_2(self): self.step("9") # This will only work if the optional UserMaximumChargeCurrent attribute is supported - supported_attributes = await self.get_supported_energy_evse_attributes(endpoint=1) + supported_attributes = await self.get_supported_energy_evse_attributes() if Clusters.EnergyEvse.Attributes.UserMaximumChargeCurrent.attribute_id in supported_attributes: logging.info("UserMaximumChargeCurrent is supported...") user_max_charge_current = 6000 @@ -243,7 +239,7 @@ async def test_TC_EEVSE_2_2(self): self.step("11") await self.send_test_event_trigger_charge_demand() # Check we get EnergyTransferStarted again - await self.send_enable_charge_command(endpoint=1, charge_until=charge_until, min_charge=min_charge_current, max_charge=max_charge_current) + await self.send_enable_charge_command(charge_until=charge_until, min_charge=min_charge_current, max_charge=max_charge_current) event_data = events_callback.WaitForEventReport(Clusters.EnergyEvse.Events.EnergyTransferStarted) self.validate_energy_transfer_started_event(event_data, session_id, expected_state, expected_max_charge) @@ -275,7 +271,7 @@ async def test_TC_EEVSE_2_2(self): await self.check_evse_attribute("SessionID", session_id) self.step("13d") - session_duration = await self.read_evse_attribute_expect_success(endpoint=1, attribute="SessionDuration") + session_duration = await self.read_evse_attribute_expect_success(attribute="SessionDuration") asserts.assert_greater_equal(session_duration, charging_duration, f"Unexpected 'SessionDuration' value - expected >= {charging_duration}, was {session_duration}") diff --git a/src/python_testing/TC_EEVSE_2_4.py b/src/python_testing/TC_EEVSE_2_4.py index 8a28b562635390..9379e23332e813 100644 --- a/src/python_testing/TC_EEVSE_2_4.py +++ b/src/python_testing/TC_EEVSE_2_4.py @@ -75,7 +75,9 @@ async def test_TC_EEVSE_2_4(self): # Subscribe to Events and when they are sent push them to a queue for checking later events_callback = EventChangeCallback(Clusters.EnergyEvse) - await events_callback.start(self.default_controller, self.dut_node_id) + await events_callback.start(self.default_controller, + self.dut_node_id, + self.matter_test_config.endpoint) self.step("2") await self.check_test_event_triggers_enabled() @@ -104,14 +106,14 @@ async def test_TC_EEVSE_2_4(self): self.step("4b") # Save Session ID for later and check it against the value in the event - session_id = await self.read_evse_attribute_expect_success(endpoint=1, attribute="SessionID") + session_id = await self.read_evse_attribute_expect_success(attribute="SessionID") self.validate_ev_connected_event(event_data, session_id) self.step("5") charge_until = NullValue min_charge_current = 6000 max_charge_current = 60000 - await self.send_enable_charge_command(endpoint=1, charge_until=charge_until, min_charge=min_charge_current, max_charge=max_charge_current) + await self.send_enable_charge_command(charge_until=charge_until, min_charge=min_charge_current, max_charge=max_charge_current) self.step("6") await self.send_test_event_trigger_charge_demand() diff --git a/src/python_testing/TC_EEVSE_2_5.py b/src/python_testing/TC_EEVSE_2_5.py index a4b35a7e9feae9..1a647c20e0bcef 100644 --- a/src/python_testing/TC_EEVSE_2_5.py +++ b/src/python_testing/TC_EEVSE_2_5.py @@ -69,7 +69,9 @@ async def test_TC_EEVSE_2_5(self): # Subscribe to Events and when they are sent push them to a queue for checking later events_callback = EventChangeCallback(Clusters.EnergyEvse) - await events_callback.start(self.default_controller, self.dut_node_id) + await events_callback.start(self.default_controller, + self.dut_node_id, + self.matter_test_config.endpoint) self.step("2") await self.check_test_event_triggers_enabled() @@ -90,7 +92,7 @@ async def test_TC_EEVSE_2_5(self): charge_until = NullValue min_charge_current = 6000 max_charge_current = 60000 - await self.send_enable_charge_command(endpoint=1, charge_until=charge_until, min_charge=min_charge_current, max_charge=max_charge_current) + await self.send_enable_charge_command(charge_until=charge_until, min_charge=min_charge_current, max_charge=max_charge_current) self.step("4a") await self.check_evse_attribute("State", Clusters.EnergyEvse.Enums.StateEnum.kNotPluggedIn) diff --git a/src/python_testing/TC_EEVSE_Utils.py b/src/python_testing/TC_EEVSE_Utils.py index d2d5873c37d0b4..fb6bfa1f714d13 100644 --- a/src/python_testing/TC_EEVSE_Utils.py +++ b/src/python_testing/TC_EEVSE_Utils.py @@ -32,9 +32,9 @@ def __init__(self, expected_cluster: ClusterObjects): self._q = queue.Queue() self._expected_cluster = expected_cluster - async def start(self, dev_ctrl, nodeid, endpoint: int = 1): - self._subscription = await dev_ctrl.ReadEvent(nodeid, - events=[(endpoint, self._expected_cluster, 1)], reportInterval=(1, 5), + async def start(self, dev_ctrl, node_id: int, endpoint: int): + self._subscription = await dev_ctrl.ReadEvent(node_id, + events=[(endpoint, self._expected_cluster, True)], reportInterval=(1, 5), fabricFiltered=False, keepSubscriptions=True, autoResubscribe=False) self._subscription.SetEventUpdateCallback(self.__call__) @@ -57,20 +57,28 @@ def WaitForEventReport(self, expected_event: ClusterObjects.ClusterEvent): class EEVSEBaseTestHelper: - async def read_evse_attribute_expect_success(self, endpoint, attribute): + async def read_evse_attribute_expect_success(self, endpoint: int = None, attribute: str = ""): full_attr = getattr(Clusters.EnergyEvse.Attributes, attribute) cluster = Clusters.Objects.EnergyEvse return await self.read_single_attribute_check_success(endpoint=endpoint, cluster=cluster, attribute=full_attr) - async def check_evse_attribute(self, attribute, expected_value, endpoint: int = 1): + async def check_evse_attribute(self, attribute, expected_value, endpoint: int = None): value = await self.read_evse_attribute_expect_success(endpoint=endpoint, attribute=attribute) asserts.assert_equal(value, expected_value, f"Unexpected '{attribute}' value - expected {expected_value}, was {value}") - async def get_supported_energy_evse_attributes(self, endpoint): + async def get_supported_energy_evse_attributes(self, endpoint: int = None): return await self.read_evse_attribute_expect_success(endpoint, "AttributeList") - async def send_enable_charge_command(self, endpoint: int = 1, charge_until: int = None, timedRequestTimeoutMs: int = 3000, + async def write_user_max_charge(self, endpoint: int = None, user_max_charge: int = 0): + if endpoint is None: + endpoint = self.matter_test_config.endpoint + result = await self.default_controller.WriteAttribute(self.dut_node_id, + [(endpoint, + Clusters.EnergyEvse.Attributes.UserMaximumChargeCurrent(user_max_charge))]) + asserts.assert_equal(result[0].Status, Status.Success, "UserMaximumChargeCurrent write failed") + + async def send_enable_charge_command(self, endpoint: int = None, charge_until: int = None, timedRequestTimeoutMs: int = 3000, min_charge: int = None, max_charge: int = None, expected_status: Status = Status.Success): try: await self.send_single_cmd(cmd=Clusters.EnergyEvse.Commands.EnableCharging( @@ -83,7 +91,7 @@ async def send_enable_charge_command(self, endpoint: int = 1, charge_until: int except InteractionModelError as e: asserts.assert_equal(e.status, expected_status, "Unexpected error returned") - async def send_disable_command(self, endpoint: int = 1, timedRequestTimeoutMs: int = 3000, expected_status: Status = Status.Success): + async def send_disable_command(self, endpoint: int = None, timedRequestTimeoutMs: int = 3000, expected_status: Status = Status.Success): try: await self.send_single_cmd(cmd=Clusters.EnergyEvse.Commands.Disable(), endpoint=endpoint, @@ -92,7 +100,7 @@ async def send_disable_command(self, endpoint: int = 1, timedRequestTimeoutMs: i except InteractionModelError as e: asserts.assert_equal(e.status, expected_status, "Unexpected error returned") - async def send_start_diagnostics_command(self, endpoint: int = 1, timedRequestTimeoutMs: int = 3000, + async def send_start_diagnostics_command(self, endpoint: int = None, timedRequestTimeoutMs: int = 3000, expected_status: Status = Status.Success): try: await self.send_single_cmd(cmd=Clusters.EnergyEvse.Commands.StartDiagnostics(), @@ -102,8 +110,18 @@ async def send_start_diagnostics_command(self, endpoint: int = 1, timedRequestTi except InteractionModelError as e: asserts.assert_equal(e.status, expected_status, "Unexpected error returned") - async def send_test_event_triggers(self, enableKey=bytes([b for b in range(16)]), eventTrigger=0x0099000000000000): + async def send_test_event_triggers(self, enableKey: bytes = None, eventTrigger=0x0099000000000000): + # get the test event enable key or assume the default + # This can be passed in on command line using + # --hex-arg enableKey:000102030405060708090a0b0c0d0e0f + if enableKey is None: + if 'enableKey' not in self.matter_test_config.global_test_params: + enableKey = bytes([b for b in range(16)]) + else: + enableKey = self.matter_test_config.global_test_params['enableKey'] + try: + # GeneralDiagnosics cluster is meant to be on Endpoint 0 (Root) await self.send_single_cmd(endpoint=0, cmd=Clusters.GeneralDiagnostics.Commands.TestEventTrigger( enableKey, @@ -116,6 +134,7 @@ async def send_test_event_triggers(self, enableKey=bytes([b for b in range(16)]) async def check_test_event_triggers_enabled(self): full_attr = Clusters.GeneralDiagnostics.Attributes.TestEventTriggersEnabled cluster = Clusters.Objects.GeneralDiagnostics + # GeneralDiagnosics cluster is meant to be on Endpoint 0 (Root) test_event_enabled = await self.read_single_attribute_check_success(endpoint=0, cluster=cluster, attribute=full_attr) asserts.assert_equal(test_event_enabled, True, "TestEventTriggersEnabled is False") From 303ca2af24d85deea20612109f9377140a7bc057 Mon Sep 17 00:00:00 2001 From: James Harrow Date: Fri, 12 Jan 2024 21:31:08 +0000 Subject: [PATCH 097/114] Made enum class for callbacks and improved documentation comments based on feedback. --- .../include/EVSECallbacks.h | 16 +++++++++++----- .../include/EnergyEvseDelegateImpl.h | 16 ++++++++++++---- .../EnergyEvseTestEventTriggerDelegate.h | 11 +++++++---- 3 files changed, 30 insertions(+), 13 deletions(-) diff --git a/examples/energy-management-app/energy-management-common/include/EVSECallbacks.h b/examples/energy-management-app/energy-management-common/include/EVSECallbacks.h index e72ee80ef9fcca..15578405552d78 100644 --- a/examples/energy-management-app/energy-management-common/include/EVSECallbacks.h +++ b/examples/energy-management-app/energy-management-common/include/EVSECallbacks.h @@ -30,31 +30,37 @@ using namespace chip::app::Clusters::EnergyEvse; * This is not specific to the EnergyEVSE cluster, but includes DeviceEnergyManagement * and potential future clusters. */ -enum EVSECallbackType + +enum class EVSECallbackType : uint8_t { /* * The State has changed (e.g. from Disabled to Charging, or vice-versa) */ StateChanged, /* - * ChargeCurrent has changed + * ChargeCurrent has changed (e.g. maxChargingCurrent so requires an + update to advertise a different charging current to the EV) */ ChargeCurrentChanged, /* * Charging Preferences have changed + * The daily charging target time, SoC / Added Energy schedules have changed + * and may require the local optimiser to re-run. */ ChargingPreferencesChanged, /* - * Energy Meter Reading requested + * Energy Meter Reading requested from the hardware, e.g. so that the session + * information can be updated. */ EnergyMeterReadingRequested, /* - * DeviceEnergyManagement has changed + * The associated DeviceEnergyManagement cluster has changed. This may mean + * that the start time, or power profile or power levels have been adjusted */ DeviceEnergyManagementChanged, }; -enum ChargingDischargingType +enum class ChargingDischargingType : uint8_t { kCharging, kDischarging diff --git a/examples/energy-management-app/energy-management-common/include/EnergyEvseDelegateImpl.h b/examples/energy-management-app/energy-management-common/include/EnergyEvseDelegateImpl.h index 1b97fef5a8e54e..8cf76f1b7a29bf 100644 --- a/examples/energy-management-app/energy-management-common/include/EnergyEvseDelegateImpl.h +++ b/examples/energy-management-app/energy-management-common/include/EnergyEvseDelegateImpl.h @@ -137,11 +137,19 @@ class EnergyEvseDelegate : public EnergyEvse::Delegate Status HwRegisterEvseCallbackHandler(EVSECallbackFunc handler, intptr_t arg); /** - * @brief This is used to start a check on if the Enabled timer needs to be started + * @brief Decides if a timer is needed based on EVSE state and sets a callback if needed * - * It should be called after the EVSE is initialised and the persisted attributes - * have been loaded, and time has been synchronised. If time isn't sync'd - * yet it will call itself back periodically (if required). + * In order to ensure the EVSE restarts charging (if enabled) after power loss + * this should be called after the EVSE is initialised + * (e.g. HwSetMaxHardwareCurrentLimit and HwSetCircuitCapacity have been called) + * and the persisted attributes have been loaded, and time has been synchronised. + * + * If time isn't sync'd yet it will call itself back periodically (if required) + * until time is sync'd. + * + * It is also called when a EnableCharging or EnableDischarging command + * is recv'd to schedule when the EVSE should be automatically disabled based + * on ChargingEnabledUntil / DischargingEnabledUntil expiring. */ Status ScheduleCheckOnEnabledTimeout(); diff --git a/src/app/clusters/energy-evse-server/EnergyEvseTestEventTriggerDelegate.h b/src/app/clusters/energy-evse-server/EnergyEvseTestEventTriggerDelegate.h index 1828d30d19eed0..3c1dff4f5e7f81 100644 --- a/src/app/clusters/energy-evse-server/EnergyEvseTestEventTriggerDelegate.h +++ b/src/app/clusters/energy-evse-server/EnergyEvseTestEventTriggerDelegate.h @@ -58,14 +58,17 @@ enum class EnergyEvseTrigger : uint64_t class EnergyEvseTestEventTriggerDelegate : public TestEventTriggerDelegate { public: + /** + * This class expects the enableKey ByteSpan to be valid forever. + * Typically this feature is only enabled in certification testing + * and uses a static secret key in the device for testing (e.g. in factory data) + */ explicit EnergyEvseTestEventTriggerDelegate(const ByteSpan & enableKey, TestEventTriggerDelegate * otherDelegate) : mEnableKey(enableKey), mOtherDelegate(otherDelegate) {} - /** - * This function expects the enableKey ByteSpan to be valid forever. - * Typically this feature is only enabled in certification testing - * and uses a static secret key in the device for testing (e.g. in factory data) + /* This function returns True if the enableKey received in the TestEventTrigger command + * matches the value passed into the constructor. */ bool DoesEnableKeyMatch(const ByteSpan & enableKey) const override; From 34c077d0d015762e5f7d8c98e6a03bf5bb93c473 Mon Sep 17 00:00:00 2001 From: James Harrow Date: Fri, 12 Jan 2024 22:14:05 +0000 Subject: [PATCH 098/114] Fixed another python lint issue. --- src/python_testing/TC_EEVSE_2_2.py | 1 - 1 file changed, 1 deletion(-) diff --git a/src/python_testing/TC_EEVSE_2_2.py b/src/python_testing/TC_EEVSE_2_2.py index fd5a3a042f5fa8..8ebc78a22e94cd 100644 --- a/src/python_testing/TC_EEVSE_2_2.py +++ b/src/python_testing/TC_EEVSE_2_2.py @@ -21,7 +21,6 @@ import chip.clusters as Clusters from chip.clusters.Types import NullValue -from chip.interaction_model import Status from matter_testing_support import MatterBaseTest, TestStep, async_test_body, default_matter_test_main from mobly import asserts from TC_EEVSE_Utils import EEVSEBaseTestHelper, EventChangeCallback From 50793c3a86e76de039fa5c6be68f93310823b006 Mon Sep 17 00:00:00 2001 From: James Harrow Date: Fri, 12 Jan 2024 23:58:28 +0000 Subject: [PATCH 099/114] Updated README.md with help on how to build for test event triggers, using chip-repl and python testing. --- .../energy-management-app/linux/README.md | 366 +++++++++++++++++- 1 file changed, 364 insertions(+), 2 deletions(-) diff --git a/examples/energy-management-app/linux/README.md b/examples/energy-management-app/linux/README.md index 9671ab073b12a8..a6a9e9671f622c 100644 --- a/examples/energy-management-app/linux/README.md +++ b/examples/energy-management-app/linux/README.md @@ -13,10 +13,17 @@ To cross-compile this example on x64 host and run on **NXP i.MX 8M Mini** - [CHIP Linux Energy Management Example](#chip-linux-energy-management-example) - [Building](#building) - - [Commandline Arguments](#commandline-arguments) + - [Commandline arguments](#commandline-arguments) - [Running the Complete Example on Raspberry Pi 4](#running-the-complete-example-on-raspberry-pi-4) - - [Running RPC console](#running-rpc-console) + - [Running RPC Console](#running-rpc-console) - [Device Tracing](#device-tracing) + - [Python TestCases](#python-testcases) + - [Running the test cases:](#running-the-test-cases) + - [CHIP-REPL Interaction](#chip-repl-interaction) + - [Building chip-repl:](#building-chip-repl) + - [Activating python virtual env](#activating-python-virtual-env) + - [Interacting with CHIP-REPL and the example app](#interacting-with-chip-repl-and-the-example-app) + - [Using chip-repl to Fake a charging session](#using-chip-repl-to-fake-a-charging-session)
@@ -141,3 +148,358 @@ Obtain tracing json file. $ ./{PIGWEED_REPO}/pw_trace_tokenized/py/pw_trace_tokenized/get_trace.py -s localhost:33000 \ -o {OUTPUT_FILE} -t {ELF_FILE} {PIGWEED_REPO}/pw_trace_tokenized/pw_trace_protos/trace_rpc.proto ``` + +## Python TestCases + +When you want to test this cluster you can use chip-repl or chip-tool by hand. +CHIP-REPL is slightly easier to interact with when dealing with some of the +complex structures. + +There are several test scripts provided for EVSE (in +[src/python_testing](src/python_testing)): + +- TC_EEVSE_2_2: This validates the primary functionality +- TC_EEVSE_2_3: This validates Get/Set/Clear target commands +- TC_EEVSE_2_4: This validates Faults +- TC_EEVSE_2_5: This validates EVSE diagnostic command (optional) + +These scripts require the use of TestEventsTriggers via the GeneralDiagnostics +cluster on Endpoint 0. This requires an enableKey (16 bytes) and a set of +reserved int64_t TestEvent trigger codes. + +By default the test event support is not enabled, and when compiling the example +app you need to add `chip_enable_energy_evse_trigger=true` to the gn args. + + $ gn gen out/debug + $ ninja -C out/debug --args='chip_enable_energy_evse_trigger=true` + +Once the application is built you also need to tell it at runtime what the +chosen enable key is using the `--enable-key` command line option. + + $ ./chip-energy-management-app --enable-key 000102030405060708090a0b0c0d0e0f + +### Running the test cases: + +From the top-level of the connectedhomeip repo type: + +```bash + $ python src/python_testing/TC_EEVSE_2_2.py --endpoint 1 -m on-network -n 1234 -p 20202021 -d 3840 --hex-arg enableKey:000102030405060708090a0b0c0d0e0f +``` + +- Note that the `--endpoint 1` must be used with the example, since the EVSE + cluster is on endpoint 1. The `--hex-arg enableKey:` value must match + the `--enable-key ` used on chip-energy-management-app args. + +## CHIP-REPL Interaction + +- See chip-repl documentation in + [Matter_REPL_Intro](../../../docs/guides/repl/Matter_REPL_Intro.ipynb) + +### Building chip-repl: + +```bash + $ ./build_python.sh -i +``` + +### Activating python virtual env + +- You need to repeat this step each time you start a new shell. + +```bash + $ source /bin/activate +``` + +### Interacting with CHIP-REPL and the example app + +- Step 1: Launch the example app + +```bash + $ ./chip-energy-management-app --enable-key 000102030405060708090a0b0c0d0e0f +``` + +- Step 2: Launch CHIP-REPL + +```bash + $ chip-repl +``` + +- Step 3: (In chip-repl) Commissioning OnNetwork + +```python + devCtrl.CommissionOnNetwork(1234,20202021) # Commission with NodeID 1234 +Established secure session with Device +Commissioning complete +Out[2]: +``` + +- Step 4: (In chip-repl) Read EVSE attributes + +```python + # Read from NodeID 1234, Endpoint 1, all attributes on EnergyEvse cluster + await devCtrl.ReadAttribute(1234,[(1, chip.clusters.EnergyEvse)]) + +{ +│ 1: { +│ │ : { +│ │ │ : 3790455237, +│ │ │ : Null, +│ │ │ : , +│ │ │ : Null, +│ │ │ : Null, +│ │ │ : 0, +│ │ │ : Null, +│ │ │ : Null, +│ │ │ : [ +... │ │ ], +│ │ │ : 6000, +│ │ │ : Null, +│ │ │ : 758415333, +│ │ │ : 0, +│ │ │ : 1, +│ │ │ : [ +... +│ │ │ ], +│ │ │ : , +│ │ │ : Null, +│ │ │ : Null, +│ │ │ : Null, +│ │ │ : Null, +│ │ │ : Null, +│ │ │ : [ +... │ │ ], +│ │ │ : Null, +│ │ │ : 0, +│ │ │ : Null, +│ │ │ : , +│ │ │ : 600, +│ │ │ : 0, +│ │ │ : 1, +│ │ │ : 80000, +│ │ │ : 2 +│ │ } +│ } +} + +``` + +- Step 5: Setting up a subscription so that attributes updates are sent + automatically + +```python + reportingTimingParams = (3, 60) # MinInterval = 3s, MaxInterval = 60s + subscription = await devCtrl.ReadAttribute(1234,[(1, chip.clusters.EnergyEvse)], reportInterval=reportingTimingParams) +``` + +- Step 6: Send an EnableCharging command which lasts for 60 seconds The + EnableCharging takes an optional parameter which allows the charger to + automatically disable itself at some preset time in the future. Note that it + uses Epoch_s (which is from Jan 1 2000) which is a uint32_t in seconds. + +```python + from datetime import datetime, timezone, timedelta + epoch_end = int((datetime.now(tz=timezone.utc) + timedelta(seconds=60) - datetime(2000, 1, 1, 0, 0, 0, 0, timezone.utc)).total_seconds()) + + await devCtrl.SendCommand(1234, 1, chip.clusters.EnergyEvse.Commands.EnableCharging(chargingEnabledUntil=epoch_end,minimumChargeCurrent=2000,maximumChargeCurrent=25000),timedRequestTimeoutMs=3000) +``` + +The output should look like: + +``` +Attribute Changed: +{ +│ 'Endpoint': 1, +│ 'Attribute': , +│ 'Value': +} +Attribute Changed: +{ +│ 'Endpoint': 1, +│ 'Attribute': , +│ 'Value': 2000 +} +Attribute Changed: +{ +│ 'Endpoint': 1, +│ 'Attribute': , +│ 'Value': 758416066 +} +``` + +After 60 seconds the charging should automatically become disabled: + +```python +Attribute Changed: +{ +│ 'Endpoint': 1, +│ 'Attribute': , +│ 'Value': +} +Attribute Changed: +{ +│ 'Endpoint': 1, +│ 'Attribute': , +│ 'Value': 0 +} +Attribute Changed: +{ +│ 'Endpoint': 1, +│ 'Attribute': , +│ 'Value': 0 +} +Attribute Changed: +{ +│ 'Endpoint': 1, +│ 'Attribute': , +│ 'Value': 0 +} +``` + +Note that you can omit the `chargingEnabledUntil` argument and it will charge +indefinitely. + +### Using chip-repl to Fake a charging session + +If you haven't implemented a real EVSE but want to simulate plugging in an EV +then you can use a few of the test event triggers to simulate these scenarios. + +The test event triggers values can be found in: +[EnergyEvseTestEventTriggerDelegate.h](../../../src/app/clusters/energy-evse-server/EnergyEvseTestEventTriggerDelegate.h) + +- 0x0099000000000000 - Simulates the EVSE being installed on a 32A supply +- 0x0099000000000002 - Simulates the EVSE being plugged in (this should + generate an EVConnected event) +- 0x0099000000000004 - Simulates the EVSE requesting power + +To send a test event trigger to the app, use the following commands (in +chip-repl): + +```python + # Read the events + await devCtrl.ReadEvent(1234,[(1, chip.clusters.EnergyEvse,1)]) +[] + + # send 1st event trigger to 'install' the EVSE on a 32A supply + await devCtrl.SendCommand(1234, 0, chip.clusters.GeneralDiagnostics.Commands.TestEventTrigger(enableKey=bytes([b for b in range(16)]), eventTrigger=0x0099000000000000)) + + # send 2nd event trigger to plug the EV in + await devCtrl.SendCommand(1234, 0, chip.clusters.GeneralDiagnostics.Commands.TestEventTrigger(enableKey=bytes([b for b in range(16)]), eventTrigger=0x0099000000000002)) + +``` + +Now send the enable charging command (omit the chargingEnabledUntil arg this +time): + +```python + await devCtrl.SendCommand(1234, 1, chip.clusters.EnergyEvse.Commands.EnableCharging(minimumChargeCurrent=2000,maximumChargeCurrent=25000),timedRequestTimeoutMs=3000) +``` + +Now send the test event trigger to simulate the EV asking for demand: + +```python + # send 2nd event trigger to plug the EV in + await devCtrl.SendCommand(1234, 0, chip.clusters.GeneralDiagnostics.Commands.TestEventTrigger(enableKey=bytes([b for b in range(16)]), eventTrigger=0x0099000000000004)) + + # Read the events + await devCtrl.ReadEvent(1234,[(1, chip.clusters.EnergyEvse,1)]) +[ +│ EventReadResult( +│ │ Header=EventHeader( +│ │ │ EndpointId=1, +│ │ │ ClusterId=153, +│ │ │ EventId=0, +│ │ │ EventNumber=65538, +│ │ │ Priority=, +│ │ │ Timestamp=1705102500069, +│ │ │ TimestampType= +│ │ ), +│ │ Status=, +│ │ Data=EVConnected( +│ │ │ sessionID=0 +│ │ ) +│ ), +│ EventReadResult( +│ │ Header=EventHeader( +│ │ │ EndpointId=1, +│ │ │ ClusterId=153, +│ │ │ EventId=2, +│ │ │ EventNumber=65539, +│ │ │ Priority=, +│ │ │ Timestamp=1705102801764, +│ │ │ TimestampType= +│ │ ), +│ │ Status=, +│ │ Data=EnergyTransferStarted( +│ │ │ sessionID=0, +│ │ │ state=, +│ │ │ maximumCurrent=25000 +│ │ ) +│ ) +] +``` + +- We can see that the `EventNumber 65538` was sent when the vehicle was + plugged in, and a new `sessionID=0` was created. +- We can also see that the EnergyTransferStarted was sent in + `EventNumber 65539` + +What happens when we unplug the vehicle? + +```python + await devCtrl.SendCommand(1234, 0, chip.clusters.GeneralDiagnostics.Commands.TestEventTrigger(enableKey=bytes([b for b in range(16)]), eventTrigger=0x0099000000000001)) +``` + +When we re-read the events: + +```python +[ +│ EventReadResult( +│ │ Header=EventHeader( +│ │ │ EndpointId=1, +│ │ │ ClusterId=153, +│ │ │ EventId=3, +│ │ │ EventNumber=65540, +│ │ │ Priority=, +│ │ │ Timestamp=1705102996749, +│ │ │ TimestampType= +│ │ ), +│ │ Status=, +│ │ Data=EnergyTransferStopped( +│ │ │ sessionID=0, +│ │ │ state=, +│ │ │ reason=, +│ │ │ energyTransferred=0 +│ │ ) +│ ), +│ EventReadResult( +│ │ Header=EventHeader( +│ │ │ EndpointId=1, +│ │ │ ClusterId=153, +│ │ │ EventId=1, +│ │ │ EventNumber=65541, +│ │ │ Priority=, +│ │ │ Timestamp=1705102996749, +│ │ │ TimestampType= +│ │ ), +│ │ Status=, +│ │ Data=EVNotDetected( +│ │ │ sessionID=0, +│ │ │ state=, +│ │ │ sessionDuration=0, +│ │ │ sessionEnergyCharged=0, +│ │ │ sessionEnergyDischarged=0 +│ │ ) +│ ) +] + +``` + +- In `EventNumber 65540` we had an EnergyTransferStopped event with reason + `kOther`. + + This was a rather abrupt end to a charging session (normally we would see + the EVSE or EV decide to stop charging), but this demonstrates the cable + being pulled out without a graceful charging shutdown. + +- In `EventNumber 65541` we had an EvNotDetected event showing that the state + was `kPluggedInCharging` prior to the EV being not detected (normally in a + graceful shutdown this would be `kPluggedInNoDemand` or `kPluggedInDemand`). From f6293264611e8cb7433c9ee0e1622bbc8fd71b4a Mon Sep 17 00:00:00 2001 From: James Harrow Date: Sat, 13 Jan 2024 13:30:52 +0000 Subject: [PATCH 100/114] Tweaks to README.md to avoid Myst syntax highlighting issues. --- examples/energy-management-app/linux/README.md | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/examples/energy-management-app/linux/README.md b/examples/energy-management-app/linux/README.md index a6a9e9671f622c..fbf2e83d730970 100644 --- a/examples/energy-management-app/linux/README.md +++ b/examples/energy-management-app/linux/README.md @@ -237,7 +237,9 @@ Out[2]: ```python # Read from NodeID 1234, Endpoint 1, all attributes on EnergyEvse cluster await devCtrl.ReadAttribute(1234,[(1, chip.clusters.EnergyEvse)]) +``` +``` { │ 1: { │ │ : { @@ -327,7 +329,7 @@ Attribute Changed: After 60 seconds the charging should automatically become disabled: -```python +``` Attribute Changed: { │ 'Endpoint': 1, @@ -374,10 +376,6 @@ To send a test event trigger to the app, use the following commands (in chip-repl): ```python - # Read the events - await devCtrl.ReadEvent(1234,[(1, chip.clusters.EnergyEvse,1)]) -[] - # send 1st event trigger to 'install' the EVSE on a 32A supply await devCtrl.SendCommand(1234, 0, chip.clusters.GeneralDiagnostics.Commands.TestEventTrigger(enableKey=bytes([b for b in range(16)]), eventTrigger=0x0099000000000000)) @@ -401,6 +399,9 @@ Now send the test event trigger to simulate the EV asking for demand: # Read the events await devCtrl.ReadEvent(1234,[(1, chip.clusters.EnergyEvse,1)]) +``` + +``` [ │ EventReadResult( │ │ Header=EventHeader( @@ -450,7 +451,7 @@ What happens when we unplug the vehicle? When we re-read the events: -```python +``` [ │ EventReadResult( │ │ Header=EventHeader( From 4d2108bec230b3f1669c4fee7747c7af1119df54 Mon Sep 17 00:00:00 2001 From: James Harrow Date: Sat, 13 Jan 2024 13:41:22 +0000 Subject: [PATCH 101/114] Improved error logging around GetEpochTS() --- .../src/EnergyEvseDelegateImpl.cpp | 15 +++++++++++---- 1 file changed, 11 insertions(+), 4 deletions(-) diff --git a/examples/energy-management-app/energy-management-common/src/EnergyEvseDelegateImpl.cpp b/examples/energy-management-app/energy-management-common/src/EnergyEvseDelegateImpl.cpp index 6704eda6fa0158..2b4a6e44f5fcea 100644 --- a/examples/energy-management-app/energy-management-common/src/EnergyEvseDelegateImpl.cpp +++ b/examples/energy-management-app/energy-management-common/src/EnergyEvseDelegateImpl.cpp @@ -1510,9 +1510,12 @@ void EvseSession::StartSession(int64_t chargingMeterValue, int64_t dischargingMe { /* Get Timestamp */ uint32_t chipEpoch = 0; - if (GetEpochTS(chipEpoch) != CHIP_NO_ERROR) + CHIP_ERROR err = GetEpochTS(chipEpoch); + if (err != CHIP_NO_ERROR) { - ChipLogError(AppServer, "EVSE: Failed to get timestamp when starting session"); + /* Note that the error will be also be logged inside GetErrorTS() - + * adding context here to help debugging */ + ChipLogError(AppServer, "EVSE: Unable to get current time when starting session - err:%" CHIP_ERROR_FORMAT, err.Format()); return; } mStartTime = chipEpoch; @@ -1556,9 +1559,13 @@ void EvseSession::RecalculateSessionDuration() { /* Get Timestamp */ uint32_t chipEpoch = 0; - if (GetEpochTS(chipEpoch) != CHIP_NO_ERROR) + CHIP_ERROR err = GetEpochTS(chipEpoch); + if (err != CHIP_NO_ERROR) { - ChipLogError(AppServer, "EVSE: Failed to get timestamp when updating session duration"); + /* Note that the error will be also be logged inside GetErrorTS() - + * adding context here to help debugging */ + ChipLogError(AppServer, "EVSE: Unable to get current time when updating session duration - err:%" CHIP_ERROR_FORMAT, + err.Format()); return; } From 1f16b6c3b5d64720cb9f7a824c684bfdb513d8e2 Mon Sep 17 00:00:00 2001 From: James Harrow Date: Sat, 13 Jan 2024 14:32:37 +0000 Subject: [PATCH 102/114] Made main use std::unique_ptr instead of using new/delete per PR comments. Also moved GetEVSEManufacturer declaration to header file. --- .../include/EVSEManufacturerImpl.h | 11 +++ .../src/EVSEManufacturerImpl.cpp | 3 - examples/energy-management-app/linux/main.cpp | 79 ++++++++----------- 3 files changed, 44 insertions(+), 49 deletions(-) diff --git a/examples/energy-management-app/energy-management-common/include/EVSEManufacturerImpl.h b/examples/energy-management-app/energy-management-common/include/EVSEManufacturerImpl.h index 01f46a9d717e19..5bf253aef81d9b 100644 --- a/examples/energy-management-app/energy-management-common/include/EVSEManufacturerImpl.h +++ b/examples/energy-management-app/energy-management-common/include/EVSEManufacturerImpl.h @@ -66,6 +66,17 @@ class EVSEManufacturer int64_t mLastDischargingEnergyMeter = 0; }; +/** @brief Helper function to return the singleton EVSEManufacturer instance + * + * This is needed by the EVSEManufacturer class to support TestEventTriggers + * which are called outside of any class context. This allows the EVSEManufacturer + * class to return the relevant Delegate instance in which to invoke the test + * events on. + * + * This function is typically found in main.cpp or wherever the singleton is created. + */ +EVSEManufacturer * GetEvseManufacturer(); + } // namespace EnergyEvse } // namespace Clusters } // namespace app diff --git a/examples/energy-management-app/energy-management-common/src/EVSEManufacturerImpl.cpp b/examples/energy-management-app/energy-management-common/src/EVSEManufacturerImpl.cpp index 6e646a8dad42ee..da21a51cf7eb5d 100644 --- a/examples/energy-management-app/energy-management-common/src/EVSEManufacturerImpl.cpp +++ b/examples/energy-management-app/energy-management-common/src/EVSEManufacturerImpl.cpp @@ -25,9 +25,6 @@ using namespace chip::app; using namespace chip::app::Clusters; using namespace chip::app::Clusters::EnergyEvse; -/* Function prototype - this should be implemented somewhere in main.cpp or similar */ -EVSEManufacturer * GetEvseManufacturer(); - CHIP_ERROR EVSEManufacturer::Init() { /* Manufacturers should modify this to do any custom initialisation */ diff --git a/examples/energy-management-app/linux/main.cpp b/examples/energy-management-app/linux/main.cpp index 83cdecbe83db15..faf7651875fa94 100644 --- a/examples/energy-management-app/linux/main.cpp +++ b/examples/energy-management-app/linux/main.cpp @@ -35,48 +35,47 @@ using namespace chip; using namespace chip::app; using namespace chip::app::Clusters; -static EnergyEvseDelegate * gDelegate = nullptr; -static EnergyEvseManager * gInstance = nullptr; -static EVSEManufacturer * gEvseManufacturer = nullptr; +static std::unique_ptr gDelegate; +static std::unique_ptr gInstance; +static std::unique_ptr gEvseManufacturer; -EVSEManufacturer * GetEvseManufacturer() +EVSEManufacturer * EnergyEvse::GetEvseManufacturer() { - return gEvseManufacturer; + return gEvseManufacturer.get(); } void ApplicationInit() { CHIP_ERROR err; - if ((gDelegate != nullptr) || (gInstance != nullptr) || (gEvseManufacturer != nullptr)) + if (gDelegate || gInstance || gEvseManufacturer) { ChipLogError(AppServer, "EVSE Instance or Delegate, EvseManufacturer already exist."); return; } - gDelegate = new EnergyEvseDelegate(); - if (gDelegate == nullptr) + gDelegate = std::make_unique(); + if (!gDelegate) { ChipLogError(AppServer, "Failed to allocate memory for EnergyEvseDelegate"); return; } /* Manufacturer may optionally not support all features, commands & attributes */ - gInstance = - new EnergyEvseManager(EndpointId(ENERGY_EVSE_ENDPOINT), *gDelegate, - BitMask( - EnergyEvse::Feature::kChargingPreferences, EnergyEvse::Feature::kPlugAndCharge, - EnergyEvse::Feature::kRfid, EnergyEvse::Feature::kSoCReporting, EnergyEvse::Feature::kV2x), - BitMask(OptionalAttributes::kSupportsUserMaximumChargingCurrent, - OptionalAttributes::kSupportsRandomizationWindow, - OptionalAttributes::kSupportsApproximateEvEfficiency), - BitMask(OptionalCommands::kSupportsStartDiagnostics)); - - if (gInstance == nullptr) + gInstance = std::make_unique( + EndpointId(ENERGY_EVSE_ENDPOINT), *gDelegate, + BitMask(EnergyEvse::Feature::kChargingPreferences, EnergyEvse::Feature::kPlugAndCharge, + EnergyEvse::Feature::kRfid, EnergyEvse::Feature::kSoCReporting, + EnergyEvse::Feature::kV2x), + BitMask(OptionalAttributes::kSupportsUserMaximumChargingCurrent, + OptionalAttributes::kSupportsRandomizationWindow, + OptionalAttributes::kSupportsApproximateEvEfficiency), + BitMask(OptionalCommands::kSupportsStartDiagnostics)); + + if (!gInstance) { ChipLogError(AppServer, "Failed to allocate memory for EnergyEvseManager"); - delete gDelegate; - gDelegate = nullptr; + gDelegate.reset(); return; } @@ -84,22 +83,18 @@ void ApplicationInit() if (err != CHIP_NO_ERROR) { ChipLogError(AppServer, "Init failed on gInstance"); - delete gInstance; - delete gDelegate; - gInstance = nullptr; - gDelegate = nullptr; + gInstance.reset(); + gDelegate.reset(); return; } /* Now create EVSEManufacturer*/ - gEvseManufacturer = new EVSEManufacturer(gInstance); - if (gEvseManufacturer == nullptr) + gEvseManufacturer = std::make_unique(gInstance.get()); + if (!gEvseManufacturer) { ChipLogError(AppServer, "Failed to allocate memory for EvseManufacturer"); - delete gInstance; - delete gDelegate; - gInstance = nullptr; - gDelegate = nullptr; + gInstance.reset(); + gDelegate.reset(); return; } @@ -108,12 +103,9 @@ void ApplicationInit() if (err != CHIP_NO_ERROR) { ChipLogError(AppServer, "Init failed on gEvseManufacturer"); - delete gEvseManufacturer; - delete gInstance; - delete gDelegate; - gEvseManufacturer = nullptr; - gInstance = nullptr; - gDelegate = nullptr; + gEvseManufacturer.reset(); + gInstance.reset(); + gDelegate.reset(); return; } } @@ -123,17 +115,12 @@ void ApplicationShutdown() ChipLogDetail(AppServer, "Energy Management App: ApplicationShutdown()"); /* Shutdown the EVSEManufacturer*/ - gEvseManufacturer->Shutdown(); + if (gEvseManufacturer) + gEvseManufacturer->Shutdown(); /* Shutdown the Instance - deregister attribute & command handler */ - gInstance->Shutdown(); - - delete gEvseManufacturer; - delete gInstance; - delete gDelegate; - gEvseManufacturer = nullptr; - gInstance = nullptr; - gDelegate = nullptr; + if (gInstance) + gInstance->Shutdown(); } int main(int argc, char * argv[]) From 13f16a87259f6c3579c8e3fe8ba95337c8c12644 Mon Sep 17 00:00:00 2001 From: James Harrow Date: Sat, 13 Jan 2024 16:41:36 +0000 Subject: [PATCH 103/114] Fixing MISSPELL issues in README.md --- .github/.wordlist.txt | 2 + .../energy-management-app/linux/README.md | 44 ++++++++++--------- 2 files changed, 25 insertions(+), 21 deletions(-) diff --git a/.github/.wordlist.txt b/.github/.wordlist.txt index 44470a612f42c7..07f3df6b7a9822 100644 --- a/.github/.wordlist.txt +++ b/.github/.wordlist.txt @@ -519,8 +519,10 @@ EthyleneOxideConcentrationMeasurement EvalCode EvalCodeWithName EvalFrameDefault +EV EVB evk +EVSE exceptfds ExchangeContext exe diff --git a/examples/energy-management-app/linux/README.md b/examples/energy-management-app/linux/README.md index fbf2e83d730970..be4e265e45b37d 100644 --- a/examples/energy-management-app/linux/README.md +++ b/examples/energy-management-app/linux/README.md @@ -17,7 +17,7 @@ To cross-compile this example on x64 host and run on **NXP i.MX 8M Mini** - [Running the Complete Example on Raspberry Pi 4](#running-the-complete-example-on-raspberry-pi-4) - [Running RPC Console](#running-rpc-console) - [Device Tracing](#device-tracing) - - [Python TestCases](#python-testcases) + - [Python Test Cases](#python-test-cases) - [Running the test cases:](#running-the-test-cases) - [CHIP-REPL Interaction](#chip-repl-interaction) - [Building chip-repl:](#building-chip-repl) @@ -149,7 +149,7 @@ Obtain tracing json file. -o {OUTPUT_FILE} -t {ELF_FILE} {PIGWEED_REPO}/pw_trace_tokenized/pw_trace_protos/trace_rpc.proto ``` -## Python TestCases +## Python Test Cases When you want to test this cluster you can use chip-repl or chip-tool by hand. CHIP-REPL is slightly easier to interact with when dealing with some of the @@ -158,20 +158,20 @@ complex structures. There are several test scripts provided for EVSE (in [src/python_testing](src/python_testing)): -- TC_EEVSE_2_2: This validates the primary functionality -- TC_EEVSE_2_3: This validates Get/Set/Clear target commands -- TC_EEVSE_2_4: This validates Faults -- TC_EEVSE_2_5: This validates EVSE diagnostic command (optional) +- `TC_EEVSE_2_2`: This validates the primary functionality +- `TC_EEVSE_2_3`: This validates Get/Set/Clear target commands +- `TC_EEVSE_2_4`: This validates Faults +- `TC_EEVSE_2_5`: This validates EVSE diagnostic command (optional) -These scripts require the use of TestEventsTriggers via the GeneralDiagnostics -cluster on Endpoint 0. This requires an enableKey (16 bytes) and a set of -reserved int64_t TestEvent trigger codes. +These scripts require the use of Test Event Triggers via the GeneralDiagnostics +cluster on Endpoint 0. This requires an `enableKey` (16 bytes) and a set of +reserved int64_t test event trigger codes. By default the test event support is not enabled, and when compiling the example app you need to add `chip_enable_energy_evse_trigger=true` to the gn args. $ gn gen out/debug - $ ninja -C out/debug --args='chip_enable_energy_evse_trigger=true` + $ ninja -C out/debug --args='chip_enable_energy_evse_trigger=true' Once the application is built you also need to tell it at runtime what the chosen enable key is using the `--enable-key` command line option. @@ -292,10 +292,11 @@ Out[2]: subscription = await devCtrl.ReadAttribute(1234,[(1, chip.clusters.EnergyEvse)], reportInterval=reportingTimingParams) ``` -- Step 6: Send an EnableCharging command which lasts for 60 seconds The - EnableCharging takes an optional parameter which allows the charger to - automatically disable itself at some preset time in the future. Note that it - uses Epoch_s (which is from Jan 1 2000) which is a uint32_t in seconds. +- Step 6: Send an `EnableCharging` command which lasts for 60 seconds The + `EnableCharging` takes an optional `chargingEnabledUntil` parameter which + allows the charger to automatically disable itself at some preset time in + the future. Note that it uses Epoch_s (which is from Jan 1 2000) which is a + uint32_t in seconds. ```python from datetime import datetime, timezone, timedelta @@ -369,7 +370,7 @@ The test event triggers values can be found in: - 0x0099000000000000 - Simulates the EVSE being installed on a 32A supply - 0x0099000000000002 - Simulates the EVSE being plugged in (this should - generate an EVConnected event) + generate an `EVConnected` event) - 0x0099000000000004 - Simulates the EVSE requesting power To send a test event trigger to the app, use the following commands (in @@ -384,7 +385,7 @@ chip-repl): ``` -Now send the enable charging command (omit the chargingEnabledUntil arg this +Now send the enable charging command (omit the `chargingEnabledUntil` arg this time): ```python @@ -440,7 +441,7 @@ Now send the test event trigger to simulate the EV asking for demand: - We can see that the `EventNumber 65538` was sent when the vehicle was plugged in, and a new `sessionID=0` was created. -- We can also see that the EnergyTransferStarted was sent in +- We can also see that the `EnergyTransferStarted` was sent in `EventNumber 65539` What happens when we unplug the vehicle? @@ -494,13 +495,14 @@ When we re-read the events: ``` -- In `EventNumber 65540` we had an EnergyTransferStopped event with reason +- In `EventNumber 65540` we had an `EnergyTransferStopped` event with reason `kOther`. This was a rather abrupt end to a charging session (normally we would see the EVSE or EV decide to stop charging), but this demonstrates the cable being pulled out without a graceful charging shutdown. -- In `EventNumber 65541` we had an EvNotDetected event showing that the state - was `kPluggedInCharging` prior to the EV being not detected (normally in a - graceful shutdown this would be `kPluggedInNoDemand` or `kPluggedInDemand`). +- In `EventNumber 65541` we had an `EvNotDetected` event showing that the + state was `kPluggedInCharging` prior to the EV being not detected (normally + in a graceful shutdown this would be `kPluggedInNoDemand` or + `kPluggedInDemand`). From 0d64694c7d63aad41e53e25513883cb52690267d Mon Sep 17 00:00:00 2001 From: James Harrow Date: Sat, 13 Jan 2024 22:36:27 +0000 Subject: [PATCH 104/114] Small change missed in main.cpp missed in unique_ptr change. --- examples/energy-management-app/linux/main.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/examples/energy-management-app/linux/main.cpp b/examples/energy-management-app/linux/main.cpp index 093b35df3a774a..23ec97e267f45d 100644 --- a/examples/energy-management-app/linux/main.cpp +++ b/examples/energy-management-app/linux/main.cpp @@ -201,7 +201,7 @@ CHIP_ERROR EVSEManufacturerInit() { CHIP_ERROR err; - if (gEvseManufacturer != nullptr) + if (gEvseManufacturer) { ChipLogError(AppServer, "EvseManufacturer already exist."); return CHIP_ERROR_INCORRECT_STATE; From 1aed9757b19743ee0c26db6f52c4a2d4f8c559d4 Mon Sep 17 00:00:00 2001 From: James Harrow Date: Sat, 13 Jan 2024 22:51:58 +0000 Subject: [PATCH 105/114] Changed all-clusters app stubs to use unique_ptr style instead of new/delete. --- .../src/device-energy-management-stub.cpp | 25 +++++++--------- .../src/energy-evse-stub.cpp | 29 ++++++++++--------- 2 files changed, 26 insertions(+), 28 deletions(-) diff --git a/examples/all-clusters-app/all-clusters-common/src/device-energy-management-stub.cpp b/examples/all-clusters-app/all-clusters-common/src/device-energy-management-stub.cpp index 87758953441827..f06f1af2ca90e2 100644 --- a/examples/all-clusters-app/all-clusters-common/src/device-energy-management-stub.cpp +++ b/examples/all-clusters-app/all-clusters-common/src/device-energy-management-stub.cpp @@ -23,8 +23,8 @@ using namespace chip::app; using namespace chip::app::Clusters; using namespace chip::app::Clusters::DeviceEnergyManagement; -static DeviceEnergyManagementDelegate * gDelegate = nullptr; -static DeviceEnergyManagementManager * gInstance = nullptr; +static std::unique_ptr gDelegate; +static std::unique_ptr gInstance; void emberAfDeviceEnergyManagementClusterInitCallback(chip::EndpointId endpointId) { @@ -33,21 +33,21 @@ void emberAfDeviceEnergyManagementClusterInitCallback(chip::EndpointId endpointI CHIP_ERROR err; - if ((gDelegate != nullptr) || (gInstance != nullptr)) + if (gDelegate || gInstance) { ChipLogError(AppServer, "DEM Instance or Delegate already exist."); return; } - gDelegate = new DeviceEnergyManagementDelegate(); - if (gDelegate == nullptr) + gDelegate = std::make_unique(); + if (!gDelegate) { ChipLogError(AppServer, "Failed to allocate memory for DeviceEnergyManagementDelegate"); return; } /* Manufacturer may optionally not support all features, commands & attributes */ - gInstance = new DeviceEnergyManagementManager( + gInstance = std::make_unique( endpointId, *gDelegate, BitMask( DeviceEnergyManagement::Feature::kPowerForecastReporting, DeviceEnergyManagement::Feature::kStateForecastReporting, @@ -55,11 +55,10 @@ void emberAfDeviceEnergyManagementClusterInitCallback(chip::EndpointId endpointI BitMask(OptionalCommands::kSupportsModifyForecastRequest, OptionalCommands::kSupportsRequestConstraintBasedForecast)); - if (gInstance == nullptr) + if (!gInstance) { ChipLogError(AppServer, "Failed to allocate memory for DeviceEnergyManagementManager"); - delete gDelegate; - gDelegate = nullptr; + gDelegate.reset(); return; } @@ -67,10 +66,8 @@ void emberAfDeviceEnergyManagementClusterInitCallback(chip::EndpointId endpointI if (err != CHIP_NO_ERROR) { ChipLogError(AppServer, "Init failed on gInstance"); - delete gInstance; - delete gDelegate; - gInstance = nullptr; - gDelegate = nullptr; + gInstance.reset(); + gDelegate.reset(); return; } -} +} \ No newline at end of file diff --git a/examples/all-clusters-app/all-clusters-common/src/energy-evse-stub.cpp b/examples/all-clusters-app/all-clusters-common/src/energy-evse-stub.cpp index a0773de104c187..f9983d47883852 100644 --- a/examples/all-clusters-app/all-clusters-common/src/energy-evse-stub.cpp +++ b/examples/all-clusters-app/all-clusters-common/src/energy-evse-stub.cpp @@ -22,25 +22,26 @@ using namespace chip; using namespace chip::app::Clusters; using namespace chip::app::Clusters::EnergyEvse; -static EnergyEvseDelegate * gDelegate = nullptr; -static EnergyEvseManager * gInstance = nullptr; +static std::unique_ptr gDelegate; +static std::unique_ptr gInstance; void emberAfEnergyEvseClusterInitCallback(chip::EndpointId endpointId) { VerifyOrDie(endpointId == 1); // this cluster is only enabled for endpoint 1. - VerifyOrDie(gInstance == nullptr); - gDelegate = new EnergyEvseDelegate(); - if (gDelegate != nullptr) + VerifyOrDie(!gInstance); + + gDelegate = std::make_unique(); + if (gDelegate) { - gInstance = - new EnergyEvseManager(endpointId, *gDelegate, - BitMask( - EnergyEvse::Feature::kChargingPreferences, EnergyEvse::Feature::kPlugAndCharge, - EnergyEvse::Feature::kRfid, EnergyEvse::Feature::kSoCReporting, EnergyEvse::Feature::kV2x), - BitMask(OptionalAttributes::kSupportsUserMaximumChargingCurrent, - OptionalAttributes::kSupportsRandomizationWindow, - OptionalAttributes::kSupportsApproximateEvEfficiency), - BitMask(OptionalCommands::kSupportsStartDiagnostics)); + gInstance = std::make_unique( + endpointId, *gDelegate, + BitMask(EnergyEvse::Feature::kChargingPreferences, EnergyEvse::Feature::kPlugAndCharge, + EnergyEvse::Feature::kRfid, EnergyEvse::Feature::kSoCReporting, + EnergyEvse::Feature::kV2x), + BitMask(OptionalAttributes::kSupportsUserMaximumChargingCurrent, + OptionalAttributes::kSupportsRandomizationWindow, + OptionalAttributes::kSupportsApproximateEvEfficiency), + BitMask(OptionalCommands::kSupportsStartDiagnostics)); gInstance->Init(); /* Register Attribute & Command handlers */ } From 304cec11df23ae8336523cda975ca4fc3eafb600 Mon Sep 17 00:00:00 2001 From: James Harrow Date: Sat, 13 Jan 2024 22:58:19 +0000 Subject: [PATCH 106/114] Removed unhelpful comment --- .../device-energy-management-server.h | 4 ---- 1 file changed, 4 deletions(-) diff --git a/src/app/clusters/device-energy-management-server/device-energy-management-server.h b/src/app/clusters/device-energy-management-server/device-energy-management-server.h index ce9641104e5db4..7ab6a8aa60f306 100644 --- a/src/app/clusters/device-energy-management-server/device-energy-management-server.h +++ b/src/app/clusters/device-energy-management-server/device-energy-management-server.h @@ -37,10 +37,6 @@ using namespace chip::app::Clusters::DeviceEnergyManagement::Attributes; using chip::Protocols::InteractionModel::Status; -/** - * @brief Defines methods for implementing application-specific logic for this Cluster. - * - */ class Delegate { public: From e2c9b65b0dc52d68d7de4fc62edbc6e36b543386 Mon Sep 17 00:00:00 2001 From: "Restyled.io" Date: Sat, 13 Jan 2024 22:58:41 +0000 Subject: [PATCH 107/114] Restyled by whitespace --- .../all-clusters-common/src/device-energy-management-stub.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/examples/all-clusters-app/all-clusters-common/src/device-energy-management-stub.cpp b/examples/all-clusters-app/all-clusters-common/src/device-energy-management-stub.cpp index f06f1af2ca90e2..385c1cfa43c8ee 100644 --- a/examples/all-clusters-app/all-clusters-common/src/device-energy-management-stub.cpp +++ b/examples/all-clusters-app/all-clusters-common/src/device-energy-management-stub.cpp @@ -70,4 +70,4 @@ void emberAfDeviceEnergyManagementClusterInitCallback(chip::EndpointId endpointI gDelegate.reset(); return; } -} \ No newline at end of file +} From a1b379e79740c930175757c905ffe55b0227d032 Mon Sep 17 00:00:00 2001 From: James Harrow Date: Sat, 13 Jan 2024 23:46:26 +0000 Subject: [PATCH 108/114] Fixes #31061 Updated DEVICE_TYPE to 0x050C now this has been allocated --- .../linux/include/CHIPProjectAppConfig.h | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/examples/energy-management-app/linux/include/CHIPProjectAppConfig.h b/examples/energy-management-app/linux/include/CHIPProjectAppConfig.h index f22628d0f69def..e091fa9cf7c91c 100644 --- a/examples/energy-management-app/linux/include/CHIPProjectAppConfig.h +++ b/examples/energy-management-app/linux/include/CHIPProjectAppConfig.h @@ -32,15 +32,13 @@ #define CHIP_DEVICE_CONFIG_ENABLE_COMMISSIONER_DISCOVERY 0 -// Bulbs do not typically use this - enabled so we can use shell to discover commissioners #define CHIP_DEVICE_CONFIG_ENABLE_COMMISSIONER_DISCOVERY_CLIENT 1 #define CHIP_DEVICE_CONFIG_ENABLE_EXTENDED_DISCOVERY 1 #define CHIP_DEVICE_CONFIG_ENABLE_COMMISSIONABLE_DEVICE_TYPE 1 -// TODO We don’t have one yet - but we’d need to change this -#define CHIP_DEVICE_CONFIG_DEVICE_TYPE 257 // 0x0101 = 257 = Dimmable Bulb +#define CHIP_DEVICE_CONFIG_DEVICE_TYPE 0x050C // Energy EVSE #define CHIP_DEVICE_CONFIG_ENABLE_COMMISSIONABLE_DEVICE_NAME 1 From 495d3478e8edff6069936c1f3abc7f39f3d0d038 Mon Sep 17 00:00:00 2001 From: James Harrow Date: Mon, 15 Jan 2024 19:58:49 +0000 Subject: [PATCH 109/114] Small correction to description in test case. --- src/python_testing/TC_EEVSE_2_5.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/python_testing/TC_EEVSE_2_5.py b/src/python_testing/TC_EEVSE_2_5.py index 1a647c20e0bcef..34ca0151935f93 100644 --- a/src/python_testing/TC_EEVSE_2_5.py +++ b/src/python_testing/TC_EEVSE_2_5.py @@ -51,12 +51,12 @@ def steps_TC_EEVSE_2_5(self) -> list[TestStep]: TestStep("5", "TH sends command StartDiagnostics. Verify that command is rejected with Failure"), TestStep("6", "TH sends command Disable."), TestStep("6a", "TH reads from the DUT the State attribute. Verify value is 0x00 (NotPluggedIn)"), - TestStep("6b", "TH reads from the DUT the SupplyState attribute. Verify value is 0x04 (Disabled)"), + TestStep("6b", "TH reads from the DUT the SupplyState attribute. Verify value is 0x00 (Disabled)"), TestStep("7", "TH sends command StartDiagnostics. Verify that command is accepted with Success"), TestStep("7a", "TH reads from the DUT the SupplyState attribute. Verify value is 0x04 (DisabledDiagnostics)"), TestStep("8", "A few seconds later TH sends TestEventTrigger command to General Diagnostics Cluster on Endpoint 0 with EnableKey field set to PIXIT.EEVSE.TEST_EVENT_TRIGGER_KEY and EventTrigger field set to PIXIT.EEVSE.TEST_EVENT_TRIGGER for EVSE Diagnostics Complete Event"), TestStep("8a", "TH reads from the DUT the State attribute. Verify value is 0x00 (NotPluggedIn)"), - TestStep("8b", "TH reads from the DUT the SupplyState attribute. Verify value is 0x04 (Disabled)"), + TestStep("8b", "TH reads from the DUT the SupplyState attribute. Verify value is 0x00 (Disabled)"), TestStep("9", "TH sends TestEventTrigger command to General Diagnostics Cluster on Endpoint 0 with EnableKey field set to PIXIT.EEVSE.TEST_EVENT_TRIGGER_KEY and EventTrigger field set to PIXIT.EEVSE.TEST_EVENT_TRIGGER for Basic Functionality Test Event Clear."), ] From 69241b73791455b6713b857ff83dd4e447b8841b Mon Sep 17 00:00:00 2001 From: jamesharrow <93921463+jamesharrow@users.noreply.github.com> Date: Tue, 16 Jan 2024 19:06:27 +0000 Subject: [PATCH 110/114] Update examples/energy-management-app/energy-management-common/include/EnergyEvseDelegateImpl.h Co-authored-by: Boris Zbarsky --- .../energy-management-common/include/EnergyEvseDelegateImpl.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/examples/energy-management-app/energy-management-common/include/EnergyEvseDelegateImpl.h b/examples/energy-management-app/energy-management-common/include/EnergyEvseDelegateImpl.h index 8cf76f1b7a29bf..d27f35ee63201c 100644 --- a/examples/energy-management-app/energy-management-common/include/EnergyEvseDelegateImpl.h +++ b/examples/energy-management-app/energy-management-common/include/EnergyEvseDelegateImpl.h @@ -53,7 +53,7 @@ class EvseSession public: EvseSession(EndpointId aEndpoint) { mEndpointId = aEndpoint; } /** - * @brief This function samples the start-time, and energy meter to hold the session info + * @brief This function records the start time and provided energy meter values as part of the new session. * * @param chargingMeterValue - The current value of the energy meter (charging) in mWh * @param dischargingMeterValue - The current value of the energy meter (discharging) in mWh From 0c2a8cdf4c0b6605fdf807878ed9ce00f67fc30a Mon Sep 17 00:00:00 2001 From: jamesharrow <93921463+jamesharrow@users.noreply.github.com> Date: Tue, 16 Jan 2024 19:30:29 +0000 Subject: [PATCH 111/114] Touched file to retrigger restyled job --- .../energy-management-common/include/EVSECallbacks.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/examples/energy-management-app/energy-management-common/include/EVSECallbacks.h b/examples/energy-management-app/energy-management-common/include/EVSECallbacks.h index 15578405552d78..124326d1e260cf 100644 --- a/examples/energy-management-app/energy-management-common/include/EVSECallbacks.h +++ b/examples/energy-management-app/energy-management-common/include/EVSECallbacks.h @@ -30,7 +30,7 @@ using namespace chip::app::Clusters::EnergyEvse; * This is not specific to the EnergyEVSE cluster, but includes DeviceEnergyManagement * and potential future clusters. */ - + enum class EVSECallbackType : uint8_t { /* From fa454722179b2e682ae0f4bdd74777a9b656defe Mon Sep 17 00:00:00 2001 From: jamesharrow <93921463+jamesharrow@users.noreply.github.com> Date: Tue, 16 Jan 2024 19:32:11 +0000 Subject: [PATCH 112/114] Removed whitespace which was added to trigger restyled to rerun --- .../energy-management-common/include/EVSECallbacks.h | 1 - 1 file changed, 1 deletion(-) diff --git a/examples/energy-management-app/energy-management-common/include/EVSECallbacks.h b/examples/energy-management-app/energy-management-common/include/EVSECallbacks.h index 124326d1e260cf..7d288809952ee3 100644 --- a/examples/energy-management-app/energy-management-common/include/EVSECallbacks.h +++ b/examples/energy-management-app/energy-management-common/include/EVSECallbacks.h @@ -30,7 +30,6 @@ using namespace chip::app::Clusters::EnergyEvse; * This is not specific to the EnergyEVSE cluster, but includes DeviceEnergyManagement * and potential future clusters. */ - enum class EVSECallbackType : uint8_t { /* From 6c34314474d8d7b04e0c11439297590c221084ee Mon Sep 17 00:00:00 2001 From: James Harrow Date: Tue, 16 Jan 2024 21:58:26 +0000 Subject: [PATCH 113/114] Removed potentially unsafe code before merging into PR #30957 --- .../DeviceEnergyManagementDelegateImpl.cpp | 57 +------------------ 1 file changed, 2 insertions(+), 55 deletions(-) diff --git a/examples/energy-management-app/energy-management-common/src/DeviceEnergyManagementDelegateImpl.cpp b/examples/energy-management-app/energy-management-common/src/DeviceEnergyManagementDelegateImpl.cpp index 25a9afd6a766cc..4d4d9bf05bbdbb 100644 --- a/examples/energy-management-app/energy-management-common/src/DeviceEnergyManagementDelegateImpl.cpp +++ b/examples/energy-management-app/energy-management-common/src/DeviceEnergyManagementDelegateImpl.cpp @@ -332,66 +332,13 @@ CHIP_ERROR DeviceEnergyManagementDelegate::SetAbsMaxPower(int64_t newValue) CHIP_ERROR DeviceEnergyManagementDelegate::SetPowerAdjustmentCapability(PowerAdjustmentCapability::TypeInfo::Type powerAdjustmentCapability) { - if (powerAdjustmentCapability.IsNull()) - { - mPowerAdjustmentCapability.SetNull(); - ChipLogDetail(AppServer, "DEM: PowerAdjustmentCapability is null"); - } - else - { - auto src = powerAdjustmentCapability.Value(); - auto target = mPowerAdjustmentCapability.Value(); - auto size = src.size(); - - if (size > 8) - { - return CHIP_ERROR_BAD_REQUEST; - } - - target.reduce_size(0); - - for (size_t i = 0; i < size; i++) - { - const_cast(target[i]) = src[i]; - } - } - - MatterReportingAttributeChangeCallback(mEndpointId, DeviceEnergyManagement::Id, PowerAdjustmentCapability::Id); + // TODO see Issue #31147 return CHIP_NO_ERROR; } CHIP_ERROR DeviceEnergyManagementDelegate::SetForecast(DataModel::Nullable forecast) { - if (forecast.IsNull()) - { - mForecast.SetNull(); - ChipLogDetail(AppServer, "DEM: Forecast is null"); - } - else - { - auto src = forecast.Value(); - auto target = mForecast.Value(); - - target.forecastId++; - target.activeSlotNumber = src.activeSlotNumber; - target.startTime = src.startTime; - target.endTime = src.endTime; - target.earliestStartTime = src.earliestStartTime; - target.latestEndTime = src.latestEndTime; - target.isPauseable = src.isPauseable; - - auto slots = src.slots; - auto size = slots.size(); - target.slots.reduce_size(0); // clear them - - for (size_t i = 0; i < size; i++) - { - const_cast(target.slots[i]) = - slots[i]; // TODO: test if this works for optional/nullable stuff - } - } - - MatterReportingAttributeChangeCallback(mEndpointId, DeviceEnergyManagement::Id, Forecast::Id); + // TODO see Issue #31147 return CHIP_NO_ERROR; } From b2a8c1cf1f6086bfc9ff232f4b7422ce8fcda1ca Mon Sep 17 00:00:00 2001 From: James Harrow Date: Tue, 16 Jan 2024 22:09:46 +0000 Subject: [PATCH 114/114] Renamed variable and replaced auto with type so it is clearer to reader. --- .../device-energy-management-server.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/app/clusters/device-energy-management-server/device-energy-management-server.cpp b/src/app/clusters/device-energy-management-server/device-energy-management-server.cpp index eb63aa31da330f..bfe3cac5f2e89e 100644 --- a/src/app/clusters/device-energy-management-server/device-energy-management-server.cpp +++ b/src/app/clusters/device-energy-management-server/device-energy-management-server.cpp @@ -343,11 +343,11 @@ void Instance::HandleStartTimeAdjustRequest(HandlerContext & ctx, } /* Temporary variable to save keep calling .Value() on the Optional element */ - auto & earliestStartTimeOptional = forecast.earliestStartTime.Value(); + DataModel::Nullable & earliestStartTimeNullable = forecast.earliestStartTime.Value(); /* Latest End Time is optional & cannot be null - unlike earliestStartTime! */ latestEndTimeEpoch = forecast.latestEndTime.Value(); - if (earliestStartTimeOptional.IsNull()) + if (earliestStartTimeNullable.IsNull()) { System::Clock::Milliseconds64 cTMs; CHIP_ERROR err = System::SystemClock().GetClock_RealTimeMS(cTMs); @@ -372,7 +372,7 @@ void Instance::HandleStartTimeAdjustRequest(HandlerContext & ctx, } else { - earliestStartTimeEpoch = earliestStartTimeOptional.Value(); + earliestStartTimeEpoch = earliestStartTimeNullable.Value(); } duration = forecast.endTime - forecast.startTime; // the current entire forecast duration