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 754985f37dd4f4..2999f27a55bdb4 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 @@ -862,6 +862,21 @@ server cluster PowerSource = 47 { kReplaceable = 0x8; } + info event WiredFaultChange = 0 { + WiredFault current[] = 0; + WiredFault previous[] = 1; + } + + info event BatFaultChange = 1 { + BatFault current[] = 0; + BatFault previous[] = 1; + } + + info event BatChargeFaultChange = 2 { + BatChargeFault current[] = 0; + BatChargeFault previous[] = 1; + } + readonly attribute PowerSourceStatus status = 0; readonly attribute int8u order = 1; readonly attribute char_string<60> description = 2; diff --git a/examples/all-clusters-minimal-app/all-clusters-common/all-clusters-minimal-app.matter b/examples/all-clusters-minimal-app/all-clusters-common/all-clusters-minimal-app.matter index 58e0c12b20d3e9..0ea0a312a80a70 100644 --- a/examples/all-clusters-minimal-app/all-clusters-common/all-clusters-minimal-app.matter +++ b/examples/all-clusters-minimal-app/all-clusters-common/all-clusters-minimal-app.matter @@ -794,6 +794,21 @@ server cluster PowerSource = 47 { kReplaceable = 0x8; } + info event WiredFaultChange = 0 { + WiredFault current[] = 0; + WiredFault previous[] = 1; + } + + info event BatFaultChange = 1 { + BatFault current[] = 0; + BatFault previous[] = 1; + } + + info event BatChargeFaultChange = 2 { + BatChargeFault current[] = 0; + BatChargeFault previous[] = 1; + } + readonly attribute PowerSourceStatus 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 72510069747932..283c91d72fed46 100644 --- a/examples/lock-app/lock-common/lock-app.matter +++ b/examples/lock-app/lock-common/lock-app.matter @@ -455,6 +455,21 @@ server cluster PowerSource = 47 { kReplaceable = 0x8; } + info event WiredFaultChange = 0 { + WiredFault current[] = 0; + WiredFault previous[] = 1; + } + + info event BatFaultChange = 1 { + BatFault current[] = 0; + BatFault previous[] = 1; + } + + info event BatChargeFaultChange = 2 { + BatChargeFault current[] = 0; + BatChargeFault previous[] = 1; + } + readonly attribute PowerSourceStatus status = 0; readonly attribute int8u order = 1; readonly attribute char_string<60> description = 2; diff --git a/examples/placeholder/linux/apps/app1/config.matter b/examples/placeholder/linux/apps/app1/config.matter index 383b1096765494..4ad37a9e6f581b 100644 --- a/examples/placeholder/linux/apps/app1/config.matter +++ b/examples/placeholder/linux/apps/app1/config.matter @@ -627,6 +627,21 @@ server cluster PowerSource = 47 { kReplaceable = 0x8; } + info event WiredFaultChange = 0 { + WiredFault current[] = 0; + WiredFault previous[] = 1; + } + + info event BatFaultChange = 1 { + BatFault current[] = 0; + BatFault previous[] = 1; + } + + info event BatChargeFaultChange = 2 { + BatChargeFault current[] = 0; + BatChargeFault previous[] = 1; + } + readonly attribute PowerSourceStatus status = 0; readonly attribute int8u order = 1; readonly attribute char_string<60> description = 2; diff --git a/examples/placeholder/linux/apps/app2/config.matter b/examples/placeholder/linux/apps/app2/config.matter index 383b1096765494..4ad37a9e6f581b 100644 --- a/examples/placeholder/linux/apps/app2/config.matter +++ b/examples/placeholder/linux/apps/app2/config.matter @@ -627,6 +627,21 @@ server cluster PowerSource = 47 { kReplaceable = 0x8; } + info event WiredFaultChange = 0 { + WiredFault current[] = 0; + WiredFault previous[] = 1; + } + + info event BatFaultChange = 1 { + BatFault current[] = 0; + BatFault previous[] = 1; + } + + info event BatChargeFaultChange = 2 { + BatChargeFault current[] = 0; + BatChargeFault previous[] = 1; + } + readonly attribute PowerSourceStatus 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 578b658092fabc..cd0a0e789a10de 100644 --- a/examples/window-app/common/window-app.matter +++ b/examples/window-app/common/window-app.matter @@ -617,6 +617,21 @@ server cluster PowerSource = 47 { kReplaceable = 0x8; } + info event WiredFaultChange = 0 { + WiredFault current[] = 0; + WiredFault previous[] = 1; + } + + info event BatFaultChange = 1 { + BatFault current[] = 0; + BatFault previous[] = 1; + } + + info event BatChargeFaultChange = 2 { + BatChargeFault current[] = 0; + BatChargeFault previous[] = 1; + } + readonly attribute PowerSourceStatus 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 28ba55b9f30983..76b350a52bf239 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 @@ -59,22 +59,23 @@ limitations under the License. BatChargingCurrent ActiveBatChargeFaults - @@ -131,7 +132,7 @@ limitations under the License. - + @@ -152,6 +153,8 @@ limitations under the License. + @@ -170,4 +173,4 @@ limitations under the License. - \ No newline at end of file + diff --git a/src/controller/data_model/controller-clusters.matter b/src/controller/data_model/controller-clusters.matter index d3ce74301608c7..4de517ed5d514e 100644 --- a/src/controller/data_model/controller-clusters.matter +++ b/src/controller/data_model/controller-clusters.matter @@ -995,6 +995,21 @@ client cluster PowerSource = 47 { kReplaceable = 0x8; } + info event WiredFaultChange = 0 { + WiredFault current[] = 0; + WiredFault previous[] = 1; + } + + info event BatFaultChange = 1 { + BatFault current[] = 0; + BatFault previous[] = 1; + } + + info event BatChargeFaultChange = 2 { + BatChargeFault current[] = 0; + BatChargeFault previous[] = 1; + } + readonly attribute PowerSourceStatus status = 0; readonly attribute int8u order = 1; readonly attribute char_string<60> description = 2; diff --git a/src/controller/java/zap-generated/CHIPEventTLVValueDecoder.cpp b/src/controller/java/zap-generated/CHIPEventTLVValueDecoder.cpp index d8b949d64e8a8c..8313fe238777cc 100644 --- a/src/controller/java/zap-generated/CHIPEventTLVValueDecoder.cpp +++ b/src/controller/java/zap-generated/CHIPEventTLVValueDecoder.cpp @@ -967,6 +967,179 @@ jobject DecodeEventValue(const app::ConcreteEventPath & aPath, TLV::TLVReader & using namespace app::Clusters::PowerSource; switch (aPath.mEventId) { + case Events::WiredFaultChange::Id: { + Events::WiredFaultChange::DecodableType cppValue; + *aError = app::DataModel::Decode(aReader, cppValue); + if (*aError != CHIP_NO_ERROR) + { + return nullptr; + } + jobject value_current; + chip::JniReferences::GetInstance().CreateArrayList(value_current); + + auto iter_value_current_0 = cppValue.current.begin(); + while (iter_value_current_0.Next()) + { + auto & entry_0 = iter_value_current_0.GetValue(); + jobject newElement_0; + std::string newElement_0ClassName = "java/lang/Integer"; + std::string newElement_0CtorSignature = "(I)V"; + chip::JniReferences::GetInstance().CreateBoxedObject( + newElement_0ClassName.c_str(), newElement_0CtorSignature.c_str(), static_cast(entry_0), newElement_0); + chip::JniReferences::GetInstance().AddToList(value_current, newElement_0); + } + + jobject value_previous; + chip::JniReferences::GetInstance().CreateArrayList(value_previous); + + auto iter_value_previous_0 = cppValue.previous.begin(); + while (iter_value_previous_0.Next()) + { + auto & entry_0 = iter_value_previous_0.GetValue(); + jobject newElement_0; + std::string newElement_0ClassName = "java/lang/Integer"; + std::string newElement_0CtorSignature = "(I)V"; + chip::JniReferences::GetInstance().CreateBoxedObject( + newElement_0ClassName.c_str(), newElement_0CtorSignature.c_str(), static_cast(entry_0), newElement_0); + chip::JniReferences::GetInstance().AddToList(value_previous, newElement_0); + } + + jclass wiredFaultChangeStructClass; + err = chip::JniReferences::GetInstance().GetClassRef( + env, "chip/devicecontroller/ChipEventStructs$PowerSourceClusterWiredFaultChangeEvent", wiredFaultChangeStructClass); + if (err != CHIP_NO_ERROR) + { + ChipLogError(Zcl, "Could not find class ChipEventStructs$PowerSourceClusterWiredFaultChangeEvent"); + return nullptr; + } + jmethodID wiredFaultChangeStructCtor = + env->GetMethodID(wiredFaultChangeStructClass, "", "(Ljava/util/ArrayList;Ljava/util/ArrayList;)V"); + if (wiredFaultChangeStructCtor == nullptr) + { + ChipLogError(Zcl, "Could not find ChipEventStructs$PowerSourceClusterWiredFaultChangeEvent constructor"); + return nullptr; + } + + jobject value = env->NewObject(wiredFaultChangeStructClass, wiredFaultChangeStructCtor, value_current, value_previous); + + return value; + } + case Events::BatFaultChange::Id: { + Events::BatFaultChange::DecodableType cppValue; + *aError = app::DataModel::Decode(aReader, cppValue); + if (*aError != CHIP_NO_ERROR) + { + return nullptr; + } + jobject value_current; + chip::JniReferences::GetInstance().CreateArrayList(value_current); + + auto iter_value_current_0 = cppValue.current.begin(); + while (iter_value_current_0.Next()) + { + auto & entry_0 = iter_value_current_0.GetValue(); + jobject newElement_0; + std::string newElement_0ClassName = "java/lang/Integer"; + std::string newElement_0CtorSignature = "(I)V"; + chip::JniReferences::GetInstance().CreateBoxedObject( + newElement_0ClassName.c_str(), newElement_0CtorSignature.c_str(), static_cast(entry_0), newElement_0); + chip::JniReferences::GetInstance().AddToList(value_current, newElement_0); + } + + jobject value_previous; + chip::JniReferences::GetInstance().CreateArrayList(value_previous); + + auto iter_value_previous_0 = cppValue.previous.begin(); + while (iter_value_previous_0.Next()) + { + auto & entry_0 = iter_value_previous_0.GetValue(); + jobject newElement_0; + std::string newElement_0ClassName = "java/lang/Integer"; + std::string newElement_0CtorSignature = "(I)V"; + chip::JniReferences::GetInstance().CreateBoxedObject( + newElement_0ClassName.c_str(), newElement_0CtorSignature.c_str(), static_cast(entry_0), newElement_0); + chip::JniReferences::GetInstance().AddToList(value_previous, newElement_0); + } + + jclass batFaultChangeStructClass; + err = chip::JniReferences::GetInstance().GetClassRef( + env, "chip/devicecontroller/ChipEventStructs$PowerSourceClusterBatFaultChangeEvent", batFaultChangeStructClass); + if (err != CHIP_NO_ERROR) + { + ChipLogError(Zcl, "Could not find class ChipEventStructs$PowerSourceClusterBatFaultChangeEvent"); + return nullptr; + } + jmethodID batFaultChangeStructCtor = + env->GetMethodID(batFaultChangeStructClass, "", "(Ljava/util/ArrayList;Ljava/util/ArrayList;)V"); + if (batFaultChangeStructCtor == nullptr) + { + ChipLogError(Zcl, "Could not find ChipEventStructs$PowerSourceClusterBatFaultChangeEvent constructor"); + return nullptr; + } + + jobject value = env->NewObject(batFaultChangeStructClass, batFaultChangeStructCtor, value_current, value_previous); + + return value; + } + case Events::BatChargeFaultChange::Id: { + Events::BatChargeFaultChange::DecodableType cppValue; + *aError = app::DataModel::Decode(aReader, cppValue); + if (*aError != CHIP_NO_ERROR) + { + return nullptr; + } + jobject value_current; + chip::JniReferences::GetInstance().CreateArrayList(value_current); + + auto iter_value_current_0 = cppValue.current.begin(); + while (iter_value_current_0.Next()) + { + auto & entry_0 = iter_value_current_0.GetValue(); + jobject newElement_0; + std::string newElement_0ClassName = "java/lang/Integer"; + std::string newElement_0CtorSignature = "(I)V"; + chip::JniReferences::GetInstance().CreateBoxedObject( + newElement_0ClassName.c_str(), newElement_0CtorSignature.c_str(), static_cast(entry_0), newElement_0); + chip::JniReferences::GetInstance().AddToList(value_current, newElement_0); + } + + jobject value_previous; + chip::JniReferences::GetInstance().CreateArrayList(value_previous); + + auto iter_value_previous_0 = cppValue.previous.begin(); + while (iter_value_previous_0.Next()) + { + auto & entry_0 = iter_value_previous_0.GetValue(); + jobject newElement_0; + std::string newElement_0ClassName = "java/lang/Integer"; + std::string newElement_0CtorSignature = "(I)V"; + chip::JniReferences::GetInstance().CreateBoxedObject( + newElement_0ClassName.c_str(), newElement_0CtorSignature.c_str(), static_cast(entry_0), newElement_0); + chip::JniReferences::GetInstance().AddToList(value_previous, newElement_0); + } + + jclass batChargeFaultChangeStructClass; + err = chip::JniReferences::GetInstance().GetClassRef( + env, "chip/devicecontroller/ChipEventStructs$PowerSourceClusterBatChargeFaultChangeEvent", + batChargeFaultChangeStructClass); + if (err != CHIP_NO_ERROR) + { + ChipLogError(Zcl, "Could not find class ChipEventStructs$PowerSourceClusterBatChargeFaultChangeEvent"); + return nullptr; + } + jmethodID batChargeFaultChangeStructCtor = + env->GetMethodID(batChargeFaultChangeStructClass, "", "(Ljava/util/ArrayList;Ljava/util/ArrayList;)V"); + if (batChargeFaultChangeStructCtor == nullptr) + { + ChipLogError(Zcl, "Could not find ChipEventStructs$PowerSourceClusterBatChargeFaultChangeEvent constructor"); + return nullptr; + } + + jobject value = + env->NewObject(batChargeFaultChangeStructClass, batChargeFaultChangeStructCtor, value_current, value_previous); + + return value; + } default: *aError = CHIP_ERROR_IM_MALFORMED_EVENT_PATH_IB; break; diff --git a/src/controller/java/zap-generated/chip/devicecontroller/ChipEventStructs.java b/src/controller/java/zap-generated/chip/devicecontroller/ChipEventStructs.java index fe77f3667f8c89..2040b030738a89 100644 --- a/src/controller/java/zap-generated/chip/devicecontroller/ChipEventStructs.java +++ b/src/controller/java/zap-generated/chip/devicecontroller/ChipEventStructs.java @@ -347,6 +347,81 @@ public String toString() { } } + public static class PowerSourceClusterWiredFaultChangeEvent { + public ArrayList current; + public ArrayList previous; + + public PowerSourceClusterWiredFaultChangeEvent( + ArrayList current, ArrayList previous) { + this.current = current; + this.previous = previous; + } + + @Override + public String toString() { + StringBuilder output = new StringBuilder(); + output.append("PowerSourceClusterWiredFaultChangeEvent {\n"); + output.append("\tcurrent: "); + output.append(current); + output.append("\n"); + output.append("\tprevious: "); + output.append(previous); + output.append("\n"); + output.append("}\n"); + return output.toString(); + } + } + + public static class PowerSourceClusterBatFaultChangeEvent { + public ArrayList current; + public ArrayList previous; + + public PowerSourceClusterBatFaultChangeEvent( + ArrayList current, ArrayList previous) { + this.current = current; + this.previous = previous; + } + + @Override + public String toString() { + StringBuilder output = new StringBuilder(); + output.append("PowerSourceClusterBatFaultChangeEvent {\n"); + output.append("\tcurrent: "); + output.append(current); + output.append("\n"); + output.append("\tprevious: "); + output.append(previous); + output.append("\n"); + output.append("}\n"); + return output.toString(); + } + } + + public static class PowerSourceClusterBatChargeFaultChangeEvent { + public ArrayList current; + public ArrayList previous; + + public PowerSourceClusterBatChargeFaultChangeEvent( + ArrayList current, ArrayList previous) { + this.current = current; + this.previous = previous; + } + + @Override + public String toString() { + StringBuilder output = new StringBuilder(); + output.append("PowerSourceClusterBatChargeFaultChangeEvent {\n"); + output.append("\tcurrent: "); + output.append(current); + output.append("\n"); + output.append("\tprevious: "); + output.append(previous); + output.append("\n"); + output.append("}\n"); + return output.toString(); + } + } + public static class GeneralDiagnosticsClusterHardwareFaultChangeEvent { public ArrayList current; public ArrayList previous; diff --git a/src/controller/java/zap-generated/chip/devicecontroller/ChipIdLookup.java b/src/controller/java/zap-generated/chip/devicecontroller/ChipIdLookup.java index 0bcad38c702c69..195215f6e8f56d 100644 --- a/src/controller/java/zap-generated/chip/devicecontroller/ChipIdLookup.java +++ b/src/controller/java/zap-generated/chip/devicecontroller/ChipIdLookup.java @@ -3183,6 +3183,15 @@ public static String eventIdToName(long clusterId, long eventId) { return ""; } if (clusterId == 47L) { + if (eventId == 0L) { + return "WiredFaultChange"; + } + if (eventId == 1L) { + return "BatFaultChange"; + } + if (eventId == 2L) { + return "BatChargeFaultChange"; + } return ""; } if (clusterId == 48L) { diff --git a/src/controller/python/chip/clusters/Objects.py b/src/controller/python/chip/clusters/Objects.py index a72378c2f393b3..6dea0ef9539d5d 100644 --- a/src/controller/python/chip/clusters/Objects.py +++ b/src/controller/python/chip/clusters/Objects.py @@ -6171,6 +6171,70 @@ def attribute_type(cls) -> ClusterObjectFieldDescriptor: value: 'uint' = 0 + class Events: + @dataclass + class WiredFaultChange(ClusterEvent): + @ChipUtility.classproperty + def cluster_id(cls) -> int: + return 0x002F + + @ChipUtility.classproperty + def event_id(cls) -> int: + return 0x00000000 + + @ChipUtility.classproperty + def descriptor(cls) -> ClusterObjectDescriptor: + return ClusterObjectDescriptor( + Fields = [ + ClusterObjectFieldDescriptor(Label="current", Tag=0, Type=typing.List[PowerSource.Enums.WiredFault]), + ClusterObjectFieldDescriptor(Label="previous", Tag=1, Type=typing.List[PowerSource.Enums.WiredFault]), + ]) + + current: 'typing.List[PowerSource.Enums.WiredFault]' = field(default_factory=lambda: []) + previous: 'typing.List[PowerSource.Enums.WiredFault]' = field(default_factory=lambda: []) + + @dataclass + class BatFaultChange(ClusterEvent): + @ChipUtility.classproperty + def cluster_id(cls) -> int: + return 0x002F + + @ChipUtility.classproperty + def event_id(cls) -> int: + return 0x00000001 + + @ChipUtility.classproperty + def descriptor(cls) -> ClusterObjectDescriptor: + return ClusterObjectDescriptor( + Fields = [ + ClusterObjectFieldDescriptor(Label="current", Tag=0, Type=typing.List[PowerSource.Enums.BatFault]), + ClusterObjectFieldDescriptor(Label="previous", Tag=1, Type=typing.List[PowerSource.Enums.BatFault]), + ]) + + current: 'typing.List[PowerSource.Enums.BatFault]' = field(default_factory=lambda: []) + previous: 'typing.List[PowerSource.Enums.BatFault]' = field(default_factory=lambda: []) + + @dataclass + class BatChargeFaultChange(ClusterEvent): + @ChipUtility.classproperty + def cluster_id(cls) -> int: + return 0x002F + + @ChipUtility.classproperty + def event_id(cls) -> int: + return 0x00000002 + + @ChipUtility.classproperty + def descriptor(cls) -> ClusterObjectDescriptor: + return ClusterObjectDescriptor( + Fields = [ + ClusterObjectFieldDescriptor(Label="current", Tag=0, Type=typing.List[PowerSource.Enums.BatChargeFault]), + ClusterObjectFieldDescriptor(Label="previous", Tag=1, Type=typing.List[PowerSource.Enums.BatChargeFault]), + ]) + + current: 'typing.List[PowerSource.Enums.BatChargeFault]' = field(default_factory=lambda: []) + previous: 'typing.List[PowerSource.Enums.BatChargeFault]' = field(default_factory=lambda: []) + @dataclass class GeneralCommissioning(Cluster): diff --git a/src/darwin/Framework/CHIP/templates/availability.yaml b/src/darwin/Framework/CHIP/templates/availability.yaml index 010bddd35779d5..bc301ada0ea09e 100644 --- a/src/darwin/Framework/CHIP/templates/availability.yaml +++ b/src/darwin/Framework/CHIP/templates/availability.yaml @@ -5043,6 +5043,10 @@ - ShutDown - Leave - ReachableChanged + PowerSource: + - WiredFaultChange + - BatFaultChange + - BatChargeFaultChange event fields: Switch: MultiPressComplete: @@ -5078,6 +5082,16 @@ - fabricIndex ReachableChanged: - reachableNewValue + PowerSource: + WiredFaultChange: + - current + - previous + BatFaultChange: + - current + - previous + BatChargeFaultChange: + - current + - previous enums: OTASoftwareUpdateProvider: - OTAApplyUpdateAction @@ -5149,6 +5163,9 @@ - PASE - CASE - Group + PowerSource: + BatChargeLevel: + - OK bitmaps: UnitTesting: - Bitmap8MaskMap @@ -5229,6 +5246,10 @@ AccessControl: - AccessControlEntry - ExtensionEntry + PowerSource: + - WiredFaultChangeType + - BatFaultChangeType + - BatChargeFaultChangeType struct fields: Descriptor: DeviceTypeStruct: @@ -5245,6 +5266,9 @@ GeneralCommissioning: CommissioningError: - Ok + PowerSource: + BatChargeLevel: + - Ok apis: - Timed Invoke for server to client commands - Deprecated global attribute names @@ -5320,3 +5344,6 @@ GeneralCommissioning: CommissioningError: OK: Ok + PowerSource: + BatChargeLevel: + OK: Ok diff --git a/src/darwin/Framework/CHIP/zap-generated/MTRBaseClusters.h b/src/darwin/Framework/CHIP/zap-generated/MTRBaseClusters.h index c433a209131c12..7999ed99518178 100644 --- a/src/darwin/Framework/CHIP/zap-generated/MTRBaseClusters.h +++ b/src/darwin/Framework/CHIP/zap-generated/MTRBaseClusters.h @@ -17416,7 +17416,10 @@ typedef NS_ENUM(uint8_t, MTRPowerSourceBatChargeFault) { } API_AVAILABLE(ios(16.1), macos(13.0), watchos(9.1), tvos(16.1)); typedef NS_ENUM(uint8_t, MTRPowerSourceBatChargeLevel) { - MTRPowerSourceBatChargeLevelOk API_AVAILABLE(ios(16.1), macos(13.0), watchos(9.1), tvos(16.1)) = 0x00, + MTRPowerSourceBatChargeLevelOK MTR_NEWLY_AVAILABLE = 0x00, + MTRPowerSourceBatChargeLevelOk API_AVAILABLE(ios(16.1), macos(13.0), watchos(9.1), tvos(16.1)) + MTR_NEWLY_DEPRECATED("Please use MTRPowerSourceBatChargeLevelOK") + = 0x00, MTRPowerSourceBatChargeLevelWarning API_AVAILABLE(ios(16.1), macos(13.0), watchos(9.1), tvos(16.1)) = 0x01, MTRPowerSourceBatChargeLevelCritical API_AVAILABLE(ios(16.1), macos(13.0), watchos(9.1), tvos(16.1)) = 0x02, } API_AVAILABLE(ios(16.1), macos(13.0), watchos(9.1), tvos(16.1)); diff --git a/src/darwin/Framework/CHIP/zap-generated/MTRClusterConstants.h b/src/darwin/Framework/CHIP/zap-generated/MTRClusterConstants.h index 53942f6a40012c..bdc6ae0152ada0 100644 --- a/src/darwin/Framework/CHIP/zap-generated/MTRClusterConstants.h +++ b/src/darwin/Framework/CHIP/zap-generated/MTRClusterConstants.h @@ -6821,6 +6821,13 @@ typedef NS_ENUM(uint32_t, MTREventIDType) { MTREventIDTypeClusterOTASoftwareUpdateRequestorEventVersionAppliedID MTR_NEWLY_AVAILABLE = 0x00000001, MTREventIDTypeClusterOTASoftwareUpdateRequestorEventDownloadErrorID MTR_NEWLY_AVAILABLE = 0x00000002, + // Cluster PowerSource deprecated event names + + // Cluster PowerSource events + MTREventIDTypeClusterPowerSourceEventWiredFaultChangeID MTR_NEWLY_AVAILABLE = 0x00000000, + MTREventIDTypeClusterPowerSourceEventBatFaultChangeID MTR_NEWLY_AVAILABLE = 0x00000001, + MTREventIDTypeClusterPowerSourceEventBatChargeFaultChangeID MTR_NEWLY_AVAILABLE = 0x00000002, + // Cluster GeneralDiagnostics deprecated event names MTRClusterGeneralDiagnosticsEventHardwareFaultChangeID API_AVAILABLE(ios(16.1), macos(13.0), watchos(9.1), tvos(16.1)) MTR_NEWLY_DEPRECATED("Please use MTREventIDTypeClusterGeneralDiagnosticsEventHardwareFaultChangeID") diff --git a/src/darwin/Framework/CHIP/zap-generated/MTREventTLVValueDecoder.mm b/src/darwin/Framework/CHIP/zap-generated/MTREventTLVValueDecoder.mm index 8e5f792ae28582..a2fa781704a557 100644 --- a/src/darwin/Framework/CHIP/zap-generated/MTREventTLVValueDecoder.mm +++ b/src/darwin/Framework/CHIP/zap-generated/MTREventTLVValueDecoder.mm @@ -610,6 +610,165 @@ id MTRDecodeEventPayload(const ConcreteEventPath & aPath, TLV::TLVReader & aRead using namespace Clusters::PowerSource; switch (aPath.mEventId) { + case Events::WiredFaultChange::Id: { + Events::WiredFaultChange::DecodableType cppValue; + *aError = DataModel::Decode(aReader, cppValue); + if (*aError != CHIP_NO_ERROR) { + return nil; + } + + __auto_type * value = [MTRPowerSourceClusterWiredFaultChangeEvent new]; + + do { + NSArray * _Nonnull memberValue; + { // Scope for our temporary variables + auto * array_0 = [NSMutableArray new]; + auto iter_0 = cppValue.current.begin(); + while (iter_0.Next()) { + auto & entry_0 = iter_0.GetValue(); + NSNumber * newElement_0; + newElement_0 = [NSNumber numberWithUnsignedChar:chip::to_underlying(entry_0)]; + [array_0 addObject:newElement_0]; + } + CHIP_ERROR err = iter_0.GetStatus(); + if (err != CHIP_NO_ERROR) { + *aError = err; + return nil; + } + memberValue = array_0; + } + value.current = memberValue; + } while (0); + do { + NSArray * _Nonnull memberValue; + { // Scope for our temporary variables + auto * array_0 = [NSMutableArray new]; + auto iter_0 = cppValue.previous.begin(); + while (iter_0.Next()) { + auto & entry_0 = iter_0.GetValue(); + NSNumber * newElement_0; + newElement_0 = [NSNumber numberWithUnsignedChar:chip::to_underlying(entry_0)]; + [array_0 addObject:newElement_0]; + } + CHIP_ERROR err = iter_0.GetStatus(); + if (err != CHIP_NO_ERROR) { + *aError = err; + return nil; + } + memberValue = array_0; + } + value.previous = memberValue; + } while (0); + + return value; + } + + case Events::BatFaultChange::Id: { + Events::BatFaultChange::DecodableType cppValue; + *aError = DataModel::Decode(aReader, cppValue); + if (*aError != CHIP_NO_ERROR) { + return nil; + } + + __auto_type * value = [MTRPowerSourceClusterBatFaultChangeEvent new]; + + do { + NSArray * _Nonnull memberValue; + { // Scope for our temporary variables + auto * array_0 = [NSMutableArray new]; + auto iter_0 = cppValue.current.begin(); + while (iter_0.Next()) { + auto & entry_0 = iter_0.GetValue(); + NSNumber * newElement_0; + newElement_0 = [NSNumber numberWithUnsignedChar:chip::to_underlying(entry_0)]; + [array_0 addObject:newElement_0]; + } + CHIP_ERROR err = iter_0.GetStatus(); + if (err != CHIP_NO_ERROR) { + *aError = err; + return nil; + } + memberValue = array_0; + } + value.current = memberValue; + } while (0); + do { + NSArray * _Nonnull memberValue; + { // Scope for our temporary variables + auto * array_0 = [NSMutableArray new]; + auto iter_0 = cppValue.previous.begin(); + while (iter_0.Next()) { + auto & entry_0 = iter_0.GetValue(); + NSNumber * newElement_0; + newElement_0 = [NSNumber numberWithUnsignedChar:chip::to_underlying(entry_0)]; + [array_0 addObject:newElement_0]; + } + CHIP_ERROR err = iter_0.GetStatus(); + if (err != CHIP_NO_ERROR) { + *aError = err; + return nil; + } + memberValue = array_0; + } + value.previous = memberValue; + } while (0); + + return value; + } + + case Events::BatChargeFaultChange::Id: { + Events::BatChargeFaultChange::DecodableType cppValue; + *aError = DataModel::Decode(aReader, cppValue); + if (*aError != CHIP_NO_ERROR) { + return nil; + } + + __auto_type * value = [MTRPowerSourceClusterBatChargeFaultChangeEvent new]; + + do { + NSArray * _Nonnull memberValue; + { // Scope for our temporary variables + auto * array_0 = [NSMutableArray new]; + auto iter_0 = cppValue.current.begin(); + while (iter_0.Next()) { + auto & entry_0 = iter_0.GetValue(); + NSNumber * newElement_0; + newElement_0 = [NSNumber numberWithUnsignedChar:chip::to_underlying(entry_0)]; + [array_0 addObject:newElement_0]; + } + CHIP_ERROR err = iter_0.GetStatus(); + if (err != CHIP_NO_ERROR) { + *aError = err; + return nil; + } + memberValue = array_0; + } + value.current = memberValue; + } while (0); + do { + NSArray * _Nonnull memberValue; + { // Scope for our temporary variables + auto * array_0 = [NSMutableArray new]; + auto iter_0 = cppValue.previous.begin(); + while (iter_0.Next()) { + auto & entry_0 = iter_0.GetValue(); + NSNumber * newElement_0; + newElement_0 = [NSNumber numberWithUnsignedChar:chip::to_underlying(entry_0)]; + [array_0 addObject:newElement_0]; + } + CHIP_ERROR err = iter_0.GetStatus(); + if (err != CHIP_NO_ERROR) { + *aError = err; + return nil; + } + memberValue = array_0; + } + value.previous = memberValue; + } while (0); + + return value; + } + default: *aError = CHIP_ERROR_IM_MALFORMED_EVENT_PATH_IB; break; diff --git a/src/darwin/Framework/CHIP/zap-generated/MTRStructsObjc.h b/src/darwin/Framework/CHIP/zap-generated/MTRStructsObjc.h index e67a9749c7bda0..9c5aa2ee441931 100644 --- a/src/darwin/Framework/CHIP/zap-generated/MTRStructsObjc.h +++ b/src/darwin/Framework/CHIP/zap-generated/MTRStructsObjc.h @@ -239,21 +239,48 @@ MTR_NEWLY_DEPRECATED("Please use MTROTASoftwareUpdateRequestorClusterDownloadErr @end API_AVAILABLE(ios(16.1), macos(13.0), watchos(9.1), tvos(16.1)) +MTR_NEWLY_DEPRECATED("This struct is unused and will be removed") @interface MTRPowerSourceClusterBatChargeFaultChangeType : NSObject -@property (nonatomic, copy) NSArray * _Nonnull current API_AVAILABLE(ios(16.1), macos(13.0), watchos(9.1), tvos(16.1)); -@property (nonatomic, copy) NSArray * _Nonnull previous API_AVAILABLE(ios(16.1), macos(13.0), watchos(9.1), tvos(16.1)); +@property (nonatomic, copy) NSArray * _Nonnull current API_AVAILABLE(ios(16.1), macos(13.0), watchos(9.1), tvos(16.1)) + MTR_NEWLY_DEPRECATED("Please use MTRPowerSourceClusterBatChargeFaultChangeType"); +@property (nonatomic, copy) NSArray * _Nonnull previous API_AVAILABLE(ios(16.1), macos(13.0), watchos(9.1), tvos(16.1)) + MTR_NEWLY_DEPRECATED("Please use MTRPowerSourceClusterBatChargeFaultChangeType"); @end API_AVAILABLE(ios(16.1), macos(13.0), watchos(9.1), tvos(16.1)) +MTR_NEWLY_DEPRECATED("This struct is unused and will be removed") @interface MTRPowerSourceClusterBatFaultChangeType : NSObject -@property (nonatomic, copy) NSArray * _Nonnull current API_AVAILABLE(ios(16.1), macos(13.0), watchos(9.1), tvos(16.1)); -@property (nonatomic, copy) NSArray * _Nonnull previous API_AVAILABLE(ios(16.1), macos(13.0), watchos(9.1), tvos(16.1)); +@property (nonatomic, copy) NSArray * _Nonnull current API_AVAILABLE(ios(16.1), macos(13.0), watchos(9.1), tvos(16.1)) + MTR_NEWLY_DEPRECATED("Please use MTRPowerSourceClusterBatFaultChangeType"); +@property (nonatomic, copy) NSArray * _Nonnull previous API_AVAILABLE(ios(16.1), macos(13.0), watchos(9.1), tvos(16.1)) + MTR_NEWLY_DEPRECATED("Please use MTRPowerSourceClusterBatFaultChangeType"); @end API_AVAILABLE(ios(16.1), macos(13.0), watchos(9.1), tvos(16.1)) +MTR_NEWLY_DEPRECATED("This struct is unused and will be removed") @interface MTRPowerSourceClusterWiredFaultChangeType : NSObject -@property (nonatomic, copy) NSArray * _Nonnull current API_AVAILABLE(ios(16.1), macos(13.0), watchos(9.1), tvos(16.1)); -@property (nonatomic, copy) NSArray * _Nonnull previous API_AVAILABLE(ios(16.1), macos(13.0), watchos(9.1), tvos(16.1)); +@property (nonatomic, copy) NSArray * _Nonnull current API_AVAILABLE(ios(16.1), macos(13.0), watchos(9.1), tvos(16.1)) + MTR_NEWLY_DEPRECATED("Please use MTRPowerSourceClusterWiredFaultChangeType"); +@property (nonatomic, copy) NSArray * _Nonnull previous API_AVAILABLE(ios(16.1), macos(13.0), watchos(9.1), tvos(16.1)) + MTR_NEWLY_DEPRECATED("Please use MTRPowerSourceClusterWiredFaultChangeType"); +@end + +MTR_NEWLY_AVAILABLE +@interface MTRPowerSourceClusterWiredFaultChangeEvent : NSObject +@property (nonatomic, copy) NSArray * _Nonnull current MTR_NEWLY_AVAILABLE; +@property (nonatomic, copy) NSArray * _Nonnull previous MTR_NEWLY_AVAILABLE; +@end + +MTR_NEWLY_AVAILABLE +@interface MTRPowerSourceClusterBatFaultChangeEvent : NSObject +@property (nonatomic, copy) NSArray * _Nonnull current MTR_NEWLY_AVAILABLE; +@property (nonatomic, copy) NSArray * _Nonnull previous MTR_NEWLY_AVAILABLE; +@end + +MTR_NEWLY_AVAILABLE +@interface MTRPowerSourceClusterBatChargeFaultChangeEvent : NSObject +@property (nonatomic, copy) NSArray * _Nonnull current MTR_NEWLY_AVAILABLE; +@property (nonatomic, copy) NSArray * _Nonnull previous MTR_NEWLY_AVAILABLE; @end API_AVAILABLE(ios(16.1), macos(13.0), watchos(9.1), tvos(16.1)) diff --git a/src/darwin/Framework/CHIP/zap-generated/MTRStructsObjc.mm b/src/darwin/Framework/CHIP/zap-generated/MTRStructsObjc.mm index 178783a5a2d40e..bdb39bf37da445 100644 --- a/src/darwin/Framework/CHIP/zap-generated/MTRStructsObjc.mm +++ b/src/darwin/Framework/CHIP/zap-generated/MTRStructsObjc.mm @@ -910,6 +910,99 @@ - (NSString *)description @end +@implementation MTRPowerSourceClusterWiredFaultChangeEvent +- (instancetype)init +{ + if (self = [super init]) { + + _current = [NSArray array]; + + _previous = [NSArray array]; + } + return self; +} + +- (id)copyWithZone:(NSZone * _Nullable)zone +{ + auto other = [[MTRPowerSourceClusterWiredFaultChangeEvent alloc] init]; + + other.current = self.current; + other.previous = self.previous; + + return other; +} + +- (NSString *)description +{ + NSString * descriptionString = + [NSString stringWithFormat:@"<%@: current:%@; previous:%@; >", NSStringFromClass([self class]), _current, _previous]; + return descriptionString; +} + +@end + +@implementation MTRPowerSourceClusterBatFaultChangeEvent +- (instancetype)init +{ + if (self = [super init]) { + + _current = [NSArray array]; + + _previous = [NSArray array]; + } + return self; +} + +- (id)copyWithZone:(NSZone * _Nullable)zone +{ + auto other = [[MTRPowerSourceClusterBatFaultChangeEvent alloc] init]; + + other.current = self.current; + other.previous = self.previous; + + return other; +} + +- (NSString *)description +{ + NSString * descriptionString = + [NSString stringWithFormat:@"<%@: current:%@; previous:%@; >", NSStringFromClass([self class]), _current, _previous]; + return descriptionString; +} + +@end + +@implementation MTRPowerSourceClusterBatChargeFaultChangeEvent +- (instancetype)init +{ + if (self = [super init]) { + + _current = [NSArray array]; + + _previous = [NSArray array]; + } + return self; +} + +- (id)copyWithZone:(NSZone * _Nullable)zone +{ + auto other = [[MTRPowerSourceClusterBatChargeFaultChangeEvent alloc] init]; + + other.current = self.current; + other.previous = self.previous; + + return other; +} + +- (NSString *)description +{ + NSString * descriptionString = + [NSString stringWithFormat:@"<%@: current:%@; previous:%@; >", NSStringFromClass([self class]), _current, _previous]; + return descriptionString; +} + +@end + @implementation MTRGeneralCommissioningClusterBasicCommissioningInfo - (instancetype)init { 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 448310efafe87c..2d1476bdf79ff7 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 @@ -5241,6 +5241,129 @@ CHIP_ERROR TypeInfo::DecodableType::Decode(TLV::TLVReader & reader, const Concre } // namespace Attributes namespace Events { +namespace WiredFaultChange { +CHIP_ERROR Type::Encode(TLV::TLVWriter & writer, TLV::Tag tag) const +{ + TLV::TLVType outer; + ReturnErrorOnFailure(writer.StartContainer(tag, TLV::kTLVType_Structure, outer)); + ReturnErrorOnFailure(DataModel::Encode(writer, TLV::ContextTag(to_underlying(Fields::kCurrent)), current)); + ReturnErrorOnFailure(DataModel::Encode(writer, TLV::ContextTag(to_underlying(Fields::kPrevious)), previous)); + ReturnErrorOnFailure(writer.EndContainer(outer)); + return CHIP_NO_ERROR; +} + +CHIP_ERROR DecodableType::Decode(TLV::TLVReader & reader) +{ + CHIP_ERROR err = CHIP_NO_ERROR; + TLV::TLVType outer; + VerifyOrReturnError(TLV::kTLVType_Structure == reader.GetType(), CHIP_ERROR_WRONG_TLV_TYPE); + ReturnErrorOnFailure(reader.EnterContainer(outer)); + while ((err = reader.Next()) == CHIP_NO_ERROR) + { + if (!TLV::IsContextTag(reader.GetTag())) + { + continue; + } + switch (TLV::TagNumFromTag(reader.GetTag())) + { + case to_underlying(Fields::kCurrent): + ReturnErrorOnFailure(DataModel::Decode(reader, current)); + break; + case to_underlying(Fields::kPrevious): + ReturnErrorOnFailure(DataModel::Decode(reader, previous)); + break; + default: + break; + } + } + + VerifyOrReturnError(err == CHIP_END_OF_TLV, err); + ReturnErrorOnFailure(reader.ExitContainer(outer)); + return CHIP_NO_ERROR; +} +} // namespace WiredFaultChange. +namespace BatFaultChange { +CHIP_ERROR Type::Encode(TLV::TLVWriter & writer, TLV::Tag tag) const +{ + TLV::TLVType outer; + ReturnErrorOnFailure(writer.StartContainer(tag, TLV::kTLVType_Structure, outer)); + ReturnErrorOnFailure(DataModel::Encode(writer, TLV::ContextTag(to_underlying(Fields::kCurrent)), current)); + ReturnErrorOnFailure(DataModel::Encode(writer, TLV::ContextTag(to_underlying(Fields::kPrevious)), previous)); + ReturnErrorOnFailure(writer.EndContainer(outer)); + return CHIP_NO_ERROR; +} + +CHIP_ERROR DecodableType::Decode(TLV::TLVReader & reader) +{ + CHIP_ERROR err = CHIP_NO_ERROR; + TLV::TLVType outer; + VerifyOrReturnError(TLV::kTLVType_Structure == reader.GetType(), CHIP_ERROR_WRONG_TLV_TYPE); + ReturnErrorOnFailure(reader.EnterContainer(outer)); + while ((err = reader.Next()) == CHIP_NO_ERROR) + { + if (!TLV::IsContextTag(reader.GetTag())) + { + continue; + } + switch (TLV::TagNumFromTag(reader.GetTag())) + { + case to_underlying(Fields::kCurrent): + ReturnErrorOnFailure(DataModel::Decode(reader, current)); + break; + case to_underlying(Fields::kPrevious): + ReturnErrorOnFailure(DataModel::Decode(reader, previous)); + break; + default: + break; + } + } + + VerifyOrReturnError(err == CHIP_END_OF_TLV, err); + ReturnErrorOnFailure(reader.ExitContainer(outer)); + return CHIP_NO_ERROR; +} +} // namespace BatFaultChange. +namespace BatChargeFaultChange { +CHIP_ERROR Type::Encode(TLV::TLVWriter & writer, TLV::Tag tag) const +{ + TLV::TLVType outer; + ReturnErrorOnFailure(writer.StartContainer(tag, TLV::kTLVType_Structure, outer)); + ReturnErrorOnFailure(DataModel::Encode(writer, TLV::ContextTag(to_underlying(Fields::kCurrent)), current)); + ReturnErrorOnFailure(DataModel::Encode(writer, TLV::ContextTag(to_underlying(Fields::kPrevious)), previous)); + ReturnErrorOnFailure(writer.EndContainer(outer)); + return CHIP_NO_ERROR; +} + +CHIP_ERROR DecodableType::Decode(TLV::TLVReader & reader) +{ + CHIP_ERROR err = CHIP_NO_ERROR; + TLV::TLVType outer; + VerifyOrReturnError(TLV::kTLVType_Structure == reader.GetType(), CHIP_ERROR_WRONG_TLV_TYPE); + ReturnErrorOnFailure(reader.EnterContainer(outer)); + while ((err = reader.Next()) == CHIP_NO_ERROR) + { + if (!TLV::IsContextTag(reader.GetTag())) + { + continue; + } + switch (TLV::TagNumFromTag(reader.GetTag())) + { + case to_underlying(Fields::kCurrent): + ReturnErrorOnFailure(DataModel::Decode(reader, current)); + break; + case to_underlying(Fields::kPrevious): + ReturnErrorOnFailure(DataModel::Decode(reader, previous)); + break; + default: + break; + } + } + + VerifyOrReturnError(err == CHIP_END_OF_TLV, err); + ReturnErrorOnFailure(reader.ExitContainer(outer)); + return CHIP_NO_ERROR; +} +} // namespace BatChargeFaultChange. } // namespace Events } // namespace PowerSource 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 f6707991e0dfed..d9a23bfe1012e6 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 @@ -6375,6 +6375,116 @@ struct TypeInfo }; }; } // namespace Attributes +namespace Events { +namespace WiredFaultChange { +static constexpr PriorityLevel kPriorityLevel = PriorityLevel::Info; + +enum class Fields +{ + kCurrent = 0, + kPrevious = 1, +}; + +struct Type +{ +public: + static constexpr PriorityLevel GetPriorityLevel() { return kPriorityLevel; } + static constexpr EventId GetEventId() { return Events::WiredFaultChange::Id; } + static constexpr ClusterId GetClusterId() { return Clusters::PowerSource::Id; } + static constexpr bool kIsFabricScoped = false; + + DataModel::List current; + DataModel::List previous; + + CHIP_ERROR Encode(TLV::TLVWriter & writer, TLV::Tag tag) const; +}; + +struct DecodableType +{ +public: + static constexpr PriorityLevel GetPriorityLevel() { return kPriorityLevel; } + static constexpr EventId GetEventId() { return Events::WiredFaultChange::Id; } + static constexpr ClusterId GetClusterId() { return Clusters::PowerSource::Id; } + + DataModel::DecodableList current; + DataModel::DecodableList previous; + + CHIP_ERROR Decode(TLV::TLVReader & reader); +}; +} // namespace WiredFaultChange +namespace BatFaultChange { +static constexpr PriorityLevel kPriorityLevel = PriorityLevel::Info; + +enum class Fields +{ + kCurrent = 0, + kPrevious = 1, +}; + +struct Type +{ +public: + static constexpr PriorityLevel GetPriorityLevel() { return kPriorityLevel; } + static constexpr EventId GetEventId() { return Events::BatFaultChange::Id; } + static constexpr ClusterId GetClusterId() { return Clusters::PowerSource::Id; } + static constexpr bool kIsFabricScoped = false; + + DataModel::List current; + DataModel::List previous; + + CHIP_ERROR Encode(TLV::TLVWriter & writer, TLV::Tag tag) const; +}; + +struct DecodableType +{ +public: + static constexpr PriorityLevel GetPriorityLevel() { return kPriorityLevel; } + static constexpr EventId GetEventId() { return Events::BatFaultChange::Id; } + static constexpr ClusterId GetClusterId() { return Clusters::PowerSource::Id; } + + DataModel::DecodableList current; + DataModel::DecodableList previous; + + CHIP_ERROR Decode(TLV::TLVReader & reader); +}; +} // namespace BatFaultChange +namespace BatChargeFaultChange { +static constexpr PriorityLevel kPriorityLevel = PriorityLevel::Info; + +enum class Fields +{ + kCurrent = 0, + kPrevious = 1, +}; + +struct Type +{ +public: + static constexpr PriorityLevel GetPriorityLevel() { return kPriorityLevel; } + static constexpr EventId GetEventId() { return Events::BatChargeFaultChange::Id; } + static constexpr ClusterId GetClusterId() { return Clusters::PowerSource::Id; } + static constexpr bool kIsFabricScoped = false; + + DataModel::List current; + DataModel::List previous; + + CHIP_ERROR Encode(TLV::TLVWriter & writer, TLV::Tag tag) const; +}; + +struct DecodableType +{ +public: + static constexpr PriorityLevel GetPriorityLevel() { return kPriorityLevel; } + static constexpr EventId GetEventId() { return Events::BatChargeFaultChange::Id; } + static constexpr ClusterId GetClusterId() { return Clusters::PowerSource::Id; } + + DataModel::DecodableList current; + DataModel::DecodableList previous; + + CHIP_ERROR Decode(TLV::TLVReader & reader); +}; +} // namespace BatChargeFaultChange +} // namespace Events } // namespace PowerSource namespace GeneralCommissioning { namespace Structs { diff --git a/zzz_generated/app-common/app-common/zap-generated/ids/Events.h b/zzz_generated/app-common/app-common/zap-generated/ids/Events.h index 8dbc9ea7a323fb..e885f58360f248 100644 --- a/zzz_generated/app-common/app-common/zap-generated/ids/Events.h +++ b/zzz_generated/app-common/app-common/zap-generated/ids/Events.h @@ -93,6 +93,24 @@ static constexpr EventId Id = 0x00000002; } // namespace Events } // namespace OtaSoftwareUpdateRequestor +namespace PowerSource { +namespace Events { + +namespace WiredFaultChange { +static constexpr EventId Id = 0x00000000; +} // namespace WiredFaultChange + +namespace BatFaultChange { +static constexpr EventId Id = 0x00000001; +} // namespace BatFaultChange + +namespace BatChargeFaultChange { +static constexpr EventId Id = 0x00000002; +} // namespace BatChargeFaultChange + +} // namespace Events +} // namespace PowerSource + namespace GeneralDiagnostics { namespace Events { diff --git a/zzz_generated/chip-tool/zap-generated/cluster/Commands.h b/zzz_generated/chip-tool/zap-generated/cluster/Commands.h index 845ea56ff454f9..8fbfa60a3baa13 100644 --- a/zzz_generated/chip-tool/zap-generated/cluster/Commands.h +++ b/zzz_generated/chip-tool/zap-generated/cluster/Commands.h @@ -2175,6 +2175,9 @@ class OtaSoftwareUpdateRequestorAnnounceOTAProvider : public ClusterCommand | * ClusterRevision | 0xFFFD | |------------------------------------------------------------------------------| | Events: | | +| * WiredFaultChange | 0x0000 | +| * BatFaultChange | 0x0001 | +| * BatChargeFaultChange | 0x0002 | \*----------------------------------------------------------------------------*/ /*----------------------------------------------------------------------------*\ @@ -9402,8 +9405,14 @@ void registerClusterPowerSource(Commands & commands, CredentialIssuerCommands * // // Events // - make_unique(Id, credsIssuerConfig), // - make_unique(Id, credsIssuerConfig), // + make_unique(Id, credsIssuerConfig), // + make_unique(Id, "wired-fault-change", Events::WiredFaultChange::Id, credsIssuerConfig), // + make_unique(Id, "bat-fault-change", Events::BatFaultChange::Id, credsIssuerConfig), // + make_unique(Id, "bat-charge-fault-change", Events::BatChargeFaultChange::Id, credsIssuerConfig), // + make_unique(Id, credsIssuerConfig), // + make_unique(Id, "wired-fault-change", Events::WiredFaultChange::Id, credsIssuerConfig), // + make_unique(Id, "bat-fault-change", Events::BatFaultChange::Id, credsIssuerConfig), // + make_unique(Id, "bat-charge-fault-change", Events::BatChargeFaultChange::Id, credsIssuerConfig), // }; commands.Register(clusterName, clusterCommands); 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 15e1dc60dc5ba4..5e4ec741353506 100644 --- a/zzz_generated/chip-tool/zap-generated/cluster/logging/DataModelLogger.cpp +++ b/zzz_generated/chip-tool/zap-generated/cluster/logging/DataModelLogger.cpp @@ -2771,6 +2771,78 @@ CHIP_ERROR DataModelLogger::LogValue(const char * label, size_t indent, return CHIP_NO_ERROR; } +CHIP_ERROR DataModelLogger::LogValue(const char * label, size_t indent, + const PowerSource::Events::WiredFaultChange::DecodableType & value) +{ + DataModelLogger::LogString(label, indent, "{"); + { + CHIP_ERROR err = DataModelLogger::LogValue("Current", indent + 1, value.current); + if (err != CHIP_NO_ERROR) + { + DataModelLogger::LogString(indent + 1, "Event truncated due to invalid value for 'Current'"); + return err; + } + } + { + CHIP_ERROR err = DataModelLogger::LogValue("Previous", indent + 1, value.previous); + if (err != CHIP_NO_ERROR) + { + DataModelLogger::LogString(indent + 1, "Event truncated due to invalid value for 'Previous'"); + return err; + } + } + DataModelLogger::LogString(indent, "}"); + + return CHIP_NO_ERROR; +} +CHIP_ERROR DataModelLogger::LogValue(const char * label, size_t indent, + const PowerSource::Events::BatFaultChange::DecodableType & value) +{ + DataModelLogger::LogString(label, indent, "{"); + { + CHIP_ERROR err = DataModelLogger::LogValue("Current", indent + 1, value.current); + if (err != CHIP_NO_ERROR) + { + DataModelLogger::LogString(indent + 1, "Event truncated due to invalid value for 'Current'"); + return err; + } + } + { + CHIP_ERROR err = DataModelLogger::LogValue("Previous", indent + 1, value.previous); + if (err != CHIP_NO_ERROR) + { + DataModelLogger::LogString(indent + 1, "Event truncated due to invalid value for 'Previous'"); + return err; + } + } + DataModelLogger::LogString(indent, "}"); + + return CHIP_NO_ERROR; +} +CHIP_ERROR DataModelLogger::LogValue(const char * label, size_t indent, + const PowerSource::Events::BatChargeFaultChange::DecodableType & value) +{ + DataModelLogger::LogString(label, indent, "{"); + { + CHIP_ERROR err = DataModelLogger::LogValue("Current", indent + 1, value.current); + if (err != CHIP_NO_ERROR) + { + DataModelLogger::LogString(indent + 1, "Event truncated due to invalid value for 'Current'"); + return err; + } + } + { + CHIP_ERROR err = DataModelLogger::LogValue("Previous", indent + 1, value.previous); + if (err != CHIP_NO_ERROR) + { + DataModelLogger::LogString(indent + 1, "Event truncated due to invalid value for 'Previous'"); + return err; + } + } + DataModelLogger::LogString(indent, "}"); + + return CHIP_NO_ERROR; +} CHIP_ERROR DataModelLogger::LogValue(const char * label, size_t indent, const GeneralDiagnostics::Events::HardwareFaultChange::DecodableType & value) { @@ -10571,6 +10643,27 @@ CHIP_ERROR DataModelLogger::LogEvent(const chip::app::EventHeader & header, chip } break; } + case PowerSource::Id: { + switch (header.mPath.mEventId) + { + case PowerSource::Events::WiredFaultChange::Id: { + chip::app::Clusters::PowerSource::Events::WiredFaultChange::DecodableType value; + ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); + return DataModelLogger::LogValue("WiredFaultChange", 1, value); + } + case PowerSource::Events::BatFaultChange::Id: { + chip::app::Clusters::PowerSource::Events::BatFaultChange::DecodableType value; + ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); + return DataModelLogger::LogValue("BatFaultChange", 1, value); + } + case PowerSource::Events::BatChargeFaultChange::Id: { + chip::app::Clusters::PowerSource::Events::BatChargeFaultChange::DecodableType value; + ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); + return DataModelLogger::LogValue("BatChargeFaultChange", 1, value); + } + } + break; + } case GeneralDiagnostics::Id: { switch (header.mPath.mEventId) { diff --git a/zzz_generated/chip-tool/zap-generated/cluster/logging/DataModelLogger.h b/zzz_generated/chip-tool/zap-generated/cluster/logging/DataModelLogger.h index 1683e2255b9d41..a3a71f6bc63a46 100644 --- a/zzz_generated/chip-tool/zap-generated/cluster/logging/DataModelLogger.h +++ b/zzz_generated/chip-tool/zap-generated/cluster/logging/DataModelLogger.h @@ -165,6 +165,12 @@ static CHIP_ERROR LogValue(const char * label, size_t indent, const chip::app::Clusters::OtaSoftwareUpdateRequestor::Events::VersionApplied::DecodableType & value); static CHIP_ERROR LogValue(const char * label, size_t indent, const chip::app::Clusters::OtaSoftwareUpdateRequestor::Events::DownloadError::DecodableType & value); +static CHIP_ERROR LogValue(const char * label, size_t indent, + const chip::app::Clusters::PowerSource::Events::WiredFaultChange::DecodableType & value); +static CHIP_ERROR LogValue(const char * label, size_t indent, + const chip::app::Clusters::PowerSource::Events::BatFaultChange::DecodableType & value); +static CHIP_ERROR LogValue(const char * label, size_t indent, + const chip::app::Clusters::PowerSource::Events::BatChargeFaultChange::DecodableType & value); static CHIP_ERROR LogValue(const char * label, size_t indent, const chip::app::Clusters::GeneralDiagnostics::Events::HardwareFaultChange::DecodableType & value); static CHIP_ERROR LogValue(const char * label, size_t indent, diff --git a/zzz_generated/darwin-framework-tool/zap-generated/cluster/Commands.h b/zzz_generated/darwin-framework-tool/zap-generated/cluster/Commands.h index 7bb0ef4746c056..bbe21891c6e607 100644 --- a/zzz_generated/darwin-framework-tool/zap-generated/cluster/Commands.h +++ b/zzz_generated/darwin-framework-tool/zap-generated/cluster/Commands.h @@ -16338,6 +16338,9 @@ class SubscribeAttributePowerSourceConfigurationClusterRevision : public Subscri | * ClusterRevision | 0xFFFD | |------------------------------------------------------------------------------| | Events: | | +| * WiredFaultChange | 0x0000 | +| * BatFaultChange | 0x0001 | +| * BatChargeFaultChange | 0x0002 | \*----------------------------------------------------------------------------*/ /*