From 1631804784c20a546ca4bacac849946bc895e030 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Damian=20Kr=C3=B3lik?=
<66667989+Damian-Nordic@users.noreply.github.com>
Date: Wed, 26 Jan 2022 16:58:33 +0100
Subject: [PATCH] [zcl] Generate Power Source cluster enums (#14307)
After some recent changes Power Source cluster enums are no
longer generated as they have no assigned cluster ID.
---
.../all-clusters-app.matter | 58 +++
.../door-lock-common/door-lock-app.matter | 58 +++
examples/lock-app/lock-common/lock-app.matter | 58 +++
examples/window-app/common/window-app.matter | 58 +++
.../data-model/chip/power-source-cluster.xml | 13 +-
.../data_model/controller-clusters.matter | 58 +++
.../chip/devicecontroller/ChipStructs.java | 75 +++
.../python/chip/clusters/Objects.py | 92 ++++
.../CHIP/zap-generated/CHIPCallbackBridge.mm | 416 +++++++++++++++
.../CHIPCallbackBridge_internal.h | 488 ++++++++++++++++++
.../CHIP/zap-generated/CHIPStructsObjc.h | 18 +
.../CHIP/zap-generated/CHIPStructsObjc.mm | 39 ++
.../zap-generated/cluster-objects.cpp | 122 +++++
.../zap-generated/cluster-objects.h | 144 ++++++
.../cluster/logging/DataModelLogger.cpp | 73 +++
.../cluster/logging/DataModelLogger.h | 6 +
16 files changed, 1775 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 a1a1d4914c0111..82132cdedaccdb 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
@@ -2179,6 +2179,64 @@ server cluster OperationalCredentials = 62 {
}
server cluster PowerSource = 47 {
+ enum BatChargeFaultType : ENUM8 {
+ kUnspecfied = 0;
+ kAmbientTooHot = 1;
+ kAmbientTooCold = 2;
+ kBatteryTooHot = 3;
+ kBatteryTooCold = 4;
+ kBatteryAbsent = 5;
+ kBatteryOverVoltage = 6;
+ kBatteryUnderVoltage = 7;
+ kChargerOverVoltage = 8;
+ kChargerUnderVoltage = 9;
+ kSafetyTimeout = 10;
+ }
+
+ enum BatChargeLevel : ENUM8 {
+ kOk = 0;
+ kWarning = 1;
+ kCritical = 2;
+ }
+
+ enum BatChargeState : ENUM8 {
+ kUnknown = 0;
+ kIsCharging = 1;
+ kIsAtFullCharge = 2;
+ kIsNotCharging = 3;
+ }
+
+ enum BatFaultType : ENUM8 {
+ kUnspecfied = 0;
+ kOverTemp = 1;
+ kUnderTemp = 2;
+ }
+
+ enum BatReplaceability : ENUM8 {
+ kUnspecified = 0;
+ kNotReplaceable = 1;
+ kUserReplaceable = 2;
+ kFactoryReplaceable = 3;
+ }
+
+ enum PowerSourceStatus : ENUM8 {
+ kUnspecfied = 0;
+ kActive = 1;
+ kStandby = 2;
+ kUnavailable = 3;
+ }
+
+ enum WiredCurrentType : ENUM8 {
+ kAc = 0;
+ kDc = 1;
+ }
+
+ enum WiredFaultType : ENUM8 {
+ kUnspecfied = 0;
+ kOverVoltage = 1;
+ kUnderVoltage = 2;
+ }
+
readonly attribute enum8 status = 0;
readonly attribute int8u order = 1;
readonly attribute char_string<60> description = 2;
diff --git a/examples/door-lock-app/door-lock-common/door-lock-app.matter b/examples/door-lock-app/door-lock-common/door-lock-app.matter
index ef93f7d527baaa..07cf64dea9adea 100644
--- a/examples/door-lock-app/door-lock-common/door-lock-app.matter
+++ b/examples/door-lock-app/door-lock-common/door-lock-app.matter
@@ -869,6 +869,64 @@ server cluster OperationalCredentials = 62 {
}
server cluster PowerSource = 47 {
+ enum BatChargeFaultType : ENUM8 {
+ kUnspecfied = 0;
+ kAmbientTooHot = 1;
+ kAmbientTooCold = 2;
+ kBatteryTooHot = 3;
+ kBatteryTooCold = 4;
+ kBatteryAbsent = 5;
+ kBatteryOverVoltage = 6;
+ kBatteryUnderVoltage = 7;
+ kChargerOverVoltage = 8;
+ kChargerUnderVoltage = 9;
+ kSafetyTimeout = 10;
+ }
+
+ enum BatChargeLevel : ENUM8 {
+ kOk = 0;
+ kWarning = 1;
+ kCritical = 2;
+ }
+
+ enum BatChargeState : ENUM8 {
+ kUnknown = 0;
+ kIsCharging = 1;
+ kIsAtFullCharge = 2;
+ kIsNotCharging = 3;
+ }
+
+ enum BatFaultType : ENUM8 {
+ kUnspecfied = 0;
+ kOverTemp = 1;
+ kUnderTemp = 2;
+ }
+
+ enum BatReplaceability : ENUM8 {
+ kUnspecified = 0;
+ kNotReplaceable = 1;
+ kUserReplaceable = 2;
+ kFactoryReplaceable = 3;
+ }
+
+ enum PowerSourceStatus : ENUM8 {
+ kUnspecfied = 0;
+ kActive = 1;
+ kStandby = 2;
+ kUnavailable = 3;
+ }
+
+ enum WiredCurrentType : ENUM8 {
+ kAc = 0;
+ kDc = 1;
+ }
+
+ enum WiredFaultType : ENUM8 {
+ kUnspecfied = 0;
+ kOverVoltage = 1;
+ kUnderVoltage = 2;
+ }
+
readonly attribute enum8 status = 0;
readonly attribute int8u order = 1;
readonly attribute char_string<60> description = 2;
diff --git a/examples/lock-app/lock-common/lock-app.matter b/examples/lock-app/lock-common/lock-app.matter
index d8432bb6335368..d885506c81fec8 100644
--- a/examples/lock-app/lock-common/lock-app.matter
+++ b/examples/lock-app/lock-common/lock-app.matter
@@ -565,6 +565,64 @@ server cluster OperationalCredentials = 62 {
}
server cluster PowerSource = 47 {
+ enum BatChargeFaultType : ENUM8 {
+ kUnspecfied = 0;
+ kAmbientTooHot = 1;
+ kAmbientTooCold = 2;
+ kBatteryTooHot = 3;
+ kBatteryTooCold = 4;
+ kBatteryAbsent = 5;
+ kBatteryOverVoltage = 6;
+ kBatteryUnderVoltage = 7;
+ kChargerOverVoltage = 8;
+ kChargerUnderVoltage = 9;
+ kSafetyTimeout = 10;
+ }
+
+ enum BatChargeLevel : ENUM8 {
+ kOk = 0;
+ kWarning = 1;
+ kCritical = 2;
+ }
+
+ enum BatChargeState : ENUM8 {
+ kUnknown = 0;
+ kIsCharging = 1;
+ kIsAtFullCharge = 2;
+ kIsNotCharging = 3;
+ }
+
+ enum BatFaultType : ENUM8 {
+ kUnspecfied = 0;
+ kOverTemp = 1;
+ kUnderTemp = 2;
+ }
+
+ enum BatReplaceability : ENUM8 {
+ kUnspecified = 0;
+ kNotReplaceable = 1;
+ kUserReplaceable = 2;
+ kFactoryReplaceable = 3;
+ }
+
+ enum PowerSourceStatus : ENUM8 {
+ kUnspecfied = 0;
+ kActive = 1;
+ kStandby = 2;
+ kUnavailable = 3;
+ }
+
+ enum WiredCurrentType : ENUM8 {
+ kAc = 0;
+ kDc = 1;
+ }
+
+ enum WiredFaultType : ENUM8 {
+ kUnspecfied = 0;
+ kOverVoltage = 1;
+ kUnderVoltage = 2;
+ }
+
readonly attribute enum8 status = 0;
readonly attribute int8u order = 1;
readonly attribute char_string<60> description = 2;
diff --git a/examples/window-app/common/window-app.matter b/examples/window-app/common/window-app.matter
index 49e636136033c2..1eb01c312a264d 100644
--- a/examples/window-app/common/window-app.matter
+++ b/examples/window-app/common/window-app.matter
@@ -551,6 +551,64 @@ server cluster OperationalCredentials = 62 {
}
server cluster PowerSource = 47 {
+ enum BatChargeFaultType : ENUM8 {
+ kUnspecfied = 0;
+ kAmbientTooHot = 1;
+ kAmbientTooCold = 2;
+ kBatteryTooHot = 3;
+ kBatteryTooCold = 4;
+ kBatteryAbsent = 5;
+ kBatteryOverVoltage = 6;
+ kBatteryUnderVoltage = 7;
+ kChargerOverVoltage = 8;
+ kChargerUnderVoltage = 9;
+ kSafetyTimeout = 10;
+ }
+
+ enum BatChargeLevel : ENUM8 {
+ kOk = 0;
+ kWarning = 1;
+ kCritical = 2;
+ }
+
+ enum BatChargeState : ENUM8 {
+ kUnknown = 0;
+ kIsCharging = 1;
+ kIsAtFullCharge = 2;
+ kIsNotCharging = 3;
+ }
+
+ enum BatFaultType : ENUM8 {
+ kUnspecfied = 0;
+ kOverTemp = 1;
+ kUnderTemp = 2;
+ }
+
+ enum BatReplaceability : ENUM8 {
+ kUnspecified = 0;
+ kNotReplaceable = 1;
+ kUserReplaceable = 2;
+ kFactoryReplaceable = 3;
+ }
+
+ enum PowerSourceStatus : ENUM8 {
+ kUnspecfied = 0;
+ kActive = 1;
+ kStandby = 2;
+ kUnavailable = 3;
+ }
+
+ enum WiredCurrentType : ENUM8 {
+ kAc = 0;
+ kDc = 1;
+ }
+
+ enum WiredFaultType : ENUM8 {
+ kUnspecfied = 0;
+ kOverVoltage = 1;
+ kUnderVoltage = 2;
+ }
+
readonly attribute enum8 status = 0;
readonly attribute int8u order = 1;
readonly attribute char_string<60> description = 2;
diff --git a/src/app/zap-templates/zcl/data-model/chip/power-source-cluster.xml b/src/app/zap-templates/zcl/data-model/chip/power-source-cluster.xml
index cc31b480ad0ee8..c3540b2bbb8d6c 100644
--- a/src/app/zap-templates/zcl/data-model/chip/power-source-cluster.xml
+++ b/src/app/zap-templates/zcl/data-model/chip/power-source-cluster.xml
@@ -83,7 +83,7 @@ limitations under the License.
-
+
@@ -91,18 +91,21 @@ limitations under the License.
+
+
+
@@ -117,6 +120,7 @@ limitations under the License.
+
@@ -124,17 +128,20 @@ limitations under the License.
+
+
+
@@ -142,6 +149,7 @@ limitations under the License.
+
@@ -149,16 +157,19 @@ limitations under the License.
+
+
+
diff --git a/src/controller/data_model/controller-clusters.matter b/src/controller/data_model/controller-clusters.matter
index 04ca0d00c4f6f8..2dadba8401a2e1 100644
--- a/src/controller/data_model/controller-clusters.matter
+++ b/src/controller/data_model/controller-clusters.matter
@@ -2402,6 +2402,64 @@ client cluster OperationalCredentials = 62 {
}
client cluster PowerSource = 47 {
+ enum BatChargeFaultType : ENUM8 {
+ kUnspecfied = 0;
+ kAmbientTooHot = 1;
+ kAmbientTooCold = 2;
+ kBatteryTooHot = 3;
+ kBatteryTooCold = 4;
+ kBatteryAbsent = 5;
+ kBatteryOverVoltage = 6;
+ kBatteryUnderVoltage = 7;
+ kChargerOverVoltage = 8;
+ kChargerUnderVoltage = 9;
+ kSafetyTimeout = 10;
+ }
+
+ enum BatChargeLevel : ENUM8 {
+ kOk = 0;
+ kWarning = 1;
+ kCritical = 2;
+ }
+
+ enum BatChargeState : ENUM8 {
+ kUnknown = 0;
+ kIsCharging = 1;
+ kIsAtFullCharge = 2;
+ kIsNotCharging = 3;
+ }
+
+ enum BatFaultType : ENUM8 {
+ kUnspecfied = 0;
+ kOverTemp = 1;
+ kUnderTemp = 2;
+ }
+
+ enum BatReplaceability : ENUM8 {
+ kUnspecified = 0;
+ kNotReplaceable = 1;
+ kUserReplaceable = 2;
+ kFactoryReplaceable = 3;
+ }
+
+ enum PowerSourceStatus : ENUM8 {
+ kUnspecfied = 0;
+ kActive = 1;
+ kStandby = 2;
+ kUnavailable = 3;
+ }
+
+ enum WiredCurrentType : ENUM8 {
+ kAc = 0;
+ kDc = 1;
+ }
+
+ enum WiredFaultType : ENUM8 {
+ kUnspecfied = 0;
+ kOverVoltage = 1;
+ kUnderVoltage = 2;
+ }
+
readonly attribute enum8 status = 0;
readonly attribute int8u order = 1;
readonly attribute char_string<60> description = 2;
diff --git a/src/controller/java/zap-generated/chip/devicecontroller/ChipStructs.java b/src/controller/java/zap-generated/chip/devicecontroller/ChipStructs.java
index 396e8e05d63f61..d0070debbd91c8 100644
--- a/src/controller/java/zap-generated/chip/devicecontroller/ChipStructs.java
+++ b/src/controller/java/zap-generated/chip/devicecontroller/ChipStructs.java
@@ -1201,6 +1201,81 @@ public String toString() {
}
}
+ public static class PowerSourceClusterBatChargeFaultChangeType {
+ public ArrayList