From eb7904caeb756e1ad53cae653453c5cef2eb258e Mon Sep 17 00:00:00 2001 From: Dmitrii Popov <popovdg@gmail.com> Date: Mon, 10 Mar 2025 18:24:44 +0300 Subject: [PATCH 1/2] zap generated files for Meter Identification cluster --- .github/workflows/tests.yaml | 1 + docs/ids_and_codes/zap_clusters.md | 1 + scripts/rules.matterlint | 1 + .../app-templates/gen_config.h | 2 + .../lighting-app/app-templates/gen_config.h | 2 + .../chip/meter-identification-cluster.xml | 74 ++ .../zcl/zcl-with-test-extensions.json | 2 + src/app/zap-templates/zcl/zcl.json | 2 + src/app/zap_cluster_list.json | 2 + .../data_model/controller-clusters.matter | 39 + .../chip/devicecontroller/ChipClusters.java | 348 +++++ .../chip/devicecontroller/ChipStructs.java | 76 ++ .../devicecontroller/ClusterIDMapping.java | 108 ++ .../devicecontroller/ClusterInfoMapping.java | 198 +++ .../devicecontroller/ClusterReadMapping.java | 115 ++ .../devicecontroller/ClusterWriteMapping.java | 2 + .../chip/devicecontroller/cluster/files.gni | 1 + ...entificationClusterPowerThresholdStruct.kt | 95 ++ .../clusters/MeterIdentificationCluster.kt | 1173 +++++++++++++++++ .../java/matter/controller/cluster/files.gni | 2 + ...entificationClusterPowerThresholdStruct.kt | 95 ++ .../CHIPAttributeTLVValueDecoder.cpp | 290 ++++ .../CHIPEventTLVValueDecoder.cpp | 10 + .../python/chip/clusters/CHIPClusters.py | 70 + .../python/chip/clusters/Objects.py | 235 ++++ .../MTRAttributeSpecifiedCheck.mm | 42 + .../MTRAttributeTLVValueDecoder.mm | 120 ++ .../CHIP/zap-generated/MTRBaseClusters.h | 101 ++ .../CHIP/zap-generated/MTRBaseClusters.mm | 364 +++++ .../CHIP/zap-generated/MTRClusterConstants.h | 13 + .../CHIP/zap-generated/MTRClusterNames.mm | 84 ++ .../CHIP/zap-generated/MTRClusters.h | 44 + .../CHIP/zap-generated/MTRClusters.mm | 54 + .../zap-generated/MTRCommandTimedCheck.mm | 12 + .../zap-generated/MTREventTLVValueDecoder.mm | 15 + .../CHIP/zap-generated/MTRStructsObjc.h | 7 + .../CHIP/zap-generated/MTRStructsObjc.mm | 33 + .../zap-generated/attributes/Accessors.cpp | 461 +++++++ .../zap-generated/attributes/Accessors.h | 66 + .../app-common/zap-generated/callback.h | 43 + .../zap-generated/cluster-enums-check.h | 27 + .../app-common/zap-generated/cluster-enums.h | 35 + .../zap-generated/cluster-objects.cpp | 86 ++ .../zap-generated/cluster-objects.h | 149 +++ .../app-common/zap-generated/ids/Attributes.h | 46 + .../app-common/zap-generated/ids/Clusters.h | 3 + .../zap-generated/cluster/Commands.h | 90 ++ .../cluster/ComplexArgumentParser.cpp | 43 + .../cluster/ComplexArgumentParser.h | 5 + .../cluster/logging/DataModelLogger.cpp | 91 ++ .../cluster/logging/DataModelLogger.h | 3 + .../cluster/logging/EntryToText.cpp | 29 + .../zap-generated/cluster/Commands.h | 931 +++++++++++++ 53 files changed, 5941 insertions(+) create mode 100644 src/app/zap-templates/zcl/data-model/chip/meter-identification-cluster.xml create mode 100644 src/controller/java/generated/java/chip/devicecontroller/cluster/structs/MeterIdentificationClusterPowerThresholdStruct.kt create mode 100644 src/controller/java/generated/java/matter/controller/cluster/clusters/MeterIdentificationCluster.kt create mode 100644 src/controller/java/generated/java/matter/controller/cluster/structs/MeterIdentificationClusterPowerThresholdStruct.kt diff --git a/.github/workflows/tests.yaml b/.github/workflows/tests.yaml index 7257879d21ead3..25f67f802098ab 100644 --- a/.github/workflows/tests.yaml +++ b/.github/workflows/tests.yaml @@ -97,6 +97,7 @@ jobs: src/app/zap-templates/zcl/data-model/chip/global-bitmaps.xml \ src/app/zap-templates/zcl/data-model/chip/global-enums.xml \ src/app/zap-templates/zcl/data-model/chip/global-structs.xml \ + src/app/zap-templates/zcl/data-model/chip/meter-identification-cluster.xml \ src/app/zap-templates/zcl/data-model/chip/push-av-stream-transport-cluster.xml \ src/app/zap-templates/zcl/data-model/chip/semantic-tag-namespace-enums.xml \ src/app/zap-templates/zcl/data-model/chip/access-control-definitions.xml \ diff --git a/docs/ids_and_codes/zap_clusters.md b/docs/ids_and_codes/zap_clusters.md index bb410edfba2761..9920927bf9c00e 100644 --- a/docs/ids_and_codes/zap_clusters.md +++ b/docs/ids_and_codes/zap_clusters.md @@ -141,6 +141,7 @@ Generally regenerate using one of: | 1873 | 0x751 | CommissionerControl | | 2049 | 0x801 | TlsCertificateManagement | | 2050 | 0x802 | TlsClientManagement | +| 2822 | 0xB06 | MeterIdentification | | 4294048773 | 0xFFF1FC05 | UnitTesting | | 4294048774 | 0xFFF1FC06 | FaultInjection | | 4294048800 | 0xFFF1FC20 | SampleMei | diff --git a/scripts/rules.matterlint b/scripts/rules.matterlint index 6d6204807fe769..3046fccfd96caf 100644 --- a/scripts/rules.matterlint +++ b/scripts/rules.matterlint @@ -35,6 +35,7 @@ load "../src/app/zap-templates/zcl/data-model/chip/diagnostic-logs-cluster.xml"; load "../src/app/zap-templates/zcl/data-model/chip/dishwasher-alarm-cluster.xml"; load "../src/app/zap-templates/zcl/data-model/chip/dishwasher-mode-cluster.xml"; load "../src/app/zap-templates/zcl/data-model/chip/measurement-and-sensing.xml"; +load "../src/app/zap-templates/zcl/data-model/chip/meter-identification-cluster.xml"; load "../src/app/zap-templates/zcl/data-model/chip/microwave-oven-mode-cluster.xml"; load "../src/app/zap-templates/zcl/data-model/chip/microwave-oven-control-cluster.xml"; load "../src/app/zap-templates/zcl/data-model/chip/door-lock-cluster.xml"; diff --git a/scripts/tools/zap/tests/outputs/all-clusters-app/app-templates/gen_config.h b/scripts/tools/zap/tests/outputs/all-clusters-app/app-templates/gen_config.h index c976fd3e5e6850..70d2a7c19c38ad 100644 --- a/scripts/tools/zap/tests/outputs/all-clusters-app/app-templates/gen_config.h +++ b/scripts/tools/zap/tests/outputs/all-clusters-app/app-templates/gen_config.h @@ -150,6 +150,7 @@ #define MATTER_DM_COMMISSIONER_CONTROL_CLUSTER_SERVER_ENDPOINT_COUNT (0) #define MATTER_DM_TLS_CERTIFICATE_MANAGEMENT_CLUSTER_SERVER_ENDPOINT_COUNT (0) #define MATTER_DM_TLS_CLIENT_MANAGEMENT_CLUSTER_SERVER_ENDPOINT_COUNT (0) +#define MATTER_DM_METER_IDENTIFICATION_CLUSTER_SERVER_ENDPOINT_COUNT (0) #define MATTER_DM_UNIT_TESTING_CLUSTER_SERVER_ENDPOINT_COUNT (1) #define MATTER_DM_FAULT_INJECTION_CLUSTER_SERVER_ENDPOINT_COUNT (1) #define MATTER_DM_SAMPLE_MEI_CLUSTER_SERVER_ENDPOINT_COUNT (0) @@ -283,6 +284,7 @@ #define MATTER_DM_COMMISSIONER_CONTROL_CLUSTER_CLIENT_ENDPOINT_COUNT (0) #define MATTER_DM_TLS_CERTIFICATE_MANAGEMENT_CLUSTER_CLIENT_ENDPOINT_COUNT (0) #define MATTER_DM_TLS_CLIENT_MANAGEMENT_CLUSTER_CLIENT_ENDPOINT_COUNT (0) +#define MATTER_DM_METER_IDENTIFICATION_CLUSTER_CLIENT_ENDPOINT_COUNT (0) #define MATTER_DM_UNIT_TESTING_CLUSTER_CLIENT_ENDPOINT_COUNT (0) #define MATTER_DM_FAULT_INJECTION_CLUSTER_CLIENT_ENDPOINT_COUNT (0) #define MATTER_DM_SAMPLE_MEI_CLUSTER_CLIENT_ENDPOINT_COUNT (0) diff --git a/scripts/tools/zap/tests/outputs/lighting-app/app-templates/gen_config.h b/scripts/tools/zap/tests/outputs/lighting-app/app-templates/gen_config.h index 86fedb79126d29..7f89ec76f59025 100644 --- a/scripts/tools/zap/tests/outputs/lighting-app/app-templates/gen_config.h +++ b/scripts/tools/zap/tests/outputs/lighting-app/app-templates/gen_config.h @@ -150,6 +150,7 @@ #define MATTER_DM_COMMISSIONER_CONTROL_CLUSTER_SERVER_ENDPOINT_COUNT (0) #define MATTER_DM_TLS_CERTIFICATE_MANAGEMENT_CLUSTER_SERVER_ENDPOINT_COUNT (0) #define MATTER_DM_TLS_CLIENT_MANAGEMENT_CLUSTER_SERVER_ENDPOINT_COUNT (0) +#define MATTER_DM_METER_IDENTIFICATION_CLUSTER_SERVER_ENDPOINT_COUNT (0) #define MATTER_DM_UNIT_TESTING_CLUSTER_SERVER_ENDPOINT_COUNT (0) #define MATTER_DM_FAULT_INJECTION_CLUSTER_SERVER_ENDPOINT_COUNT (0) #define MATTER_DM_SAMPLE_MEI_CLUSTER_SERVER_ENDPOINT_COUNT (0) @@ -283,6 +284,7 @@ #define MATTER_DM_COMMISSIONER_CONTROL_CLUSTER_CLIENT_ENDPOINT_COUNT (0) #define MATTER_DM_TLS_CERTIFICATE_MANAGEMENT_CLUSTER_CLIENT_ENDPOINT_COUNT (0) #define MATTER_DM_TLS_CLIENT_MANAGEMENT_CLUSTER_CLIENT_ENDPOINT_COUNT (0) +#define MATTER_DM_METER_IDENTIFICATION_CLUSTER_CLIENT_ENDPOINT_COUNT (0) #define MATTER_DM_UNIT_TESTING_CLUSTER_CLIENT_ENDPOINT_COUNT (0) #define MATTER_DM_FAULT_INJECTION_CLUSTER_CLIENT_ENDPOINT_COUNT (0) #define MATTER_DM_SAMPLE_MEI_CLUSTER_CLIENT_ENDPOINT_COUNT (0) diff --git a/src/app/zap-templates/zcl/data-model/chip/meter-identification-cluster.xml b/src/app/zap-templates/zcl/data-model/chip/meter-identification-cluster.xml new file mode 100644 index 00000000000000..e732cf5e73bc8f --- /dev/null +++ b/src/app/zap-templates/zcl/data-model/chip/meter-identification-cluster.xml @@ -0,0 +1,74 @@ +<?xml version="1.0"?> +<!-- +Copyright (c) 2025 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. +--> +<!-- +XML generated by Alchemy; DO NOT EDIT. +Source: src/app_clusters/MeterIdentification.adoc +Parameters: +Git: +--> +<configurator xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../zcl.xsd"> + <domain name="General"/> + <enum name="MeterTypeEnum" type="enum8"> + <cluster code="0x0B06"/> + <item name="Utility" value="0x00"/> + <item name="Private" value="0x01"/> + <item name="Generic" value="0x02"/> + </enum> + + <enum name="PowerThresholdSourceEnum" type="enum8"> + <cluster code="0x0B06"/> + <item name="Contract" value="0x00"/> + <item name="Regulator" value="0x01"/> + <item name="Equipment" value="0x02"/> + </enum> + + <struct name="PowerThresholdStruct" apiMaturity="provisional"> + <cluster code="0x0B06"/> + <item fieldId="0" name="PowerThreshold" type="int64s" optional="true"/> + <item fieldId="1" name="ApparentPowerThreshold" type="int64s" optional="true"/> + <item fieldId="2" name="PowerThresholdSource" type="PowerThresholdSourceEnum" isNullable="true" min="0x00" max="0x02"/> + </struct> + + <cluster apiMaturity="provisional"> + <domain>General</domain> + <name>Meter Identification</name> + <code>0x0B06</code> + <define>METER_IDENTIFICATION_CLUSTER</define> + <description>This field SHALL indicate the Power Threshold Information.</description> + <client init="false" tick="false">true</client> + <server init="false" tick="false">true</server> + <globalAttribute code="0xFFFD" side="either" value="1"/> + <attribute code="0x0000" side="server" define="METER_TYPE" type="MeterTypeEnum" isNullable="true" min="0x00" max="0x02">MeterType</attribute> + <attribute code="0x0001" side="server" define="POINT_OF_DELIVERY" type="char_string" isNullable="true" length="64">PointOfDelivery</attribute> + <attribute code="0x0002" side="server" define="METER_SERIAL_NUMBER" type="char_string" isNullable="true" length="64">MeterSerialNumber</attribute> + <attribute code="0x0003" side="server" define="PROTOCOL_VERSION" type="char_string" isNullable="true" length="64" optional="true"> + <description>ProtocolVersion</description> + <optionalConform/> + </attribute> + <attribute code="0x0004" side="server" define="POWER_THRESHOLD" type="PowerThresholdStruct" isNullable="true" optional="true"> + <description>PowerThreshold</description> + <mandatoryConform> + <feature name="PWRTHLD"/> + </mandatoryConform> + </attribute> + <features> + <feature bit="0" code="PWRTHLD" name="PowerThreshold" summary="Supports information about power threshold"> + <optionalConform/> + </feature> + </features> + </cluster> +</configurator> 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 ac5d374d2a7cc1..ad49d409b757d0 100644 --- a/src/app/zap-templates/zcl/zcl-with-test-extensions.json +++ b/src/app/zap-templates/zcl/zcl-with-test-extensions.json @@ -47,6 +47,7 @@ "dishwasher-alarm-cluster.xml", "dishwasher-mode-cluster.xml", "drlc-cluster.xml", + "meter-identification-cluster.xml", "microwave-oven-mode-cluster.xml", "microwave-oven-control-cluster.xml", "door-lock-cluster.xml", @@ -679,6 +680,7 @@ "FeatureMap", "ClusterRevision" ], + "Meter Identification": ["PowerThreshold"], "Water Heater Mode": ["SupportedModes", "CurrentMode", "FeatureMap"], "Wi-Fi Network Management": ["SSID", "PassphraseSurrogate"], "Thread Network Directory": [ diff --git a/src/app/zap-templates/zcl/zcl.json b/src/app/zap-templates/zcl/zcl.json index 9735cc7f34b953..001f499c18558d 100644 --- a/src/app/zap-templates/zcl/zcl.json +++ b/src/app/zap-templates/zcl/zcl.json @@ -41,6 +41,7 @@ "diagnostic-logs-cluster.xml", "dishwasher-alarm-cluster.xml", "dishwasher-mode-cluster.xml", + "meter-identification-cluster.xml", "microwave-oven-mode-cluster.xml", "door-lock-cluster.xml", "drlc-cluster.xml", @@ -673,6 +674,7 @@ "FeatureMap", "ClusterRevision" ], + "Meter Identification": ["PowerThreshold"], "Water Heater Mode": ["SupportedModes", "CurrentMode", "FeatureMap"], "Wi-Fi Network Management": ["SSID", "PassphraseSurrogate"], "Thread Network Directory": [ diff --git a/src/app/zap_cluster_list.json b/src/app/zap_cluster_list.json index 276e9ffd20f1ff..e095229318535a 100644 --- a/src/app/zap_cluster_list.json +++ b/src/app/zap_cluster_list.json @@ -37,6 +37,7 @@ "DIAGNOSTIC_LOGS_CLUSTER": [], "DISHWASHER_ALARM_CLUSTER": [], "DISHWASHER_MODE_CLUSTER": [], + "METER_IDENTIFICATION_CLUSTER": [], "MICROWAVE_OVEN_MODE_CLUSTER": [], "DOOR_LOCK_CLUSTER": [], "ECOSYSTEM_INFORMATION_CLUSTER": [], @@ -192,6 +193,7 @@ "DIAGNOSTIC_LOGS_CLUSTER": ["diagnostic-logs-server"], "DISHWASHER_ALARM_CLUSTER": ["dishwasher-alarm-server"], "DISHWASHER_MODE_CLUSTER": ["mode-base-server"], + "METER_IDENTIFICATION_CLUSTER": ["meter-identification-server"], "MICROWAVE_OVEN_MODE_CLUSTER": ["mode-base-server"], "DOOR_LOCK_CLUSTER": ["door-lock-server"], "ECOSYSTEM_INFORMATION_CLUSTER": ["ecosystem-information-server"], diff --git a/src/controller/data_model/controller-clusters.matter b/src/controller/data_model/controller-clusters.matter index d6949e17eca6ef..772cd95b90b5ca 100644 --- a/src/controller/data_model/controller-clusters.matter +++ b/src/controller/data_model/controller-clusters.matter @@ -10751,6 +10751,45 @@ provisional cluster TlsClientManagement = 2050 { fabric command access(invoke: administer) RemoveEndpoint(RemoveEndpointRequest): DefaultSuccess = 4; } +/** This field SHALL indicate the Power Threshold Information. */ +provisional cluster MeterIdentification = 2822 { + revision 1; + + enum MeterTypeEnum : enum8 { + kUtility = 0; + kPrivate = 1; + kGeneric = 2; + } + + enum PowerThresholdSourceEnum : enum8 { + kContract = 0; + kRegulator = 1; + kEquipment = 2; + } + + bitmap Feature : bitmap32 { + kPowerThreshold = 0x1; + } + + struct PowerThresholdStruct { + optional int64s powerThreshold = 0; + optional int64s apparentPowerThreshold = 1; + nullable PowerThresholdSourceEnum powerThresholdSource = 2; + } + + readonly attribute nullable MeterTypeEnum meterType = 0; + readonly attribute nullable char_string<64> pointOfDelivery = 1; + readonly attribute nullable char_string<64> meterSerialNumber = 2; + readonly attribute optional nullable char_string<64> protocolVersion = 3; + readonly attribute optional nullable PowerThresholdStruct powerThreshold = 4; + 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; +} + /** The Test Cluster is meant to validate the generated code */ internal cluster UnitTesting = 4294048773 { revision 1; // NOTE: Default/not specifically set diff --git a/src/controller/java/generated/java/chip/devicecontroller/ChipClusters.java b/src/controller/java/generated/java/chip/devicecontroller/ChipClusters.java index d1f77aad4fe40c..2f36d3ec4cfc71 100644 --- a/src/controller/java/generated/java/chip/devicecontroller/ChipClusters.java +++ b/src/controller/java/generated/java/chip/devicecontroller/ChipClusters.java @@ -65994,6 +65994,354 @@ public void onSuccess(byte[] tlv) { } } + public static class MeterIdentificationCluster extends BaseChipCluster { + public static final long CLUSTER_ID = 2822L; + + private static final long METER_TYPE_ATTRIBUTE_ID = 0L; + private static final long POINT_OF_DELIVERY_ATTRIBUTE_ID = 1L; + private static final long METER_SERIAL_NUMBER_ATTRIBUTE_ID = 2L; + private static final long PROTOCOL_VERSION_ATTRIBUTE_ID = 3L; + private static final long POWER_THRESHOLD_ATTRIBUTE_ID = 4L; + private static final long GENERATED_COMMAND_LIST_ATTRIBUTE_ID = 65528L; + private static final long ACCEPTED_COMMAND_LIST_ATTRIBUTE_ID = 65529L; + private static final long EVENT_LIST_ATTRIBUTE_ID = 65530L; + private static final long ATTRIBUTE_LIST_ATTRIBUTE_ID = 65531L; + private static final long FEATURE_MAP_ATTRIBUTE_ID = 65532L; + private static final long CLUSTER_REVISION_ATTRIBUTE_ID = 65533L; + + public MeterIdentificationCluster(long devicePtr, int endpointId) { + super(devicePtr, endpointId, CLUSTER_ID); + } + + @Override + @Deprecated + public long initWithDevice(long devicePtr, int endpointId) { + return 0L; + } + + public interface MeterTypeAttributeCallback extends BaseAttributeCallback { + void onSuccess(@Nullable Integer value); + } + + public interface PointOfDeliveryAttributeCallback extends BaseAttributeCallback { + void onSuccess(@Nullable String value); + } + + public interface MeterSerialNumberAttributeCallback extends BaseAttributeCallback { + void onSuccess(@Nullable String value); + } + + public interface ProtocolVersionAttributeCallback extends BaseAttributeCallback { + void onSuccess(@Nullable String value); + } + + public interface PowerThresholdAttributeCallback extends BaseAttributeCallback { + void onSuccess(@Nullable ChipStructs.MeterIdentificationClusterPowerThresholdStruct value); + } + + public interface GeneratedCommandListAttributeCallback extends BaseAttributeCallback { + void onSuccess(List<Long> value); + } + + public interface AcceptedCommandListAttributeCallback extends BaseAttributeCallback { + void onSuccess(List<Long> value); + } + + public interface EventListAttributeCallback extends BaseAttributeCallback { + void onSuccess(List<Long> value); + } + + public interface AttributeListAttributeCallback extends BaseAttributeCallback { + void onSuccess(List<Long> value); + } + + public void readMeterTypeAttribute( + MeterTypeAttributeCallback callback) { + ChipAttributePath path = ChipAttributePath.newInstance(endpointId, clusterId, METER_TYPE_ATTRIBUTE_ID); + + readAttribute(new ReportCallbackImpl(callback, path) { + @Override + public void onSuccess(byte[] tlv) { + @Nullable Integer value = ChipTLVValueDecoder.decodeAttributeValue(path, tlv); + callback.onSuccess(value); + } + }, METER_TYPE_ATTRIBUTE_ID, true); + } + + public void subscribeMeterTypeAttribute( + MeterTypeAttributeCallback callback, int minInterval, int maxInterval) { + ChipAttributePath path = ChipAttributePath.newInstance(endpointId, clusterId, METER_TYPE_ATTRIBUTE_ID); + + subscribeAttribute(new ReportCallbackImpl(callback, path) { + @Override + public void onSuccess(byte[] tlv) { + @Nullable Integer value = ChipTLVValueDecoder.decodeAttributeValue(path, tlv); + callback.onSuccess(value); + } + }, METER_TYPE_ATTRIBUTE_ID, minInterval, maxInterval); + } + + public void readPointOfDeliveryAttribute( + PointOfDeliveryAttributeCallback callback) { + ChipAttributePath path = ChipAttributePath.newInstance(endpointId, clusterId, POINT_OF_DELIVERY_ATTRIBUTE_ID); + + readAttribute(new ReportCallbackImpl(callback, path) { + @Override + public void onSuccess(byte[] tlv) { + @Nullable String value = ChipTLVValueDecoder.decodeAttributeValue(path, tlv); + callback.onSuccess(value); + } + }, POINT_OF_DELIVERY_ATTRIBUTE_ID, true); + } + + public void subscribePointOfDeliveryAttribute( + PointOfDeliveryAttributeCallback callback, int minInterval, int maxInterval) { + ChipAttributePath path = ChipAttributePath.newInstance(endpointId, clusterId, POINT_OF_DELIVERY_ATTRIBUTE_ID); + + subscribeAttribute(new ReportCallbackImpl(callback, path) { + @Override + public void onSuccess(byte[] tlv) { + @Nullable String value = ChipTLVValueDecoder.decodeAttributeValue(path, tlv); + callback.onSuccess(value); + } + }, POINT_OF_DELIVERY_ATTRIBUTE_ID, minInterval, maxInterval); + } + + public void readMeterSerialNumberAttribute( + MeterSerialNumberAttributeCallback callback) { + ChipAttributePath path = ChipAttributePath.newInstance(endpointId, clusterId, METER_SERIAL_NUMBER_ATTRIBUTE_ID); + + readAttribute(new ReportCallbackImpl(callback, path) { + @Override + public void onSuccess(byte[] tlv) { + @Nullable String value = ChipTLVValueDecoder.decodeAttributeValue(path, tlv); + callback.onSuccess(value); + } + }, METER_SERIAL_NUMBER_ATTRIBUTE_ID, true); + } + + public void subscribeMeterSerialNumberAttribute( + MeterSerialNumberAttributeCallback callback, int minInterval, int maxInterval) { + ChipAttributePath path = ChipAttributePath.newInstance(endpointId, clusterId, METER_SERIAL_NUMBER_ATTRIBUTE_ID); + + subscribeAttribute(new ReportCallbackImpl(callback, path) { + @Override + public void onSuccess(byte[] tlv) { + @Nullable String value = ChipTLVValueDecoder.decodeAttributeValue(path, tlv); + callback.onSuccess(value); + } + }, METER_SERIAL_NUMBER_ATTRIBUTE_ID, minInterval, maxInterval); + } + + public void readProtocolVersionAttribute( + ProtocolVersionAttributeCallback callback) { + ChipAttributePath path = ChipAttributePath.newInstance(endpointId, clusterId, PROTOCOL_VERSION_ATTRIBUTE_ID); + + readAttribute(new ReportCallbackImpl(callback, path) { + @Override + public void onSuccess(byte[] tlv) { + @Nullable String value = ChipTLVValueDecoder.decodeAttributeValue(path, tlv); + callback.onSuccess(value); + } + }, PROTOCOL_VERSION_ATTRIBUTE_ID, true); + } + + public void subscribeProtocolVersionAttribute( + ProtocolVersionAttributeCallback callback, int minInterval, int maxInterval) { + ChipAttributePath path = ChipAttributePath.newInstance(endpointId, clusterId, PROTOCOL_VERSION_ATTRIBUTE_ID); + + subscribeAttribute(new ReportCallbackImpl(callback, path) { + @Override + public void onSuccess(byte[] tlv) { + @Nullable String value = ChipTLVValueDecoder.decodeAttributeValue(path, tlv); + callback.onSuccess(value); + } + }, PROTOCOL_VERSION_ATTRIBUTE_ID, minInterval, maxInterval); + } + + public void readPowerThresholdAttribute( + PowerThresholdAttributeCallback callback) { + ChipAttributePath path = ChipAttributePath.newInstance(endpointId, clusterId, POWER_THRESHOLD_ATTRIBUTE_ID); + + readAttribute(new ReportCallbackImpl(callback, path) { + @Override + public void onSuccess(byte[] tlv) { + @Nullable ChipStructs.MeterIdentificationClusterPowerThresholdStruct value = ChipTLVValueDecoder.decodeAttributeValue(path, tlv); + callback.onSuccess(value); + } + }, POWER_THRESHOLD_ATTRIBUTE_ID, true); + } + + public void subscribePowerThresholdAttribute( + PowerThresholdAttributeCallback callback, int minInterval, int maxInterval) { + ChipAttributePath path = ChipAttributePath.newInstance(endpointId, clusterId, POWER_THRESHOLD_ATTRIBUTE_ID); + + subscribeAttribute(new ReportCallbackImpl(callback, path) { + @Override + public void onSuccess(byte[] tlv) { + @Nullable ChipStructs.MeterIdentificationClusterPowerThresholdStruct value = ChipTLVValueDecoder.decodeAttributeValue(path, tlv); + callback.onSuccess(value); + } + }, POWER_THRESHOLD_ATTRIBUTE_ID, minInterval, maxInterval); + } + + public void readGeneratedCommandListAttribute( + GeneratedCommandListAttributeCallback callback) { + ChipAttributePath path = ChipAttributePath.newInstance(endpointId, clusterId, GENERATED_COMMAND_LIST_ATTRIBUTE_ID); + + readAttribute(new ReportCallbackImpl(callback, path) { + @Override + public void onSuccess(byte[] tlv) { + List<Long> value = ChipTLVValueDecoder.decodeAttributeValue(path, tlv); + callback.onSuccess(value); + } + }, GENERATED_COMMAND_LIST_ATTRIBUTE_ID, true); + } + + public void subscribeGeneratedCommandListAttribute( + GeneratedCommandListAttributeCallback callback, int minInterval, int maxInterval) { + ChipAttributePath path = ChipAttributePath.newInstance(endpointId, clusterId, GENERATED_COMMAND_LIST_ATTRIBUTE_ID); + + subscribeAttribute(new ReportCallbackImpl(callback, path) { + @Override + public void onSuccess(byte[] tlv) { + List<Long> value = ChipTLVValueDecoder.decodeAttributeValue(path, tlv); + callback.onSuccess(value); + } + }, GENERATED_COMMAND_LIST_ATTRIBUTE_ID, minInterval, maxInterval); + } + + public void readAcceptedCommandListAttribute( + AcceptedCommandListAttributeCallback callback) { + ChipAttributePath path = ChipAttributePath.newInstance(endpointId, clusterId, ACCEPTED_COMMAND_LIST_ATTRIBUTE_ID); + + readAttribute(new ReportCallbackImpl(callback, path) { + @Override + public void onSuccess(byte[] tlv) { + List<Long> value = ChipTLVValueDecoder.decodeAttributeValue(path, tlv); + callback.onSuccess(value); + } + }, ACCEPTED_COMMAND_LIST_ATTRIBUTE_ID, true); + } + + public void subscribeAcceptedCommandListAttribute( + AcceptedCommandListAttributeCallback callback, int minInterval, int maxInterval) { + ChipAttributePath path = ChipAttributePath.newInstance(endpointId, clusterId, ACCEPTED_COMMAND_LIST_ATTRIBUTE_ID); + + subscribeAttribute(new ReportCallbackImpl(callback, path) { + @Override + public void onSuccess(byte[] tlv) { + List<Long> value = ChipTLVValueDecoder.decodeAttributeValue(path, tlv); + callback.onSuccess(value); + } + }, ACCEPTED_COMMAND_LIST_ATTRIBUTE_ID, minInterval, maxInterval); + } + + public void readEventListAttribute( + EventListAttributeCallback callback) { + ChipAttributePath path = ChipAttributePath.newInstance(endpointId, clusterId, EVENT_LIST_ATTRIBUTE_ID); + + readAttribute(new ReportCallbackImpl(callback, path) { + @Override + public void onSuccess(byte[] tlv) { + List<Long> value = ChipTLVValueDecoder.decodeAttributeValue(path, tlv); + callback.onSuccess(value); + } + }, EVENT_LIST_ATTRIBUTE_ID, true); + } + + public void subscribeEventListAttribute( + EventListAttributeCallback callback, int minInterval, int maxInterval) { + ChipAttributePath path = ChipAttributePath.newInstance(endpointId, clusterId, EVENT_LIST_ATTRIBUTE_ID); + + subscribeAttribute(new ReportCallbackImpl(callback, path) { + @Override + public void onSuccess(byte[] tlv) { + List<Long> value = ChipTLVValueDecoder.decodeAttributeValue(path, tlv); + callback.onSuccess(value); + } + }, EVENT_LIST_ATTRIBUTE_ID, minInterval, maxInterval); + } + + public void readAttributeListAttribute( + AttributeListAttributeCallback callback) { + ChipAttributePath path = ChipAttributePath.newInstance(endpointId, clusterId, ATTRIBUTE_LIST_ATTRIBUTE_ID); + + readAttribute(new ReportCallbackImpl(callback, path) { + @Override + public void onSuccess(byte[] tlv) { + List<Long> value = ChipTLVValueDecoder.decodeAttributeValue(path, tlv); + callback.onSuccess(value); + } + }, ATTRIBUTE_LIST_ATTRIBUTE_ID, true); + } + + public void subscribeAttributeListAttribute( + AttributeListAttributeCallback callback, int minInterval, int maxInterval) { + ChipAttributePath path = ChipAttributePath.newInstance(endpointId, clusterId, ATTRIBUTE_LIST_ATTRIBUTE_ID); + + subscribeAttribute(new ReportCallbackImpl(callback, path) { + @Override + public void onSuccess(byte[] tlv) { + List<Long> value = ChipTLVValueDecoder.decodeAttributeValue(path, tlv); + callback.onSuccess(value); + } + }, ATTRIBUTE_LIST_ATTRIBUTE_ID, minInterval, maxInterval); + } + + public void readFeatureMapAttribute( + LongAttributeCallback callback) { + ChipAttributePath path = ChipAttributePath.newInstance(endpointId, clusterId, FEATURE_MAP_ATTRIBUTE_ID); + + readAttribute(new ReportCallbackImpl(callback, path) { + @Override + public void onSuccess(byte[] tlv) { + Long value = ChipTLVValueDecoder.decodeAttributeValue(path, tlv); + callback.onSuccess(value); + } + }, FEATURE_MAP_ATTRIBUTE_ID, true); + } + + public void subscribeFeatureMapAttribute( + LongAttributeCallback callback, int minInterval, int maxInterval) { + ChipAttributePath path = ChipAttributePath.newInstance(endpointId, clusterId, FEATURE_MAP_ATTRIBUTE_ID); + + subscribeAttribute(new ReportCallbackImpl(callback, path) { + @Override + public void onSuccess(byte[] tlv) { + Long value = ChipTLVValueDecoder.decodeAttributeValue(path, tlv); + callback.onSuccess(value); + } + }, FEATURE_MAP_ATTRIBUTE_ID, minInterval, maxInterval); + } + + public void readClusterRevisionAttribute( + IntegerAttributeCallback callback) { + ChipAttributePath path = ChipAttributePath.newInstance(endpointId, clusterId, CLUSTER_REVISION_ATTRIBUTE_ID); + + readAttribute(new ReportCallbackImpl(callback, path) { + @Override + public void onSuccess(byte[] tlv) { + Integer value = ChipTLVValueDecoder.decodeAttributeValue(path, tlv); + callback.onSuccess(value); + } + }, CLUSTER_REVISION_ATTRIBUTE_ID, true); + } + + public void subscribeClusterRevisionAttribute( + IntegerAttributeCallback callback, int minInterval, int maxInterval) { + ChipAttributePath path = ChipAttributePath.newInstance(endpointId, clusterId, CLUSTER_REVISION_ATTRIBUTE_ID); + + subscribeAttribute(new ReportCallbackImpl(callback, path) { + @Override + public void onSuccess(byte[] tlv) { + Integer value = ChipTLVValueDecoder.decodeAttributeValue(path, tlv); + callback.onSuccess(value); + } + }, CLUSTER_REVISION_ATTRIBUTE_ID, minInterval, maxInterval); + } + } + public static class UnitTestingCluster extends BaseChipCluster { public static final long CLUSTER_ID = 4294048773L; diff --git a/src/controller/java/generated/java/chip/devicecontroller/ChipStructs.java b/src/controller/java/generated/java/chip/devicecontroller/ChipStructs.java index 1d143d06981fa0..8077b12398d0a9 100644 --- a/src/controller/java/generated/java/chip/devicecontroller/ChipStructs.java +++ b/src/controller/java/generated/java/chip/devicecontroller/ChipStructs.java @@ -16407,6 +16407,82 @@ public String toString() { return output.toString(); } } +public static class MeterIdentificationClusterPowerThresholdStruct { + public Optional<Long> powerThreshold; + public Optional<Long> apparentPowerThreshold; + public @Nullable Integer powerThresholdSource; + private static final long POWER_THRESHOLD_ID = 0L; + private static final long APPARENT_POWER_THRESHOLD_ID = 1L; + private static final long POWER_THRESHOLD_SOURCE_ID = 2L; + + public MeterIdentificationClusterPowerThresholdStruct( + Optional<Long> powerThreshold, + Optional<Long> apparentPowerThreshold, + @Nullable Integer powerThresholdSource + ) { + this.powerThreshold = powerThreshold; + this.apparentPowerThreshold = apparentPowerThreshold; + this.powerThresholdSource = powerThresholdSource; + } + + public StructType encodeTlv() { + ArrayList<StructElement> values = new ArrayList<>(); + values.add(new StructElement(POWER_THRESHOLD_ID, powerThreshold.<BaseTLVType>map((nonOptionalpowerThreshold) -> new IntType(nonOptionalpowerThreshold)).orElse(new EmptyType()))); + values.add(new StructElement(APPARENT_POWER_THRESHOLD_ID, apparentPowerThreshold.<BaseTLVType>map((nonOptionalapparentPowerThreshold) -> new IntType(nonOptionalapparentPowerThreshold)).orElse(new EmptyType()))); + values.add(new StructElement(POWER_THRESHOLD_SOURCE_ID, powerThresholdSource != null ? new UIntType(powerThresholdSource) : new NullType())); + + return new StructType(values); + } + + public static MeterIdentificationClusterPowerThresholdStruct decodeTlv(BaseTLVType tlvValue) { + if (tlvValue == null || tlvValue.type() != TLVType.Struct) { + return null; + } + Optional<Long> powerThreshold = Optional.empty(); + Optional<Long> apparentPowerThreshold = Optional.empty(); + @Nullable Integer powerThresholdSource = null; + for (StructElement element: ((StructType)tlvValue).value()) { + if (element.contextTagNum() == POWER_THRESHOLD_ID) { + if (element.value(BaseTLVType.class).type() == TLVType.Int) { + IntType castingValue = element.value(IntType.class); + powerThreshold = Optional.of(castingValue.value(Long.class)); + } + } else if (element.contextTagNum() == APPARENT_POWER_THRESHOLD_ID) { + if (element.value(BaseTLVType.class).type() == TLVType.Int) { + IntType castingValue = element.value(IntType.class); + apparentPowerThreshold = Optional.of(castingValue.value(Long.class)); + } + } else if (element.contextTagNum() == POWER_THRESHOLD_SOURCE_ID) { + if (element.value(BaseTLVType.class).type() == TLVType.UInt) { + UIntType castingValue = element.value(UIntType.class); + powerThresholdSource = castingValue.value(Integer.class); + } + } + } + return new MeterIdentificationClusterPowerThresholdStruct( + powerThreshold, + apparentPowerThreshold, + powerThresholdSource + ); + } + + @Override + public String toString() { + StringBuilder output = new StringBuilder(); + output.append("MeterIdentificationClusterPowerThresholdStruct {\n"); + output.append("\tpowerThreshold: "); + output.append(powerThreshold); + output.append("\n"); + output.append("\tapparentPowerThreshold: "); + output.append(apparentPowerThreshold); + output.append("\n"); + output.append("\tpowerThresholdSource: "); + output.append(powerThresholdSource); + output.append("\n"); + output.append("}\n"); + return output.toString(); + } +} public static class UnitTestingClusterSimpleStruct { public Integer a; public Boolean b; diff --git a/src/controller/java/generated/java/chip/devicecontroller/ClusterIDMapping.java b/src/controller/java/generated/java/chip/devicecontroller/ClusterIDMapping.java index aa5da082e6449a..5ce9fdbb2d0136 100644 --- a/src/controller/java/generated/java/chip/devicecontroller/ClusterIDMapping.java +++ b/src/controller/java/generated/java/chip/devicecontroller/ClusterIDMapping.java @@ -415,6 +415,9 @@ public static BaseCluster getCluster(long clusterId) { if (clusterId == TlsClientManagement.ID) { return new TlsClientManagement(); } + if (clusterId == MeterIdentification.ID) { + return new MeterIdentification(); + } if (clusterId == UnitTesting.ID) { return new UnitTesting(); } @@ -19165,6 +19168,111 @@ public long getCommandID(String name) throws IllegalArgumentException { return Command.valueOf(name).getID(); } } + public static class MeterIdentification implements BaseCluster { + public static final long ID = 2822L; + public long getID() { + return ID; + } + + public enum Attribute { + MeterType(0L), + PointOfDelivery(1L), + MeterSerialNumber(2L), + ProtocolVersion(3L), + PowerThreshold(4L), + GeneratedCommandList(65528L), + AcceptedCommandList(65529L), + EventList(65530L), + AttributeList(65531L), + FeatureMap(65532L), + ClusterRevision(65533L),; + private final long id; + Attribute(long id) { + this.id = id; + } + + public long getID() { + return id; + } + + public static Attribute value(long id) throws NoSuchFieldError { + for (Attribute attribute : Attribute.values()) { + if (attribute.getID() == id) { + return attribute; + } + } + throw new NoSuchFieldError(); + } + } + + public enum Event {; + private final long id; + Event(long id) { + this.id = id; + } + + public long getID() { + return id; + } + + public static Event value(long id) throws NoSuchFieldError { + for (Event event : Event.values()) { + if (event.getID() == id) { + return event; + } + } + throw new NoSuchFieldError(); + } + } + + public enum Command {; + private final long id; + Command(long id) { + this.id = id; + } + + public long getID() { + return id; + } + + public static Command value(long id) throws NoSuchFieldError { + for (Command command : Command.values()) { + if (command.getID() == id) { + return command; + } + } + throw new NoSuchFieldError(); + } + }@Override + public String getAttributeName(long id) throws NoSuchFieldError { + return Attribute.value(id).toString(); + } + + @Override + public String getEventName(long id) throws NoSuchFieldError { + return Event.value(id).toString(); + } + + @Override + public String getCommandName(long id) throws NoSuchFieldError { + return Command.value(id).toString(); + } + + @Override + public long getAttributeID(String name) throws IllegalArgumentException { + return Attribute.valueOf(name).getID(); + } + + @Override + public long getEventID(String name) throws IllegalArgumentException { + return Event.valueOf(name).getID(); + } + + @Override + public long getCommandID(String name) throws IllegalArgumentException { + return Command.valueOf(name).getID(); + } + } public static class UnitTesting implements BaseCluster { public static final long ID = 4294048773L; public long getID() { diff --git a/src/controller/java/generated/java/chip/devicecontroller/ClusterInfoMapping.java b/src/controller/java/generated/java/chip/devicecontroller/ClusterInfoMapping.java index 113194d569af5c..47386507bb46c2 100644 --- a/src/controller/java/generated/java/chip/devicecontroller/ClusterInfoMapping.java +++ b/src/controller/java/generated/java/chip/devicecontroller/ClusterInfoMapping.java @@ -22027,6 +22027,195 @@ public void onError(Exception ex) { } } + public static class DelegatedMeterIdentificationClusterMeterTypeAttributeCallback implements ChipClusters.MeterIdentificationCluster.MeterTypeAttributeCallback, DelegatedClusterCallback { + private ClusterCommandCallback callback; + @Override + public void setCallbackDelegate(ClusterCommandCallback callback) { + this.callback = callback; + } + + @Override + public void onSuccess(@Nullable Integer value) { + Map<CommandResponseInfo, Object> responseValues = new LinkedHashMap<>(); + CommandResponseInfo commandResponseInfo = new CommandResponseInfo("value", "Integer"); + responseValues.put(commandResponseInfo, value); + callback.onSuccess(responseValues); + } + + @Override + public void onError(Exception ex) { + callback.onFailure(ex); + } + } + + public static class DelegatedMeterIdentificationClusterPointOfDeliveryAttributeCallback implements ChipClusters.MeterIdentificationCluster.PointOfDeliveryAttributeCallback, DelegatedClusterCallback { + private ClusterCommandCallback callback; + @Override + public void setCallbackDelegate(ClusterCommandCallback callback) { + this.callback = callback; + } + + @Override + public void onSuccess(@Nullable String value) { + Map<CommandResponseInfo, Object> responseValues = new LinkedHashMap<>(); + CommandResponseInfo commandResponseInfo = new CommandResponseInfo("value", "String"); + responseValues.put(commandResponseInfo, value); + callback.onSuccess(responseValues); + } + + @Override + public void onError(Exception ex) { + callback.onFailure(ex); + } + } + + public static class DelegatedMeterIdentificationClusterMeterSerialNumberAttributeCallback implements ChipClusters.MeterIdentificationCluster.MeterSerialNumberAttributeCallback, DelegatedClusterCallback { + private ClusterCommandCallback callback; + @Override + public void setCallbackDelegate(ClusterCommandCallback callback) { + this.callback = callback; + } + + @Override + public void onSuccess(@Nullable String value) { + Map<CommandResponseInfo, Object> responseValues = new LinkedHashMap<>(); + CommandResponseInfo commandResponseInfo = new CommandResponseInfo("value", "String"); + responseValues.put(commandResponseInfo, value); + callback.onSuccess(responseValues); + } + + @Override + public void onError(Exception ex) { + callback.onFailure(ex); + } + } + + public static class DelegatedMeterIdentificationClusterProtocolVersionAttributeCallback implements ChipClusters.MeterIdentificationCluster.ProtocolVersionAttributeCallback, DelegatedClusterCallback { + private ClusterCommandCallback callback; + @Override + public void setCallbackDelegate(ClusterCommandCallback callback) { + this.callback = callback; + } + + @Override + public void onSuccess(@Nullable String value) { + Map<CommandResponseInfo, Object> responseValues = new LinkedHashMap<>(); + CommandResponseInfo commandResponseInfo = new CommandResponseInfo("value", "String"); + responseValues.put(commandResponseInfo, value); + callback.onSuccess(responseValues); + } + + @Override + public void onError(Exception ex) { + callback.onFailure(ex); + } + } + + public static class DelegatedMeterIdentificationClusterPowerThresholdAttributeCallback implements ChipClusters.MeterIdentificationCluster.PowerThresholdAttributeCallback, DelegatedClusterCallback { + private ClusterCommandCallback callback; + @Override + public void setCallbackDelegate(ClusterCommandCallback callback) { + this.callback = callback; + } + + @Override + public void onSuccess(@Nullable ChipStructs.MeterIdentificationClusterPowerThresholdStruct value) { + Map<CommandResponseInfo, Object> responseValues = new LinkedHashMap<>(); + CommandResponseInfo commandResponseInfo = new CommandResponseInfo("value", "ChipStructs.MeterIdentificationClusterPowerThresholdStruct"); + responseValues.put(commandResponseInfo, value); + callback.onSuccess(responseValues); + } + + @Override + public void onError(Exception ex) { + callback.onFailure(ex); + } + } + + public static class DelegatedMeterIdentificationClusterGeneratedCommandListAttributeCallback implements ChipClusters.MeterIdentificationCluster.GeneratedCommandListAttributeCallback, DelegatedClusterCallback { + private ClusterCommandCallback callback; + @Override + public void setCallbackDelegate(ClusterCommandCallback callback) { + this.callback = callback; + } + + @Override + public void onSuccess(List<Long> valueList) { + Map<CommandResponseInfo, Object> responseValues = new LinkedHashMap<>(); + CommandResponseInfo commandResponseInfo = new CommandResponseInfo("valueList", "List<Long>"); + responseValues.put(commandResponseInfo, valueList); + callback.onSuccess(responseValues); + } + + @Override + public void onError(Exception ex) { + callback.onFailure(ex); + } + } + + public static class DelegatedMeterIdentificationClusterAcceptedCommandListAttributeCallback implements ChipClusters.MeterIdentificationCluster.AcceptedCommandListAttributeCallback, DelegatedClusterCallback { + private ClusterCommandCallback callback; + @Override + public void setCallbackDelegate(ClusterCommandCallback callback) { + this.callback = callback; + } + + @Override + public void onSuccess(List<Long> valueList) { + Map<CommandResponseInfo, Object> responseValues = new LinkedHashMap<>(); + CommandResponseInfo commandResponseInfo = new CommandResponseInfo("valueList", "List<Long>"); + responseValues.put(commandResponseInfo, valueList); + callback.onSuccess(responseValues); + } + + @Override + public void onError(Exception ex) { + callback.onFailure(ex); + } + } + + public static class DelegatedMeterIdentificationClusterEventListAttributeCallback implements ChipClusters.MeterIdentificationCluster.EventListAttributeCallback, DelegatedClusterCallback { + private ClusterCommandCallback callback; + @Override + public void setCallbackDelegate(ClusterCommandCallback callback) { + this.callback = callback; + } + + @Override + public void onSuccess(List<Long> valueList) { + Map<CommandResponseInfo, Object> responseValues = new LinkedHashMap<>(); + CommandResponseInfo commandResponseInfo = new CommandResponseInfo("valueList", "List<Long>"); + responseValues.put(commandResponseInfo, valueList); + callback.onSuccess(responseValues); + } + + @Override + public void onError(Exception ex) { + callback.onFailure(ex); + } + } + + public static class DelegatedMeterIdentificationClusterAttributeListAttributeCallback implements ChipClusters.MeterIdentificationCluster.AttributeListAttributeCallback, DelegatedClusterCallback { + private ClusterCommandCallback callback; + @Override + public void setCallbackDelegate(ClusterCommandCallback callback) { + this.callback = callback; + } + + @Override + public void onSuccess(List<Long> valueList) { + Map<CommandResponseInfo, Object> responseValues = new LinkedHashMap<>(); + CommandResponseInfo commandResponseInfo = new CommandResponseInfo("valueList", "List<Long>"); + responseValues.put(commandResponseInfo, valueList); + callback.onSuccess(responseValues); + } + + @Override + public void onError(Exception ex) { + callback.onFailure(ex); + } + } + public static class DelegatedUnitTestingClusterTestSpecificResponseCallback implements ChipClusters.UnitTestingCluster.TestSpecificResponseCallback, DelegatedClusterCallback { private ClusterCommandCallback callback; @@ -24171,6 +24360,10 @@ public Map<String, ClusterInfo> initializeClusterMap() { (ptr, endpointId) -> new ChipClusters.TlsClientManagementCluster(ptr, endpointId), new HashMap<>()); clusterMap.put("tlsClientManagement", tlsClientManagementClusterInfo); + ClusterInfo meterIdentificationClusterInfo = new ClusterInfo( + (ptr, endpointId) -> new ChipClusters.MeterIdentificationCluster(ptr, endpointId), new HashMap<>()); + clusterMap.put("meterIdentification", meterIdentificationClusterInfo); + ClusterInfo unitTestingClusterInfo = new ClusterInfo( (ptr, endpointId) -> new ChipClusters.UnitTestingCluster(ptr, endpointId), new HashMap<>()); clusterMap.put("unitTesting", unitTestingClusterInfo); @@ -24316,6 +24509,7 @@ public void combineCommand(Map<String, ClusterInfo> destination, Map<String, Map destination.get("commissionerControl").combineCommands(source.get("commissionerControl")); destination.get("tlsCertificateManagement").combineCommands(source.get("tlsCertificateManagement")); destination.get("tlsClientManagement").combineCommands(source.get("tlsClientManagement")); + destination.get("meterIdentification").combineCommands(source.get("meterIdentification")); destination.get("unitTesting").combineCommands(source.get("unitTesting")); destination.get("faultInjection").combineCommands(source.get("faultInjection")); destination.get("sampleMei").combineCommands(source.get("sampleMei")); @@ -31924,6 +32118,10 @@ public Map<String, Map<String, InteractionInfo>> getCommandMap() { commandMap.put("tlsClientManagement", tlsClientManagementClusterInteractionInfoMap); + Map<String, InteractionInfo> meterIdentificationClusterInteractionInfoMap = new LinkedHashMap<>(); + + commandMap.put("meterIdentification", meterIdentificationClusterInteractionInfoMap); + Map<String, InteractionInfo> unitTestingClusterInteractionInfoMap = new LinkedHashMap<>(); Map<String, CommandParameterInfo> unitTestingtestCommandParams = new LinkedHashMap<String, CommandParameterInfo>(); diff --git a/src/controller/java/generated/java/chip/devicecontroller/ClusterReadMapping.java b/src/controller/java/generated/java/chip/devicecontroller/ClusterReadMapping.java index 8a8be3a220d8d1..646500cd04ae80 100644 --- a/src/controller/java/generated/java/chip/devicecontroller/ClusterReadMapping.java +++ b/src/controller/java/generated/java/chip/devicecontroller/ClusterReadMapping.java @@ -19824,6 +19824,120 @@ private static Map<String, InteractionInfo> readTlsClientManagementInteractionIn return result; } + private static Map<String, InteractionInfo> readMeterIdentificationInteractionInfo() { + Map<String, InteractionInfo> result = new LinkedHashMap<>();Map<String, CommandParameterInfo> readMeterIdentificationMeterTypeCommandParams = new LinkedHashMap<String, CommandParameterInfo>(); + InteractionInfo readMeterIdentificationMeterTypeAttributeInteractionInfo = new InteractionInfo( + (cluster, callback, commandArguments) -> { + ((ChipClusters.MeterIdentificationCluster) cluster).readMeterTypeAttribute( + (ChipClusters.MeterIdentificationCluster.MeterTypeAttributeCallback) callback + ); + }, + () -> new ClusterInfoMapping.DelegatedMeterIdentificationClusterMeterTypeAttributeCallback(), + readMeterIdentificationMeterTypeCommandParams + ); + result.put("readMeterTypeAttribute", readMeterIdentificationMeterTypeAttributeInteractionInfo); + Map<String, CommandParameterInfo> readMeterIdentificationPointOfDeliveryCommandParams = new LinkedHashMap<String, CommandParameterInfo>(); + InteractionInfo readMeterIdentificationPointOfDeliveryAttributeInteractionInfo = new InteractionInfo( + (cluster, callback, commandArguments) -> { + ((ChipClusters.MeterIdentificationCluster) cluster).readPointOfDeliveryAttribute( + (ChipClusters.MeterIdentificationCluster.PointOfDeliveryAttributeCallback) callback + ); + }, + () -> new ClusterInfoMapping.DelegatedMeterIdentificationClusterPointOfDeliveryAttributeCallback(), + readMeterIdentificationPointOfDeliveryCommandParams + ); + result.put("readPointOfDeliveryAttribute", readMeterIdentificationPointOfDeliveryAttributeInteractionInfo); + Map<String, CommandParameterInfo> readMeterIdentificationMeterSerialNumberCommandParams = new LinkedHashMap<String, CommandParameterInfo>(); + InteractionInfo readMeterIdentificationMeterSerialNumberAttributeInteractionInfo = new InteractionInfo( + (cluster, callback, commandArguments) -> { + ((ChipClusters.MeterIdentificationCluster) cluster).readMeterSerialNumberAttribute( + (ChipClusters.MeterIdentificationCluster.MeterSerialNumberAttributeCallback) callback + ); + }, + () -> new ClusterInfoMapping.DelegatedMeterIdentificationClusterMeterSerialNumberAttributeCallback(), + readMeterIdentificationMeterSerialNumberCommandParams + ); + result.put("readMeterSerialNumberAttribute", readMeterIdentificationMeterSerialNumberAttributeInteractionInfo); + Map<String, CommandParameterInfo> readMeterIdentificationProtocolVersionCommandParams = new LinkedHashMap<String, CommandParameterInfo>(); + InteractionInfo readMeterIdentificationProtocolVersionAttributeInteractionInfo = new InteractionInfo( + (cluster, callback, commandArguments) -> { + ((ChipClusters.MeterIdentificationCluster) cluster).readProtocolVersionAttribute( + (ChipClusters.MeterIdentificationCluster.ProtocolVersionAttributeCallback) callback + ); + }, + () -> new ClusterInfoMapping.DelegatedMeterIdentificationClusterProtocolVersionAttributeCallback(), + readMeterIdentificationProtocolVersionCommandParams + ); + result.put("readProtocolVersionAttribute", readMeterIdentificationProtocolVersionAttributeInteractionInfo); + Map<String, CommandParameterInfo> readMeterIdentificationGeneratedCommandListCommandParams = new LinkedHashMap<String, CommandParameterInfo>(); + InteractionInfo readMeterIdentificationGeneratedCommandListAttributeInteractionInfo = new InteractionInfo( + (cluster, callback, commandArguments) -> { + ((ChipClusters.MeterIdentificationCluster) cluster).readGeneratedCommandListAttribute( + (ChipClusters.MeterIdentificationCluster.GeneratedCommandListAttributeCallback) callback + ); + }, + () -> new ClusterInfoMapping.DelegatedMeterIdentificationClusterGeneratedCommandListAttributeCallback(), + readMeterIdentificationGeneratedCommandListCommandParams + ); + result.put("readGeneratedCommandListAttribute", readMeterIdentificationGeneratedCommandListAttributeInteractionInfo); + Map<String, CommandParameterInfo> readMeterIdentificationAcceptedCommandListCommandParams = new LinkedHashMap<String, CommandParameterInfo>(); + InteractionInfo readMeterIdentificationAcceptedCommandListAttributeInteractionInfo = new InteractionInfo( + (cluster, callback, commandArguments) -> { + ((ChipClusters.MeterIdentificationCluster) cluster).readAcceptedCommandListAttribute( + (ChipClusters.MeterIdentificationCluster.AcceptedCommandListAttributeCallback) callback + ); + }, + () -> new ClusterInfoMapping.DelegatedMeterIdentificationClusterAcceptedCommandListAttributeCallback(), + readMeterIdentificationAcceptedCommandListCommandParams + ); + result.put("readAcceptedCommandListAttribute", readMeterIdentificationAcceptedCommandListAttributeInteractionInfo); + Map<String, CommandParameterInfo> readMeterIdentificationEventListCommandParams = new LinkedHashMap<String, CommandParameterInfo>(); + InteractionInfo readMeterIdentificationEventListAttributeInteractionInfo = new InteractionInfo( + (cluster, callback, commandArguments) -> { + ((ChipClusters.MeterIdentificationCluster) cluster).readEventListAttribute( + (ChipClusters.MeterIdentificationCluster.EventListAttributeCallback) callback + ); + }, + () -> new ClusterInfoMapping.DelegatedMeterIdentificationClusterEventListAttributeCallback(), + readMeterIdentificationEventListCommandParams + ); + result.put("readEventListAttribute", readMeterIdentificationEventListAttributeInteractionInfo); + Map<String, CommandParameterInfo> readMeterIdentificationAttributeListCommandParams = new LinkedHashMap<String, CommandParameterInfo>(); + InteractionInfo readMeterIdentificationAttributeListAttributeInteractionInfo = new InteractionInfo( + (cluster, callback, commandArguments) -> { + ((ChipClusters.MeterIdentificationCluster) cluster).readAttributeListAttribute( + (ChipClusters.MeterIdentificationCluster.AttributeListAttributeCallback) callback + ); + }, + () -> new ClusterInfoMapping.DelegatedMeterIdentificationClusterAttributeListAttributeCallback(), + readMeterIdentificationAttributeListCommandParams + ); + result.put("readAttributeListAttribute", readMeterIdentificationAttributeListAttributeInteractionInfo); + Map<String, CommandParameterInfo> readMeterIdentificationFeatureMapCommandParams = new LinkedHashMap<String, CommandParameterInfo>(); + InteractionInfo readMeterIdentificationFeatureMapAttributeInteractionInfo = new InteractionInfo( + (cluster, callback, commandArguments) -> { + ((ChipClusters.MeterIdentificationCluster) cluster).readFeatureMapAttribute( + (ChipClusters.LongAttributeCallback) callback + ); + }, + () -> new ClusterInfoMapping.DelegatedLongAttributeCallback(), + readMeterIdentificationFeatureMapCommandParams + ); + result.put("readFeatureMapAttribute", readMeterIdentificationFeatureMapAttributeInteractionInfo); + Map<String, CommandParameterInfo> readMeterIdentificationClusterRevisionCommandParams = new LinkedHashMap<String, CommandParameterInfo>(); + InteractionInfo readMeterIdentificationClusterRevisionAttributeInteractionInfo = new InteractionInfo( + (cluster, callback, commandArguments) -> { + ((ChipClusters.MeterIdentificationCluster) cluster).readClusterRevisionAttribute( + (ChipClusters.IntegerAttributeCallback) callback + ); + }, + () -> new ClusterInfoMapping.DelegatedIntegerAttributeCallback(), + readMeterIdentificationClusterRevisionCommandParams + ); + result.put("readClusterRevisionAttribute", readMeterIdentificationClusterRevisionAttributeInteractionInfo); + + return result; + } private static Map<String, InteractionInfo> readUnitTestingInteractionInfo() { Map<String, InteractionInfo> result = new LinkedHashMap<>();Map<String, CommandParameterInfo> readUnitTestingBooleanCommandParams = new LinkedHashMap<String, CommandParameterInfo>(); InteractionInfo readUnitTestingBooleanAttributeInteractionInfo = new InteractionInfo( @@ -21113,6 +21227,7 @@ public Map<String, Map<String, InteractionInfo>> getReadAttributeMap() { put("commissionerControl", readCommissionerControlInteractionInfo()); put("tlsCertificateManagement", readTlsCertificateManagementInteractionInfo()); put("tlsClientManagement", readTlsClientManagementInteractionInfo()); + put("meterIdentification", readMeterIdentificationInteractionInfo()); put("unitTesting", readUnitTestingInteractionInfo()); put("faultInjection", readFaultInjectionInteractionInfo()); put("sampleMei", readSampleMeiInteractionInfo());}}; diff --git a/src/controller/java/generated/java/chip/devicecontroller/ClusterWriteMapping.java b/src/controller/java/generated/java/chip/devicecontroller/ClusterWriteMapping.java index 40a1f7c428e471..baad151c329096 100644 --- a/src/controller/java/generated/java/chip/devicecontroller/ClusterWriteMapping.java +++ b/src/controller/java/generated/java/chip/devicecontroller/ClusterWriteMapping.java @@ -3804,6 +3804,8 @@ public Map<String, Map<String, InteractionInfo>> getWriteAttributeMap() { writeAttributeMap.put("tlsCertificateManagement", writeTlsCertificateManagementInteractionInfo); Map<String, InteractionInfo> writeTlsClientManagementInteractionInfo = new LinkedHashMap<>(); writeAttributeMap.put("tlsClientManagement", writeTlsClientManagementInteractionInfo); + Map<String, InteractionInfo> writeMeterIdentificationInteractionInfo = new LinkedHashMap<>(); + writeAttributeMap.put("meterIdentification", writeMeterIdentificationInteractionInfo); Map<String, InteractionInfo> writeUnitTestingInteractionInfo = new LinkedHashMap<>(); Map<String, CommandParameterInfo> writeUnitTestingBooleanCommandParams = new LinkedHashMap<String, CommandParameterInfo>(); CommandParameterInfo unitTestingbooleanCommandParameterInfo = diff --git a/src/controller/java/generated/java/chip/devicecontroller/cluster/files.gni b/src/controller/java/generated/java/chip/devicecontroller/cluster/files.gni index 73a9e7aa6614d4..fb158e0edbce70 100644 --- a/src/controller/java/generated/java/chip/devicecontroller/cluster/files.gni +++ b/src/controller/java/generated/java/chip/devicecontroller/cluster/files.gni @@ -107,6 +107,7 @@ structs_sources = [ "${chip_root}/src/controller/java/generated/java/chip/devicecontroller/cluster/structs/MediaPlaybackClusterTrackStruct.kt", "${chip_root}/src/controller/java/generated/java/chip/devicecontroller/cluster/structs/MessagesClusterMessageResponseOptionStruct.kt", "${chip_root}/src/controller/java/generated/java/chip/devicecontroller/cluster/structs/MessagesClusterMessageStruct.kt", + "${chip_root}/src/controller/java/generated/java/chip/devicecontroller/cluster/structs/MeterIdentificationClusterPowerThresholdStruct.kt", "${chip_root}/src/controller/java/generated/java/chip/devicecontroller/cluster/structs/MicrowaveOvenModeClusterModeOptionStruct.kt", "${chip_root}/src/controller/java/generated/java/chip/devicecontroller/cluster/structs/MicrowaveOvenModeClusterModeTagStruct.kt", "${chip_root}/src/controller/java/generated/java/chip/devicecontroller/cluster/structs/ModeSelectClusterModeOptionStruct.kt", diff --git a/src/controller/java/generated/java/chip/devicecontroller/cluster/structs/MeterIdentificationClusterPowerThresholdStruct.kt b/src/controller/java/generated/java/chip/devicecontroller/cluster/structs/MeterIdentificationClusterPowerThresholdStruct.kt new file mode 100644 index 00000000000000..ebbd955ea4bd38 --- /dev/null +++ b/src/controller/java/generated/java/chip/devicecontroller/cluster/structs/MeterIdentificationClusterPowerThresholdStruct.kt @@ -0,0 +1,95 @@ +/* + * + * Copyright (c) 2023 Project CHIP Authors + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package chip.devicecontroller.cluster.structs + +import chip.devicecontroller.cluster.* +import java.util.Optional +import matter.tlv.ContextSpecificTag +import matter.tlv.Tag +import matter.tlv.TlvReader +import matter.tlv.TlvWriter + +class MeterIdentificationClusterPowerThresholdStruct( + val powerThreshold: Optional<Long>, + val apparentPowerThreshold: Optional<Long>, + val powerThresholdSource: UInt?, +) { + override fun toString(): String = buildString { + append("MeterIdentificationClusterPowerThresholdStruct {\n") + append("\tpowerThreshold : $powerThreshold\n") + append("\tapparentPowerThreshold : $apparentPowerThreshold\n") + append("\tpowerThresholdSource : $powerThresholdSource\n") + append("}\n") + } + + fun toTlv(tlvTag: Tag, tlvWriter: TlvWriter) { + tlvWriter.apply { + startStructure(tlvTag) + if (powerThreshold.isPresent) { + val optpowerThreshold = powerThreshold.get() + put(ContextSpecificTag(TAG_POWER_THRESHOLD), optpowerThreshold) + } + if (apparentPowerThreshold.isPresent) { + val optapparentPowerThreshold = apparentPowerThreshold.get() + put(ContextSpecificTag(TAG_APPARENT_POWER_THRESHOLD), optapparentPowerThreshold) + } + if (powerThresholdSource != null) { + put(ContextSpecificTag(TAG_POWER_THRESHOLD_SOURCE), powerThresholdSource) + } else { + putNull(ContextSpecificTag(TAG_POWER_THRESHOLD_SOURCE)) + } + endStructure() + } + } + + companion object { + private const val TAG_POWER_THRESHOLD = 0 + private const val TAG_APPARENT_POWER_THRESHOLD = 1 + private const val TAG_POWER_THRESHOLD_SOURCE = 2 + + fun fromTlv(tlvTag: Tag, tlvReader: TlvReader): MeterIdentificationClusterPowerThresholdStruct { + tlvReader.enterStructure(tlvTag) + val powerThreshold = + if (tlvReader.isNextTag(ContextSpecificTag(TAG_POWER_THRESHOLD))) { + Optional.of(tlvReader.getLong(ContextSpecificTag(TAG_POWER_THRESHOLD))) + } else { + Optional.empty() + } + val apparentPowerThreshold = + if (tlvReader.isNextTag(ContextSpecificTag(TAG_APPARENT_POWER_THRESHOLD))) { + Optional.of(tlvReader.getLong(ContextSpecificTag(TAG_APPARENT_POWER_THRESHOLD))) + } else { + Optional.empty() + } + val powerThresholdSource = + if (!tlvReader.isNull()) { + tlvReader.getUInt(ContextSpecificTag(TAG_POWER_THRESHOLD_SOURCE)) + } else { + tlvReader.getNull(ContextSpecificTag(TAG_POWER_THRESHOLD_SOURCE)) + null + } + + tlvReader.exitContainer() + + return MeterIdentificationClusterPowerThresholdStruct( + powerThreshold, + apparentPowerThreshold, + powerThresholdSource, + ) + } + } +} diff --git a/src/controller/java/generated/java/matter/controller/cluster/clusters/MeterIdentificationCluster.kt b/src/controller/java/generated/java/matter/controller/cluster/clusters/MeterIdentificationCluster.kt new file mode 100644 index 00000000000000..c0a0c581efb337 --- /dev/null +++ b/src/controller/java/generated/java/matter/controller/cluster/clusters/MeterIdentificationCluster.kt @@ -0,0 +1,1173 @@ +/* + * + * Copyright (c) 2023 Project CHIP Authors + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package matter.controller.cluster.clusters + +import java.time.Duration +import java.util.logging.Level +import java.util.logging.Logger +import kotlinx.coroutines.flow.Flow +import kotlinx.coroutines.flow.transform +import matter.controller.MatterController +import matter.controller.ReadData +import matter.controller.ReadRequest +import matter.controller.SubscribeRequest +import matter.controller.SubscriptionState +import matter.controller.UIntSubscriptionState +import matter.controller.UShortSubscriptionState +import matter.controller.cluster.structs.* +import matter.controller.model.AttributePath +import matter.tlv.AnonymousTag +import matter.tlv.TlvReader + +class MeterIdentificationCluster( + private val controller: MatterController, + private val endpointId: UShort, +) { + class MeterTypeAttribute(val value: UByte?) + + sealed class MeterTypeAttributeSubscriptionState { + data class Success(val value: UByte?) : MeterTypeAttributeSubscriptionState() + + data class Error(val exception: Exception) : MeterTypeAttributeSubscriptionState() + + object SubscriptionEstablished : MeterTypeAttributeSubscriptionState() + } + + class PointOfDeliveryAttribute(val value: String?) + + sealed class PointOfDeliveryAttributeSubscriptionState { + data class Success(val value: String?) : PointOfDeliveryAttributeSubscriptionState() + + data class Error(val exception: Exception) : PointOfDeliveryAttributeSubscriptionState() + + object SubscriptionEstablished : PointOfDeliveryAttributeSubscriptionState() + } + + class MeterSerialNumberAttribute(val value: String?) + + sealed class MeterSerialNumberAttributeSubscriptionState { + data class Success(val value: String?) : MeterSerialNumberAttributeSubscriptionState() + + data class Error(val exception: Exception) : MeterSerialNumberAttributeSubscriptionState() + + object SubscriptionEstablished : MeterSerialNumberAttributeSubscriptionState() + } + + class ProtocolVersionAttribute(val value: String?) + + sealed class ProtocolVersionAttributeSubscriptionState { + data class Success(val value: String?) : ProtocolVersionAttributeSubscriptionState() + + data class Error(val exception: Exception) : ProtocolVersionAttributeSubscriptionState() + + object SubscriptionEstablished : ProtocolVersionAttributeSubscriptionState() + } + + class PowerThresholdAttribute(val value: MeterIdentificationClusterPowerThresholdStruct?) + + sealed class PowerThresholdAttributeSubscriptionState { + data class Success(val value: MeterIdentificationClusterPowerThresholdStruct?) : + PowerThresholdAttributeSubscriptionState() + + data class Error(val exception: Exception) : PowerThresholdAttributeSubscriptionState() + + object SubscriptionEstablished : PowerThresholdAttributeSubscriptionState() + } + + class GeneratedCommandListAttribute(val value: List<UInt>) + + sealed class GeneratedCommandListAttributeSubscriptionState { + data class Success(val value: List<UInt>) : GeneratedCommandListAttributeSubscriptionState() + + data class Error(val exception: Exception) : GeneratedCommandListAttributeSubscriptionState() + + object SubscriptionEstablished : GeneratedCommandListAttributeSubscriptionState() + } + + class AcceptedCommandListAttribute(val value: List<UInt>) + + sealed class AcceptedCommandListAttributeSubscriptionState { + data class Success(val value: List<UInt>) : AcceptedCommandListAttributeSubscriptionState() + + data class Error(val exception: Exception) : AcceptedCommandListAttributeSubscriptionState() + + object SubscriptionEstablished : AcceptedCommandListAttributeSubscriptionState() + } + + class EventListAttribute(val value: List<UInt>) + + sealed class EventListAttributeSubscriptionState { + data class Success(val value: List<UInt>) : EventListAttributeSubscriptionState() + + data class Error(val exception: Exception) : EventListAttributeSubscriptionState() + + object SubscriptionEstablished : EventListAttributeSubscriptionState() + } + + class AttributeListAttribute(val value: List<UInt>) + + sealed class AttributeListAttributeSubscriptionState { + data class Success(val value: List<UInt>) : AttributeListAttributeSubscriptionState() + + data class Error(val exception: Exception) : AttributeListAttributeSubscriptionState() + + object SubscriptionEstablished : AttributeListAttributeSubscriptionState() + } + + suspend fun readMeterTypeAttribute(): MeterTypeAttribute { + val ATTRIBUTE_ID: UInt = 0u + + val attributePath = + AttributePath(endpointId = endpointId, clusterId = CLUSTER_ID, attributeId = ATTRIBUTE_ID) + + val readRequest = ReadRequest(eventPaths = emptyList(), attributePaths = listOf(attributePath)) + + val response = controller.read(readRequest) + + if (response.successes.isEmpty()) { + logger.log(Level.WARNING, "Read command failed") + throw IllegalStateException("Read command failed with failures: ${response.failures}") + } + + logger.log(Level.FINE, "Read command succeeded") + + val attributeData = + response.successes.filterIsInstance<ReadData.Attribute>().firstOrNull { + it.path.attributeId == ATTRIBUTE_ID + } + + requireNotNull(attributeData) { "Metertype attribute not found in response" } + + // Decode the TLV data into the appropriate type + val tlvReader = TlvReader(attributeData.data) + val decodedValue: UByte? = + if (!tlvReader.isNull()) { + tlvReader.getUByte(AnonymousTag) + } else { + tlvReader.getNull(AnonymousTag) + null + } + + return MeterTypeAttribute(decodedValue) + } + + suspend fun subscribeMeterTypeAttribute( + minInterval: Int, + maxInterval: Int, + ): Flow<MeterTypeAttributeSubscriptionState> { + val ATTRIBUTE_ID: UInt = 0u + val attributePaths = + listOf( + AttributePath(endpointId = endpointId, clusterId = CLUSTER_ID, attributeId = ATTRIBUTE_ID) + ) + + val subscribeRequest: SubscribeRequest = + SubscribeRequest( + eventPaths = emptyList(), + attributePaths = attributePaths, + minInterval = Duration.ofSeconds(minInterval.toLong()), + maxInterval = Duration.ofSeconds(maxInterval.toLong()), + ) + + return controller.subscribe(subscribeRequest).transform { subscriptionState -> + when (subscriptionState) { + is SubscriptionState.SubscriptionErrorNotification -> { + emit( + MeterTypeAttributeSubscriptionState.Error( + Exception( + "Subscription terminated with error code: ${subscriptionState.terminationCause}" + ) + ) + ) + } + is SubscriptionState.NodeStateUpdate -> { + val attributeData = + subscriptionState.updateState.successes + .filterIsInstance<ReadData.Attribute>() + .firstOrNull { it.path.attributeId == ATTRIBUTE_ID } + + requireNotNull(attributeData) { "Metertype attribute not found in Node State update" } + + // Decode the TLV data into the appropriate type + val tlvReader = TlvReader(attributeData.data) + val decodedValue: UByte? = + if (!tlvReader.isNull()) { + tlvReader.getUByte(AnonymousTag) + } else { + tlvReader.getNull(AnonymousTag) + null + } + + decodedValue?.let { emit(MeterTypeAttributeSubscriptionState.Success(it)) } + } + SubscriptionState.SubscriptionEstablished -> { + emit(MeterTypeAttributeSubscriptionState.SubscriptionEstablished) + } + } + } + } + + suspend fun readPointOfDeliveryAttribute(): PointOfDeliveryAttribute { + val ATTRIBUTE_ID: UInt = 1u + + val attributePath = + AttributePath(endpointId = endpointId, clusterId = CLUSTER_ID, attributeId = ATTRIBUTE_ID) + + val readRequest = ReadRequest(eventPaths = emptyList(), attributePaths = listOf(attributePath)) + + val response = controller.read(readRequest) + + if (response.successes.isEmpty()) { + logger.log(Level.WARNING, "Read command failed") + throw IllegalStateException("Read command failed with failures: ${response.failures}") + } + + logger.log(Level.FINE, "Read command succeeded") + + val attributeData = + response.successes.filterIsInstance<ReadData.Attribute>().firstOrNull { + it.path.attributeId == ATTRIBUTE_ID + } + + requireNotNull(attributeData) { "Pointofdelivery attribute not found in response" } + + // Decode the TLV data into the appropriate type + val tlvReader = TlvReader(attributeData.data) + val decodedValue: String? = + if (!tlvReader.isNull()) { + tlvReader.getString(AnonymousTag) + } else { + tlvReader.getNull(AnonymousTag) + null + } + + return PointOfDeliveryAttribute(decodedValue) + } + + suspend fun subscribePointOfDeliveryAttribute( + minInterval: Int, + maxInterval: Int, + ): Flow<PointOfDeliveryAttributeSubscriptionState> { + val ATTRIBUTE_ID: UInt = 1u + val attributePaths = + listOf( + AttributePath(endpointId = endpointId, clusterId = CLUSTER_ID, attributeId = ATTRIBUTE_ID) + ) + + val subscribeRequest: SubscribeRequest = + SubscribeRequest( + eventPaths = emptyList(), + attributePaths = attributePaths, + minInterval = Duration.ofSeconds(minInterval.toLong()), + maxInterval = Duration.ofSeconds(maxInterval.toLong()), + ) + + return controller.subscribe(subscribeRequest).transform { subscriptionState -> + when (subscriptionState) { + is SubscriptionState.SubscriptionErrorNotification -> { + emit( + PointOfDeliveryAttributeSubscriptionState.Error( + Exception( + "Subscription terminated with error code: ${subscriptionState.terminationCause}" + ) + ) + ) + } + is SubscriptionState.NodeStateUpdate -> { + val attributeData = + subscriptionState.updateState.successes + .filterIsInstance<ReadData.Attribute>() + .firstOrNull { it.path.attributeId == ATTRIBUTE_ID } + + requireNotNull(attributeData) { + "Pointofdelivery attribute not found in Node State update" + } + + // Decode the TLV data into the appropriate type + val tlvReader = TlvReader(attributeData.data) + val decodedValue: String? = + if (!tlvReader.isNull()) { + tlvReader.getString(AnonymousTag) + } else { + tlvReader.getNull(AnonymousTag) + null + } + + decodedValue?.let { emit(PointOfDeliveryAttributeSubscriptionState.Success(it)) } + } + SubscriptionState.SubscriptionEstablished -> { + emit(PointOfDeliveryAttributeSubscriptionState.SubscriptionEstablished) + } + } + } + } + + suspend fun readMeterSerialNumberAttribute(): MeterSerialNumberAttribute { + val ATTRIBUTE_ID: UInt = 2u + + val attributePath = + AttributePath(endpointId = endpointId, clusterId = CLUSTER_ID, attributeId = ATTRIBUTE_ID) + + val readRequest = ReadRequest(eventPaths = emptyList(), attributePaths = listOf(attributePath)) + + val response = controller.read(readRequest) + + if (response.successes.isEmpty()) { + logger.log(Level.WARNING, "Read command failed") + throw IllegalStateException("Read command failed with failures: ${response.failures}") + } + + logger.log(Level.FINE, "Read command succeeded") + + val attributeData = + response.successes.filterIsInstance<ReadData.Attribute>().firstOrNull { + it.path.attributeId == ATTRIBUTE_ID + } + + requireNotNull(attributeData) { "Meterserialnumber attribute not found in response" } + + // Decode the TLV data into the appropriate type + val tlvReader = TlvReader(attributeData.data) + val decodedValue: String? = + if (!tlvReader.isNull()) { + tlvReader.getString(AnonymousTag) + } else { + tlvReader.getNull(AnonymousTag) + null + } + + return MeterSerialNumberAttribute(decodedValue) + } + + suspend fun subscribeMeterSerialNumberAttribute( + minInterval: Int, + maxInterval: Int, + ): Flow<MeterSerialNumberAttributeSubscriptionState> { + val ATTRIBUTE_ID: UInt = 2u + val attributePaths = + listOf( + AttributePath(endpointId = endpointId, clusterId = CLUSTER_ID, attributeId = ATTRIBUTE_ID) + ) + + val subscribeRequest: SubscribeRequest = + SubscribeRequest( + eventPaths = emptyList(), + attributePaths = attributePaths, + minInterval = Duration.ofSeconds(minInterval.toLong()), + maxInterval = Duration.ofSeconds(maxInterval.toLong()), + ) + + return controller.subscribe(subscribeRequest).transform { subscriptionState -> + when (subscriptionState) { + is SubscriptionState.SubscriptionErrorNotification -> { + emit( + MeterSerialNumberAttributeSubscriptionState.Error( + Exception( + "Subscription terminated with error code: ${subscriptionState.terminationCause}" + ) + ) + ) + } + is SubscriptionState.NodeStateUpdate -> { + val attributeData = + subscriptionState.updateState.successes + .filterIsInstance<ReadData.Attribute>() + .firstOrNull { it.path.attributeId == ATTRIBUTE_ID } + + requireNotNull(attributeData) { + "Meterserialnumber attribute not found in Node State update" + } + + // Decode the TLV data into the appropriate type + val tlvReader = TlvReader(attributeData.data) + val decodedValue: String? = + if (!tlvReader.isNull()) { + tlvReader.getString(AnonymousTag) + } else { + tlvReader.getNull(AnonymousTag) + null + } + + decodedValue?.let { emit(MeterSerialNumberAttributeSubscriptionState.Success(it)) } + } + SubscriptionState.SubscriptionEstablished -> { + emit(MeterSerialNumberAttributeSubscriptionState.SubscriptionEstablished) + } + } + } + } + + suspend fun readProtocolVersionAttribute(): ProtocolVersionAttribute { + val ATTRIBUTE_ID: UInt = 3u + + val attributePath = + AttributePath(endpointId = endpointId, clusterId = CLUSTER_ID, attributeId = ATTRIBUTE_ID) + + val readRequest = ReadRequest(eventPaths = emptyList(), attributePaths = listOf(attributePath)) + + val response = controller.read(readRequest) + + if (response.successes.isEmpty()) { + logger.log(Level.WARNING, "Read command failed") + throw IllegalStateException("Read command failed with failures: ${response.failures}") + } + + logger.log(Level.FINE, "Read command succeeded") + + val attributeData = + response.successes.filterIsInstance<ReadData.Attribute>().firstOrNull { + it.path.attributeId == ATTRIBUTE_ID + } + + requireNotNull(attributeData) { "Protocolversion attribute not found in response" } + + // Decode the TLV data into the appropriate type + val tlvReader = TlvReader(attributeData.data) + val decodedValue: String? = + if (!tlvReader.isNull()) { + if (tlvReader.isNextTag(AnonymousTag)) { + tlvReader.getString(AnonymousTag) + } else { + null + } + } else { + tlvReader.getNull(AnonymousTag) + null + } + + return ProtocolVersionAttribute(decodedValue) + } + + suspend fun subscribeProtocolVersionAttribute( + minInterval: Int, + maxInterval: Int, + ): Flow<ProtocolVersionAttributeSubscriptionState> { + val ATTRIBUTE_ID: UInt = 3u + val attributePaths = + listOf( + AttributePath(endpointId = endpointId, clusterId = CLUSTER_ID, attributeId = ATTRIBUTE_ID) + ) + + val subscribeRequest: SubscribeRequest = + SubscribeRequest( + eventPaths = emptyList(), + attributePaths = attributePaths, + minInterval = Duration.ofSeconds(minInterval.toLong()), + maxInterval = Duration.ofSeconds(maxInterval.toLong()), + ) + + return controller.subscribe(subscribeRequest).transform { subscriptionState -> + when (subscriptionState) { + is SubscriptionState.SubscriptionErrorNotification -> { + emit( + ProtocolVersionAttributeSubscriptionState.Error( + Exception( + "Subscription terminated with error code: ${subscriptionState.terminationCause}" + ) + ) + ) + } + is SubscriptionState.NodeStateUpdate -> { + val attributeData = + subscriptionState.updateState.successes + .filterIsInstance<ReadData.Attribute>() + .firstOrNull { it.path.attributeId == ATTRIBUTE_ID } + + requireNotNull(attributeData) { + "Protocolversion attribute not found in Node State update" + } + + // Decode the TLV data into the appropriate type + val tlvReader = TlvReader(attributeData.data) + val decodedValue: String? = + if (!tlvReader.isNull()) { + if (tlvReader.isNextTag(AnonymousTag)) { + tlvReader.getString(AnonymousTag) + } else { + null + } + } else { + tlvReader.getNull(AnonymousTag) + null + } + + decodedValue?.let { emit(ProtocolVersionAttributeSubscriptionState.Success(it)) } + } + SubscriptionState.SubscriptionEstablished -> { + emit(ProtocolVersionAttributeSubscriptionState.SubscriptionEstablished) + } + } + } + } + + suspend fun readPowerThresholdAttribute(): PowerThresholdAttribute { + val ATTRIBUTE_ID: UInt = 4u + + val attributePath = + AttributePath(endpointId = endpointId, clusterId = CLUSTER_ID, attributeId = ATTRIBUTE_ID) + + val readRequest = ReadRequest(eventPaths = emptyList(), attributePaths = listOf(attributePath)) + + val response = controller.read(readRequest) + + if (response.successes.isEmpty()) { + logger.log(Level.WARNING, "Read command failed") + throw IllegalStateException("Read command failed with failures: ${response.failures}") + } + + logger.log(Level.FINE, "Read command succeeded") + + val attributeData = + response.successes.filterIsInstance<ReadData.Attribute>().firstOrNull { + it.path.attributeId == ATTRIBUTE_ID + } + + requireNotNull(attributeData) { "Powerthreshold attribute not found in response" } + + // Decode the TLV data into the appropriate type + val tlvReader = TlvReader(attributeData.data) + val decodedValue: MeterIdentificationClusterPowerThresholdStruct? = + if (!tlvReader.isNull()) { + if (tlvReader.isNextTag(AnonymousTag)) { + MeterIdentificationClusterPowerThresholdStruct.fromTlv(AnonymousTag, tlvReader) + } else { + null + } + } else { + tlvReader.getNull(AnonymousTag) + null + } + + return PowerThresholdAttribute(decodedValue) + } + + suspend fun subscribePowerThresholdAttribute( + minInterval: Int, + maxInterval: Int, + ): Flow<PowerThresholdAttributeSubscriptionState> { + val ATTRIBUTE_ID: UInt = 4u + val attributePaths = + listOf( + AttributePath(endpointId = endpointId, clusterId = CLUSTER_ID, attributeId = ATTRIBUTE_ID) + ) + + val subscribeRequest: SubscribeRequest = + SubscribeRequest( + eventPaths = emptyList(), + attributePaths = attributePaths, + minInterval = Duration.ofSeconds(minInterval.toLong()), + maxInterval = Duration.ofSeconds(maxInterval.toLong()), + ) + + return controller.subscribe(subscribeRequest).transform { subscriptionState -> + when (subscriptionState) { + is SubscriptionState.SubscriptionErrorNotification -> { + emit( + PowerThresholdAttributeSubscriptionState.Error( + Exception( + "Subscription terminated with error code: ${subscriptionState.terminationCause}" + ) + ) + ) + } + is SubscriptionState.NodeStateUpdate -> { + val attributeData = + subscriptionState.updateState.successes + .filterIsInstance<ReadData.Attribute>() + .firstOrNull { it.path.attributeId == ATTRIBUTE_ID } + + requireNotNull(attributeData) { + "Powerthreshold attribute not found in Node State update" + } + + // Decode the TLV data into the appropriate type + val tlvReader = TlvReader(attributeData.data) + val decodedValue: MeterIdentificationClusterPowerThresholdStruct? = + if (!tlvReader.isNull()) { + if (tlvReader.isNextTag(AnonymousTag)) { + MeterIdentificationClusterPowerThresholdStruct.fromTlv(AnonymousTag, tlvReader) + } else { + null + } + } else { + tlvReader.getNull(AnonymousTag) + null + } + + decodedValue?.let { emit(PowerThresholdAttributeSubscriptionState.Success(it)) } + } + SubscriptionState.SubscriptionEstablished -> { + emit(PowerThresholdAttributeSubscriptionState.SubscriptionEstablished) + } + } + } + } + + suspend fun readGeneratedCommandListAttribute(): GeneratedCommandListAttribute { + val ATTRIBUTE_ID: UInt = 65528u + + val attributePath = + AttributePath(endpointId = endpointId, clusterId = CLUSTER_ID, attributeId = ATTRIBUTE_ID) + + val readRequest = ReadRequest(eventPaths = emptyList(), attributePaths = listOf(attributePath)) + + val response = controller.read(readRequest) + + if (response.successes.isEmpty()) { + logger.log(Level.WARNING, "Read command failed") + throw IllegalStateException("Read command failed with failures: ${response.failures}") + } + + logger.log(Level.FINE, "Read command succeeded") + + val attributeData = + response.successes.filterIsInstance<ReadData.Attribute>().firstOrNull { + it.path.attributeId == ATTRIBUTE_ID + } + + requireNotNull(attributeData) { "Generatedcommandlist attribute not found in response" } + + // Decode the TLV data into the appropriate type + val tlvReader = TlvReader(attributeData.data) + val decodedValue: List<UInt> = + buildList<UInt> { + tlvReader.enterArray(AnonymousTag) + while (!tlvReader.isEndOfContainer()) { + add(tlvReader.getUInt(AnonymousTag)) + } + tlvReader.exitContainer() + } + + return GeneratedCommandListAttribute(decodedValue) + } + + suspend fun subscribeGeneratedCommandListAttribute( + minInterval: Int, + maxInterval: Int, + ): Flow<GeneratedCommandListAttributeSubscriptionState> { + val ATTRIBUTE_ID: UInt = 65528u + val attributePaths = + listOf( + AttributePath(endpointId = endpointId, clusterId = CLUSTER_ID, attributeId = ATTRIBUTE_ID) + ) + + val subscribeRequest: SubscribeRequest = + SubscribeRequest( + eventPaths = emptyList(), + attributePaths = attributePaths, + minInterval = Duration.ofSeconds(minInterval.toLong()), + maxInterval = Duration.ofSeconds(maxInterval.toLong()), + ) + + return controller.subscribe(subscribeRequest).transform { subscriptionState -> + when (subscriptionState) { + is SubscriptionState.SubscriptionErrorNotification -> { + emit( + GeneratedCommandListAttributeSubscriptionState.Error( + Exception( + "Subscription terminated with error code: ${subscriptionState.terminationCause}" + ) + ) + ) + } + is SubscriptionState.NodeStateUpdate -> { + val attributeData = + subscriptionState.updateState.successes + .filterIsInstance<ReadData.Attribute>() + .firstOrNull { it.path.attributeId == ATTRIBUTE_ID } + + requireNotNull(attributeData) { + "Generatedcommandlist attribute not found in Node State update" + } + + // Decode the TLV data into the appropriate type + val tlvReader = TlvReader(attributeData.data) + val decodedValue: List<UInt> = + buildList<UInt> { + tlvReader.enterArray(AnonymousTag) + while (!tlvReader.isEndOfContainer()) { + add(tlvReader.getUInt(AnonymousTag)) + } + tlvReader.exitContainer() + } + + emit(GeneratedCommandListAttributeSubscriptionState.Success(decodedValue)) + } + SubscriptionState.SubscriptionEstablished -> { + emit(GeneratedCommandListAttributeSubscriptionState.SubscriptionEstablished) + } + } + } + } + + suspend fun readAcceptedCommandListAttribute(): AcceptedCommandListAttribute { + val ATTRIBUTE_ID: UInt = 65529u + + val attributePath = + AttributePath(endpointId = endpointId, clusterId = CLUSTER_ID, attributeId = ATTRIBUTE_ID) + + val readRequest = ReadRequest(eventPaths = emptyList(), attributePaths = listOf(attributePath)) + + val response = controller.read(readRequest) + + if (response.successes.isEmpty()) { + logger.log(Level.WARNING, "Read command failed") + throw IllegalStateException("Read command failed with failures: ${response.failures}") + } + + logger.log(Level.FINE, "Read command succeeded") + + val attributeData = + response.successes.filterIsInstance<ReadData.Attribute>().firstOrNull { + it.path.attributeId == ATTRIBUTE_ID + } + + requireNotNull(attributeData) { "Acceptedcommandlist attribute not found in response" } + + // Decode the TLV data into the appropriate type + val tlvReader = TlvReader(attributeData.data) + val decodedValue: List<UInt> = + buildList<UInt> { + tlvReader.enterArray(AnonymousTag) + while (!tlvReader.isEndOfContainer()) { + add(tlvReader.getUInt(AnonymousTag)) + } + tlvReader.exitContainer() + } + + return AcceptedCommandListAttribute(decodedValue) + } + + suspend fun subscribeAcceptedCommandListAttribute( + minInterval: Int, + maxInterval: Int, + ): Flow<AcceptedCommandListAttributeSubscriptionState> { + val ATTRIBUTE_ID: UInt = 65529u + val attributePaths = + listOf( + AttributePath(endpointId = endpointId, clusterId = CLUSTER_ID, attributeId = ATTRIBUTE_ID) + ) + + val subscribeRequest: SubscribeRequest = + SubscribeRequest( + eventPaths = emptyList(), + attributePaths = attributePaths, + minInterval = Duration.ofSeconds(minInterval.toLong()), + maxInterval = Duration.ofSeconds(maxInterval.toLong()), + ) + + return controller.subscribe(subscribeRequest).transform { subscriptionState -> + when (subscriptionState) { + is SubscriptionState.SubscriptionErrorNotification -> { + emit( + AcceptedCommandListAttributeSubscriptionState.Error( + Exception( + "Subscription terminated with error code: ${subscriptionState.terminationCause}" + ) + ) + ) + } + is SubscriptionState.NodeStateUpdate -> { + val attributeData = + subscriptionState.updateState.successes + .filterIsInstance<ReadData.Attribute>() + .firstOrNull { it.path.attributeId == ATTRIBUTE_ID } + + requireNotNull(attributeData) { + "Acceptedcommandlist attribute not found in Node State update" + } + + // Decode the TLV data into the appropriate type + val tlvReader = TlvReader(attributeData.data) + val decodedValue: List<UInt> = + buildList<UInt> { + tlvReader.enterArray(AnonymousTag) + while (!tlvReader.isEndOfContainer()) { + add(tlvReader.getUInt(AnonymousTag)) + } + tlvReader.exitContainer() + } + + emit(AcceptedCommandListAttributeSubscriptionState.Success(decodedValue)) + } + SubscriptionState.SubscriptionEstablished -> { + emit(AcceptedCommandListAttributeSubscriptionState.SubscriptionEstablished) + } + } + } + } + + suspend fun readEventListAttribute(): EventListAttribute { + val ATTRIBUTE_ID: UInt = 65530u + + val attributePath = + AttributePath(endpointId = endpointId, clusterId = CLUSTER_ID, attributeId = ATTRIBUTE_ID) + + val readRequest = ReadRequest(eventPaths = emptyList(), attributePaths = listOf(attributePath)) + + val response = controller.read(readRequest) + + if (response.successes.isEmpty()) { + logger.log(Level.WARNING, "Read command failed") + throw IllegalStateException("Read command failed with failures: ${response.failures}") + } + + logger.log(Level.FINE, "Read command succeeded") + + val attributeData = + response.successes.filterIsInstance<ReadData.Attribute>().firstOrNull { + it.path.attributeId == ATTRIBUTE_ID + } + + requireNotNull(attributeData) { "Eventlist attribute not found in response" } + + // Decode the TLV data into the appropriate type + val tlvReader = TlvReader(attributeData.data) + val decodedValue: List<UInt> = + buildList<UInt> { + tlvReader.enterArray(AnonymousTag) + while (!tlvReader.isEndOfContainer()) { + add(tlvReader.getUInt(AnonymousTag)) + } + tlvReader.exitContainer() + } + + return EventListAttribute(decodedValue) + } + + suspend fun subscribeEventListAttribute( + minInterval: Int, + maxInterval: Int, + ): Flow<EventListAttributeSubscriptionState> { + val ATTRIBUTE_ID: UInt = 65530u + val attributePaths = + listOf( + AttributePath(endpointId = endpointId, clusterId = CLUSTER_ID, attributeId = ATTRIBUTE_ID) + ) + + val subscribeRequest: SubscribeRequest = + SubscribeRequest( + eventPaths = emptyList(), + attributePaths = attributePaths, + minInterval = Duration.ofSeconds(minInterval.toLong()), + maxInterval = Duration.ofSeconds(maxInterval.toLong()), + ) + + return controller.subscribe(subscribeRequest).transform { subscriptionState -> + when (subscriptionState) { + is SubscriptionState.SubscriptionErrorNotification -> { + emit( + EventListAttributeSubscriptionState.Error( + Exception( + "Subscription terminated with error code: ${subscriptionState.terminationCause}" + ) + ) + ) + } + is SubscriptionState.NodeStateUpdate -> { + val attributeData = + subscriptionState.updateState.successes + .filterIsInstance<ReadData.Attribute>() + .firstOrNull { it.path.attributeId == ATTRIBUTE_ID } + + requireNotNull(attributeData) { "Eventlist attribute not found in Node State update" } + + // Decode the TLV data into the appropriate type + val tlvReader = TlvReader(attributeData.data) + val decodedValue: List<UInt> = + buildList<UInt> { + tlvReader.enterArray(AnonymousTag) + while (!tlvReader.isEndOfContainer()) { + add(tlvReader.getUInt(AnonymousTag)) + } + tlvReader.exitContainer() + } + + emit(EventListAttributeSubscriptionState.Success(decodedValue)) + } + SubscriptionState.SubscriptionEstablished -> { + emit(EventListAttributeSubscriptionState.SubscriptionEstablished) + } + } + } + } + + suspend fun readAttributeListAttribute(): AttributeListAttribute { + val ATTRIBUTE_ID: UInt = 65531u + + val attributePath = + AttributePath(endpointId = endpointId, clusterId = CLUSTER_ID, attributeId = ATTRIBUTE_ID) + + val readRequest = ReadRequest(eventPaths = emptyList(), attributePaths = listOf(attributePath)) + + val response = controller.read(readRequest) + + if (response.successes.isEmpty()) { + logger.log(Level.WARNING, "Read command failed") + throw IllegalStateException("Read command failed with failures: ${response.failures}") + } + + logger.log(Level.FINE, "Read command succeeded") + + val attributeData = + response.successes.filterIsInstance<ReadData.Attribute>().firstOrNull { + it.path.attributeId == ATTRIBUTE_ID + } + + requireNotNull(attributeData) { "Attributelist attribute not found in response" } + + // Decode the TLV data into the appropriate type + val tlvReader = TlvReader(attributeData.data) + val decodedValue: List<UInt> = + buildList<UInt> { + tlvReader.enterArray(AnonymousTag) + while (!tlvReader.isEndOfContainer()) { + add(tlvReader.getUInt(AnonymousTag)) + } + tlvReader.exitContainer() + } + + return AttributeListAttribute(decodedValue) + } + + suspend fun subscribeAttributeListAttribute( + minInterval: Int, + maxInterval: Int, + ): Flow<AttributeListAttributeSubscriptionState> { + val ATTRIBUTE_ID: UInt = 65531u + val attributePaths = + listOf( + AttributePath(endpointId = endpointId, clusterId = CLUSTER_ID, attributeId = ATTRIBUTE_ID) + ) + + val subscribeRequest: SubscribeRequest = + SubscribeRequest( + eventPaths = emptyList(), + attributePaths = attributePaths, + minInterval = Duration.ofSeconds(minInterval.toLong()), + maxInterval = Duration.ofSeconds(maxInterval.toLong()), + ) + + return controller.subscribe(subscribeRequest).transform { subscriptionState -> + when (subscriptionState) { + is SubscriptionState.SubscriptionErrorNotification -> { + emit( + AttributeListAttributeSubscriptionState.Error( + Exception( + "Subscription terminated with error code: ${subscriptionState.terminationCause}" + ) + ) + ) + } + is SubscriptionState.NodeStateUpdate -> { + val attributeData = + subscriptionState.updateState.successes + .filterIsInstance<ReadData.Attribute>() + .firstOrNull { it.path.attributeId == ATTRIBUTE_ID } + + requireNotNull(attributeData) { "Attributelist attribute not found in Node State update" } + + // Decode the TLV data into the appropriate type + val tlvReader = TlvReader(attributeData.data) + val decodedValue: List<UInt> = + buildList<UInt> { + tlvReader.enterArray(AnonymousTag) + while (!tlvReader.isEndOfContainer()) { + add(tlvReader.getUInt(AnonymousTag)) + } + tlvReader.exitContainer() + } + + emit(AttributeListAttributeSubscriptionState.Success(decodedValue)) + } + SubscriptionState.SubscriptionEstablished -> { + emit(AttributeListAttributeSubscriptionState.SubscriptionEstablished) + } + } + } + } + + suspend fun readFeatureMapAttribute(): UInt { + val ATTRIBUTE_ID: UInt = 65532u + + val attributePath = + AttributePath(endpointId = endpointId, clusterId = CLUSTER_ID, attributeId = ATTRIBUTE_ID) + + val readRequest = ReadRequest(eventPaths = emptyList(), attributePaths = listOf(attributePath)) + + val response = controller.read(readRequest) + + if (response.successes.isEmpty()) { + logger.log(Level.WARNING, "Read command failed") + throw IllegalStateException("Read command failed with failures: ${response.failures}") + } + + logger.log(Level.FINE, "Read command succeeded") + + val attributeData = + response.successes.filterIsInstance<ReadData.Attribute>().firstOrNull { + it.path.attributeId == ATTRIBUTE_ID + } + + requireNotNull(attributeData) { "Featuremap attribute not found in response" } + + // Decode the TLV data into the appropriate type + val tlvReader = TlvReader(attributeData.data) + val decodedValue: UInt = tlvReader.getUInt(AnonymousTag) + + return decodedValue + } + + suspend fun subscribeFeatureMapAttribute( + minInterval: Int, + maxInterval: Int, + ): Flow<UIntSubscriptionState> { + val ATTRIBUTE_ID: UInt = 65532u + val attributePaths = + listOf( + AttributePath(endpointId = endpointId, clusterId = CLUSTER_ID, attributeId = ATTRIBUTE_ID) + ) + + val subscribeRequest: SubscribeRequest = + SubscribeRequest( + eventPaths = emptyList(), + attributePaths = attributePaths, + minInterval = Duration.ofSeconds(minInterval.toLong()), + maxInterval = Duration.ofSeconds(maxInterval.toLong()), + ) + + return controller.subscribe(subscribeRequest).transform { subscriptionState -> + when (subscriptionState) { + is SubscriptionState.SubscriptionErrorNotification -> { + emit( + UIntSubscriptionState.Error( + Exception( + "Subscription terminated with error code: ${subscriptionState.terminationCause}" + ) + ) + ) + } + is SubscriptionState.NodeStateUpdate -> { + val attributeData = + subscriptionState.updateState.successes + .filterIsInstance<ReadData.Attribute>() + .firstOrNull { it.path.attributeId == ATTRIBUTE_ID } + + requireNotNull(attributeData) { "Featuremap attribute not found in Node State update" } + + // Decode the TLV data into the appropriate type + val tlvReader = TlvReader(attributeData.data) + val decodedValue: UInt = tlvReader.getUInt(AnonymousTag) + + emit(UIntSubscriptionState.Success(decodedValue)) + } + SubscriptionState.SubscriptionEstablished -> { + emit(UIntSubscriptionState.SubscriptionEstablished) + } + } + } + } + + suspend fun readClusterRevisionAttribute(): UShort { + val ATTRIBUTE_ID: UInt = 65533u + + val attributePath = + AttributePath(endpointId = endpointId, clusterId = CLUSTER_ID, attributeId = ATTRIBUTE_ID) + + val readRequest = ReadRequest(eventPaths = emptyList(), attributePaths = listOf(attributePath)) + + val response = controller.read(readRequest) + + if (response.successes.isEmpty()) { + logger.log(Level.WARNING, "Read command failed") + throw IllegalStateException("Read command failed with failures: ${response.failures}") + } + + logger.log(Level.FINE, "Read command succeeded") + + val attributeData = + response.successes.filterIsInstance<ReadData.Attribute>().firstOrNull { + it.path.attributeId == ATTRIBUTE_ID + } + + requireNotNull(attributeData) { "Clusterrevision attribute not found in response" } + + // Decode the TLV data into the appropriate type + val tlvReader = TlvReader(attributeData.data) + val decodedValue: UShort = tlvReader.getUShort(AnonymousTag) + + return decodedValue + } + + suspend fun subscribeClusterRevisionAttribute( + minInterval: Int, + maxInterval: Int, + ): Flow<UShortSubscriptionState> { + val ATTRIBUTE_ID: UInt = 65533u + val attributePaths = + listOf( + AttributePath(endpointId = endpointId, clusterId = CLUSTER_ID, attributeId = ATTRIBUTE_ID) + ) + + val subscribeRequest: SubscribeRequest = + SubscribeRequest( + eventPaths = emptyList(), + attributePaths = attributePaths, + minInterval = Duration.ofSeconds(minInterval.toLong()), + maxInterval = Duration.ofSeconds(maxInterval.toLong()), + ) + + return controller.subscribe(subscribeRequest).transform { subscriptionState -> + when (subscriptionState) { + is SubscriptionState.SubscriptionErrorNotification -> { + emit( + UShortSubscriptionState.Error( + Exception( + "Subscription terminated with error code: ${subscriptionState.terminationCause}" + ) + ) + ) + } + is SubscriptionState.NodeStateUpdate -> { + val attributeData = + subscriptionState.updateState.successes + .filterIsInstance<ReadData.Attribute>() + .firstOrNull { it.path.attributeId == ATTRIBUTE_ID } + + requireNotNull(attributeData) { + "Clusterrevision attribute not found in Node State update" + } + + // Decode the TLV data into the appropriate type + val tlvReader = TlvReader(attributeData.data) + val decodedValue: UShort = tlvReader.getUShort(AnonymousTag) + + emit(UShortSubscriptionState.Success(decodedValue)) + } + SubscriptionState.SubscriptionEstablished -> { + emit(UShortSubscriptionState.SubscriptionEstablished) + } + } + } + } + + companion object { + private val logger = Logger.getLogger(MeterIdentificationCluster::class.java.name) + const val CLUSTER_ID: UInt = 2822u + } +} diff --git a/src/controller/java/generated/java/matter/controller/cluster/files.gni b/src/controller/java/generated/java/matter/controller/cluster/files.gni index 35314b120bf037..d88d5f24bc751c 100644 --- a/src/controller/java/generated/java/matter/controller/cluster/files.gni +++ b/src/controller/java/generated/java/matter/controller/cluster/files.gni @@ -107,6 +107,7 @@ matter_structs_sources = [ "${chip_root}/src/controller/java/generated/java/matter/controller/cluster/structs/MediaPlaybackClusterTrackStruct.kt", "${chip_root}/src/controller/java/generated/java/matter/controller/cluster/structs/MessagesClusterMessageResponseOptionStruct.kt", "${chip_root}/src/controller/java/generated/java/matter/controller/cluster/structs/MessagesClusterMessageStruct.kt", + "${chip_root}/src/controller/java/generated/java/matter/controller/cluster/structs/MeterIdentificationClusterPowerThresholdStruct.kt", "${chip_root}/src/controller/java/generated/java/matter/controller/cluster/structs/MicrowaveOvenModeClusterModeOptionStruct.kt", "${chip_root}/src/controller/java/generated/java/matter/controller/cluster/structs/MicrowaveOvenModeClusterModeTagStruct.kt", "${chip_root}/src/controller/java/generated/java/matter/controller/cluster/structs/ModeSelectClusterModeOptionStruct.kt", @@ -352,6 +353,7 @@ matter_clusters_sources = [ "${chip_root}/src/controller/java/generated/java/matter/controller/cluster/clusters/MediaInputCluster.kt", "${chip_root}/src/controller/java/generated/java/matter/controller/cluster/clusters/MediaPlaybackCluster.kt", "${chip_root}/src/controller/java/generated/java/matter/controller/cluster/clusters/MessagesCluster.kt", + "${chip_root}/src/controller/java/generated/java/matter/controller/cluster/clusters/MeterIdentificationCluster.kt", "${chip_root}/src/controller/java/generated/java/matter/controller/cluster/clusters/MicrowaveOvenControlCluster.kt", "${chip_root}/src/controller/java/generated/java/matter/controller/cluster/clusters/MicrowaveOvenModeCluster.kt", "${chip_root}/src/controller/java/generated/java/matter/controller/cluster/clusters/ModeSelectCluster.kt", diff --git a/src/controller/java/generated/java/matter/controller/cluster/structs/MeterIdentificationClusterPowerThresholdStruct.kt b/src/controller/java/generated/java/matter/controller/cluster/structs/MeterIdentificationClusterPowerThresholdStruct.kt new file mode 100644 index 00000000000000..9e061839039320 --- /dev/null +++ b/src/controller/java/generated/java/matter/controller/cluster/structs/MeterIdentificationClusterPowerThresholdStruct.kt @@ -0,0 +1,95 @@ +/* + * + * Copyright (c) 2023 Project CHIP Authors + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package matter.controller.cluster.structs + +import java.util.Optional +import matter.controller.cluster.* +import matter.tlv.ContextSpecificTag +import matter.tlv.Tag +import matter.tlv.TlvReader +import matter.tlv.TlvWriter + +class MeterIdentificationClusterPowerThresholdStruct( + val powerThreshold: Optional<Long>, + val apparentPowerThreshold: Optional<Long>, + val powerThresholdSource: UByte?, +) { + override fun toString(): String = buildString { + append("MeterIdentificationClusterPowerThresholdStruct {\n") + append("\tpowerThreshold : $powerThreshold\n") + append("\tapparentPowerThreshold : $apparentPowerThreshold\n") + append("\tpowerThresholdSource : $powerThresholdSource\n") + append("}\n") + } + + fun toTlv(tlvTag: Tag, tlvWriter: TlvWriter) { + tlvWriter.apply { + startStructure(tlvTag) + if (powerThreshold.isPresent) { + val optpowerThreshold = powerThreshold.get() + put(ContextSpecificTag(TAG_POWER_THRESHOLD), optpowerThreshold) + } + if (apparentPowerThreshold.isPresent) { + val optapparentPowerThreshold = apparentPowerThreshold.get() + put(ContextSpecificTag(TAG_APPARENT_POWER_THRESHOLD), optapparentPowerThreshold) + } + if (powerThresholdSource != null) { + put(ContextSpecificTag(TAG_POWER_THRESHOLD_SOURCE), powerThresholdSource) + } else { + putNull(ContextSpecificTag(TAG_POWER_THRESHOLD_SOURCE)) + } + endStructure() + } + } + + companion object { + private const val TAG_POWER_THRESHOLD = 0 + private const val TAG_APPARENT_POWER_THRESHOLD = 1 + private const val TAG_POWER_THRESHOLD_SOURCE = 2 + + fun fromTlv(tlvTag: Tag, tlvReader: TlvReader): MeterIdentificationClusterPowerThresholdStruct { + tlvReader.enterStructure(tlvTag) + val powerThreshold = + if (tlvReader.isNextTag(ContextSpecificTag(TAG_POWER_THRESHOLD))) { + Optional.of(tlvReader.getLong(ContextSpecificTag(TAG_POWER_THRESHOLD))) + } else { + Optional.empty() + } + val apparentPowerThreshold = + if (tlvReader.isNextTag(ContextSpecificTag(TAG_APPARENT_POWER_THRESHOLD))) { + Optional.of(tlvReader.getLong(ContextSpecificTag(TAG_APPARENT_POWER_THRESHOLD))) + } else { + Optional.empty() + } + val powerThresholdSource = + if (!tlvReader.isNull()) { + tlvReader.getUByte(ContextSpecificTag(TAG_POWER_THRESHOLD_SOURCE)) + } else { + tlvReader.getNull(ContextSpecificTag(TAG_POWER_THRESHOLD_SOURCE)) + null + } + + tlvReader.exitContainer() + + return MeterIdentificationClusterPowerThresholdStruct( + powerThreshold, + apparentPowerThreshold, + powerThresholdSource, + ) + } + } +} diff --git a/src/controller/java/zap-generated/CHIPAttributeTLVValueDecoder.cpp b/src/controller/java/zap-generated/CHIPAttributeTLVValueDecoder.cpp index 8e04a580a8f8ca..09dac20bde522b 100644 --- a/src/controller/java/zap-generated/CHIPAttributeTLVValueDecoder.cpp +++ b/src/controller/java/zap-generated/CHIPAttributeTLVValueDecoder.cpp @@ -44483,6 +44483,296 @@ jobject DecodeAttributeValue(const app::ConcreteAttributePath & aPath, TLV::TLVR } break; } + case app::Clusters::MeterIdentification::Id: { + using namespace app::Clusters::MeterIdentification; + switch (aPath.mAttributeId) + { + case Attributes::MeterType::Id: { + using TypeInfo = Attributes::MeterType::TypeInfo; + TypeInfo::DecodableType cppValue; + *aError = app::DataModel::Decode(aReader, cppValue); + if (*aError != CHIP_NO_ERROR) + { + return nullptr; + } + jobject value; + if (cppValue.IsNull()) + { + value = nullptr; + } + else + { + std::string valueClassName = "java/lang/Integer"; + std::string valueCtorSignature = "(I)V"; + jint jnivalue = static_cast<jint>(cppValue.Value()); + chip::JniReferences::GetInstance().CreateBoxedObject<jint>(valueClassName.c_str(), valueCtorSignature.c_str(), + jnivalue, value); + } + return value; + } + case Attributes::PointOfDelivery::Id: { + using TypeInfo = Attributes::PointOfDelivery::TypeInfo; + TypeInfo::DecodableType cppValue; + *aError = app::DataModel::Decode(aReader, cppValue); + if (*aError != CHIP_NO_ERROR) + { + return nullptr; + } + jobject value; + if (cppValue.IsNull()) + { + value = nullptr; + } + else + { + LogErrorOnFailure(chip::JniReferences::GetInstance().CharToStringUTF(cppValue.Value(), value)); + } + return value; + } + case Attributes::MeterSerialNumber::Id: { + using TypeInfo = Attributes::MeterSerialNumber::TypeInfo; + TypeInfo::DecodableType cppValue; + *aError = app::DataModel::Decode(aReader, cppValue); + if (*aError != CHIP_NO_ERROR) + { + return nullptr; + } + jobject value; + if (cppValue.IsNull()) + { + value = nullptr; + } + else + { + LogErrorOnFailure(chip::JniReferences::GetInstance().CharToStringUTF(cppValue.Value(), value)); + } + return value; + } + case Attributes::ProtocolVersion::Id: { + using TypeInfo = Attributes::ProtocolVersion::TypeInfo; + TypeInfo::DecodableType cppValue; + *aError = app::DataModel::Decode(aReader, cppValue); + if (*aError != CHIP_NO_ERROR) + { + return nullptr; + } + jobject value; + if (cppValue.IsNull()) + { + value = nullptr; + } + else + { + LogErrorOnFailure(chip::JniReferences::GetInstance().CharToStringUTF(cppValue.Value(), value)); + } + return value; + } + case Attributes::PowerThreshold::Id: { + using TypeInfo = Attributes::PowerThreshold::TypeInfo; + TypeInfo::DecodableType cppValue; + *aError = app::DataModel::Decode(aReader, cppValue); + if (*aError != CHIP_NO_ERROR) + { + return nullptr; + } + jobject value; + if (cppValue.IsNull()) + { + value = nullptr; + } + else + { + jobject value_powerThreshold; + if (!cppValue.Value().powerThreshold.HasValue()) + { + chip::JniReferences::GetInstance().CreateOptional(nullptr, value_powerThreshold); + } + else + { + jobject value_powerThresholdInsideOptional; + std::string value_powerThresholdInsideOptionalClassName = "java/lang/Long"; + std::string value_powerThresholdInsideOptionalCtorSignature = "(J)V"; + jlong jnivalue_powerThresholdInsideOptional = static_cast<jlong>(cppValue.Value().powerThreshold.Value()); + chip::JniReferences::GetInstance().CreateBoxedObject<jlong>( + value_powerThresholdInsideOptionalClassName.c_str(), + value_powerThresholdInsideOptionalCtorSignature.c_str(), jnivalue_powerThresholdInsideOptional, + value_powerThresholdInsideOptional); + chip::JniReferences::GetInstance().CreateOptional(value_powerThresholdInsideOptional, value_powerThreshold); + } + jobject value_apparentPowerThreshold; + if (!cppValue.Value().apparentPowerThreshold.HasValue()) + { + chip::JniReferences::GetInstance().CreateOptional(nullptr, value_apparentPowerThreshold); + } + else + { + jobject value_apparentPowerThresholdInsideOptional; + std::string value_apparentPowerThresholdInsideOptionalClassName = "java/lang/Long"; + std::string value_apparentPowerThresholdInsideOptionalCtorSignature = "(J)V"; + jlong jnivalue_apparentPowerThresholdInsideOptional = + static_cast<jlong>(cppValue.Value().apparentPowerThreshold.Value()); + chip::JniReferences::GetInstance().CreateBoxedObject<jlong>( + value_apparentPowerThresholdInsideOptionalClassName.c_str(), + value_apparentPowerThresholdInsideOptionalCtorSignature.c_str(), + jnivalue_apparentPowerThresholdInsideOptional, value_apparentPowerThresholdInsideOptional); + chip::JniReferences::GetInstance().CreateOptional(value_apparentPowerThresholdInsideOptional, + value_apparentPowerThreshold); + } + jobject value_powerThresholdSource; + if (cppValue.Value().powerThresholdSource.IsNull()) + { + value_powerThresholdSource = nullptr; + } + else + { + std::string value_powerThresholdSourceClassName = "java/lang/Integer"; + std::string value_powerThresholdSourceCtorSignature = "(I)V"; + jint jnivalue_powerThresholdSource = static_cast<jint>(cppValue.Value().powerThresholdSource.Value()); + chip::JniReferences::GetInstance().CreateBoxedObject<jint>( + value_powerThresholdSourceClassName.c_str(), value_powerThresholdSourceCtorSignature.c_str(), + jnivalue_powerThresholdSource, value_powerThresholdSource); + } + + { + jclass powerThresholdStructStructClass_1; + err = chip::JniReferences::GetInstance().GetLocalClassRef( + env, "chip/devicecontroller/ChipStructs$MeterIdentificationClusterPowerThresholdStruct", + powerThresholdStructStructClass_1); + if (err != CHIP_NO_ERROR) + { + ChipLogError(Zcl, "Could not find class ChipStructs$MeterIdentificationClusterPowerThresholdStruct"); + return nullptr; + } + + jmethodID powerThresholdStructStructCtor_1; + err = chip::JniReferences::GetInstance().FindMethod( + env, powerThresholdStructStructClass_1, "<init>", + "(Ljava/util/Optional;Ljava/util/Optional;Ljava/lang/Integer;)V", &powerThresholdStructStructCtor_1); + if (err != CHIP_NO_ERROR || powerThresholdStructStructCtor_1 == nullptr) + { + ChipLogError(Zcl, "Could not find ChipStructs$MeterIdentificationClusterPowerThresholdStruct constructor"); + return nullptr; + } + + value = env->NewObject(powerThresholdStructStructClass_1, powerThresholdStructStructCtor_1, + value_powerThreshold, value_apparentPowerThreshold, value_powerThresholdSource); + } + } + return value; + } + case Attributes::GeneratedCommandList::Id: { + using TypeInfo = Attributes::GeneratedCommandList::TypeInfo; + TypeInfo::DecodableType cppValue; + *aError = app::DataModel::Decode(aReader, cppValue); + if (*aError != CHIP_NO_ERROR) + { + return nullptr; + } + jobject value; + chip::JniReferences::GetInstance().CreateArrayList(value); + + auto iter_value_0 = cppValue.begin(); + while (iter_value_0.Next()) + { + auto & entry_0 = iter_value_0.GetValue(); + jobject newElement_0; + std::string newElement_0ClassName = "java/lang/Long"; + std::string newElement_0CtorSignature = "(J)V"; + jlong jninewElement_0 = static_cast<jlong>(entry_0); + chip::JniReferences::GetInstance().CreateBoxedObject<jlong>( + newElement_0ClassName.c_str(), newElement_0CtorSignature.c_str(), jninewElement_0, newElement_0); + chip::JniReferences::GetInstance().AddToList(value, newElement_0); + } + return value; + } + case Attributes::AcceptedCommandList::Id: { + using TypeInfo = Attributes::AcceptedCommandList::TypeInfo; + TypeInfo::DecodableType cppValue; + *aError = app::DataModel::Decode(aReader, cppValue); + if (*aError != CHIP_NO_ERROR) + { + return nullptr; + } + jobject value; + chip::JniReferences::GetInstance().CreateArrayList(value); + + auto iter_value_0 = cppValue.begin(); + while (iter_value_0.Next()) + { + auto & entry_0 = iter_value_0.GetValue(); + jobject newElement_0; + std::string newElement_0ClassName = "java/lang/Long"; + std::string newElement_0CtorSignature = "(J)V"; + jlong jninewElement_0 = static_cast<jlong>(entry_0); + chip::JniReferences::GetInstance().CreateBoxedObject<jlong>( + newElement_0ClassName.c_str(), newElement_0CtorSignature.c_str(), jninewElement_0, newElement_0); + chip::JniReferences::GetInstance().AddToList(value, newElement_0); + } + return value; + } + case Attributes::AttributeList::Id: { + using TypeInfo = Attributes::AttributeList::TypeInfo; + TypeInfo::DecodableType cppValue; + *aError = app::DataModel::Decode(aReader, cppValue); + if (*aError != CHIP_NO_ERROR) + { + return nullptr; + } + jobject value; + chip::JniReferences::GetInstance().CreateArrayList(value); + + auto iter_value_0 = cppValue.begin(); + while (iter_value_0.Next()) + { + auto & entry_0 = iter_value_0.GetValue(); + jobject newElement_0; + std::string newElement_0ClassName = "java/lang/Long"; + std::string newElement_0CtorSignature = "(J)V"; + jlong jninewElement_0 = static_cast<jlong>(entry_0); + chip::JniReferences::GetInstance().CreateBoxedObject<jlong>( + newElement_0ClassName.c_str(), newElement_0CtorSignature.c_str(), jninewElement_0, newElement_0); + chip::JniReferences::GetInstance().AddToList(value, newElement_0); + } + return value; + } + case Attributes::FeatureMap::Id: { + using TypeInfo = Attributes::FeatureMap::TypeInfo; + TypeInfo::DecodableType cppValue; + *aError = app::DataModel::Decode(aReader, cppValue); + if (*aError != CHIP_NO_ERROR) + { + return nullptr; + } + jobject value; + std::string valueClassName = "java/lang/Long"; + std::string valueCtorSignature = "(J)V"; + jlong jnivalue = static_cast<jlong>(cppValue); + chip::JniReferences::GetInstance().CreateBoxedObject<jlong>(valueClassName.c_str(), valueCtorSignature.c_str(), + jnivalue, value); + return value; + } + case Attributes::ClusterRevision::Id: { + using TypeInfo = Attributes::ClusterRevision::TypeInfo; + TypeInfo::DecodableType cppValue; + *aError = app::DataModel::Decode(aReader, cppValue); + if (*aError != CHIP_NO_ERROR) + { + return nullptr; + } + jobject value; + std::string valueClassName = "java/lang/Integer"; + std::string valueCtorSignature = "(I)V"; + jint jnivalue = static_cast<jint>(cppValue); + chip::JniReferences::GetInstance().CreateBoxedObject<jint>(valueClassName.c_str(), valueCtorSignature.c_str(), jnivalue, + value); + return value; + } + default: + *aError = CHIP_ERROR_IM_MALFORMED_ATTRIBUTE_PATH_IB; + break; + } + break; + } case app::Clusters::UnitTesting::Id: { using namespace app::Clusters::UnitTesting; switch (aPath.mAttributeId) diff --git a/src/controller/java/zap-generated/CHIPEventTLVValueDecoder.cpp b/src/controller/java/zap-generated/CHIPEventTLVValueDecoder.cpp index fcd9f316be688d..0f56b0167381f6 100644 --- a/src/controller/java/zap-generated/CHIPEventTLVValueDecoder.cpp +++ b/src/controller/java/zap-generated/CHIPEventTLVValueDecoder.cpp @@ -8730,6 +8730,16 @@ jobject DecodeEventValue(const app::ConcreteEventPath & aPath, TLV::TLVReader & } break; } + case app::Clusters::MeterIdentification::Id: { + using namespace app::Clusters::MeterIdentification; + switch (aPath.mEventId) + { + default: + *aError = CHIP_ERROR_IM_MALFORMED_EVENT_PATH_IB; + break; + } + break; + } case app::Clusters::UnitTesting::Id: { using namespace app::Clusters::UnitTesting; switch (aPath.mEventId) diff --git a/src/controller/python/chip/clusters/CHIPClusters.py b/src/controller/python/chip/clusters/CHIPClusters.py index 214af92f9ea548..b08b2938018735 100644 --- a/src/controller/python/chip/clusters/CHIPClusters.py +++ b/src/controller/python/chip/clusters/CHIPClusters.py @@ -13738,6 +13738,74 @@ class ChipClusters: }, }, } + _METER_IDENTIFICATION_CLUSTER_INFO = { + "clusterName": "MeterIdentification", + "clusterId": 0x00000B06, + "commands": { + }, + "attributes": { + 0x00000000: { + "attributeName": "MeterType", + "attributeId": 0x00000000, + "type": "int", + "reportable": True, + }, + 0x00000001: { + "attributeName": "PointOfDelivery", + "attributeId": 0x00000001, + "type": "str", + "reportable": True, + }, + 0x00000002: { + "attributeName": "MeterSerialNumber", + "attributeId": 0x00000002, + "type": "str", + "reportable": True, + }, + 0x00000003: { + "attributeName": "ProtocolVersion", + "attributeId": 0x00000003, + "type": "str", + "reportable": True, + }, + 0x00000004: { + "attributeName": "PowerThreshold", + "attributeId": 0x00000004, + "type": "", + "reportable": True, + }, + 0x0000FFF8: { + "attributeName": "GeneratedCommandList", + "attributeId": 0x0000FFF8, + "type": "int", + "reportable": True, + }, + 0x0000FFF9: { + "attributeName": "AcceptedCommandList", + "attributeId": 0x0000FFF9, + "type": "int", + "reportable": True, + }, + 0x0000FFFB: { + "attributeName": "AttributeList", + "attributeId": 0x0000FFFB, + "type": "int", + "reportable": True, + }, + 0x0000FFFC: { + "attributeName": "FeatureMap", + "attributeId": 0x0000FFFC, + "type": "int", + "reportable": True, + }, + 0x0000FFFD: { + "attributeName": "ClusterRevision", + "attributeId": 0x0000FFFD, + "type": "int", + "reportable": True, + }, + }, + } _UNIT_TESTING_CLUSTER_INFO = { "clusterName": "UnitTesting", "clusterId": 0xFFF1FC05, @@ -14856,6 +14924,7 @@ class ChipClusters: 0x00000751: _COMMISSIONER_CONTROL_CLUSTER_INFO, 0x00000801: _TLS_CERTIFICATE_MANAGEMENT_CLUSTER_INFO, 0x00000802: _TLS_CLIENT_MANAGEMENT_CLUSTER_INFO, + 0x00000B06: _METER_IDENTIFICATION_CLUSTER_INFO, 0xFFF1FC05: _UNIT_TESTING_CLUSTER_INFO, 0xFFF1FC06: _FAULT_INJECTION_CLUSTER_INFO, 0xFFF1FC20: _SAMPLE_MEI_CLUSTER_INFO, @@ -14991,6 +15060,7 @@ class ChipClusters: "CommissionerControl": _COMMISSIONER_CONTROL_CLUSTER_INFO, "TlsCertificateManagement": _TLS_CERTIFICATE_MANAGEMENT_CLUSTER_INFO, "TlsClientManagement": _TLS_CLIENT_MANAGEMENT_CLUSTER_INFO, + "MeterIdentification": _METER_IDENTIFICATION_CLUSTER_INFO, "UnitTesting": _UNIT_TESTING_CLUSTER_INFO, "FaultInjection": _FAULT_INJECTION_CLUSTER_INFO, "SampleMei": _SAMPLE_MEI_CLUSTER_INFO, diff --git a/src/controller/python/chip/clusters/Objects.py b/src/controller/python/chip/clusters/Objects.py index 7ec98b19a06d89..7a7bd28b098345 100644 --- a/src/controller/python/chip/clusters/Objects.py +++ b/src/controller/python/chip/clusters/Objects.py @@ -169,6 +169,7 @@ "CommissionerControl", "TlsCertificateManagement", "TlsClientManagement", + "MeterIdentification", "UnitTesting", "FaultInjection", "SampleMei", @@ -49691,6 +49692,240 @@ def attribute_type(cls) -> ClusterObjectFieldDescriptor: value: uint = 0 +@dataclass +class MeterIdentification(Cluster): + id: typing.ClassVar[int] = 0x00000B06 + + @ChipUtility.classproperty + def descriptor(cls) -> ClusterObjectDescriptor: + return ClusterObjectDescriptor( + Fields=[ + ClusterObjectFieldDescriptor(Label="meterType", Tag=0x00000000, Type=typing.Union[Nullable, MeterIdentification.Enums.MeterTypeEnum]), + ClusterObjectFieldDescriptor(Label="pointOfDelivery", Tag=0x00000001, Type=typing.Union[Nullable, str]), + ClusterObjectFieldDescriptor(Label="meterSerialNumber", Tag=0x00000002, Type=typing.Union[Nullable, str]), + ClusterObjectFieldDescriptor(Label="protocolVersion", Tag=0x00000003, Type=typing.Union[None, Nullable, str]), + ClusterObjectFieldDescriptor(Label="powerThreshold", Tag=0x00000004, Type=typing.Union[None, Nullable, MeterIdentification.Structs.PowerThresholdStruct]), + ClusterObjectFieldDescriptor(Label="generatedCommandList", Tag=0x0000FFF8, Type=typing.List[uint]), + ClusterObjectFieldDescriptor(Label="acceptedCommandList", Tag=0x0000FFF9, Type=typing.List[uint]), + ClusterObjectFieldDescriptor(Label="attributeList", Tag=0x0000FFFB, Type=typing.List[uint]), + ClusterObjectFieldDescriptor(Label="featureMap", Tag=0x0000FFFC, Type=uint), + ClusterObjectFieldDescriptor(Label="clusterRevision", Tag=0x0000FFFD, Type=uint), + ]) + + meterType: typing.Union[Nullable, MeterIdentification.Enums.MeterTypeEnum] = NullValue + pointOfDelivery: typing.Union[Nullable, str] = NullValue + meterSerialNumber: typing.Union[Nullable, str] = NullValue + protocolVersion: typing.Union[None, Nullable, str] = None + powerThreshold: typing.Union[None, Nullable, MeterIdentification.Structs.PowerThresholdStruct] = None + generatedCommandList: typing.List[uint] = field(default_factory=lambda: []) + acceptedCommandList: typing.List[uint] = field(default_factory=lambda: []) + attributeList: typing.List[uint] = field(default_factory=lambda: []) + featureMap: uint = 0 + clusterRevision: uint = 0 + + class Enums: + class MeterTypeEnum(MatterIntEnum): + kUtility = 0x00 + kPrivate = 0x01 + kGeneric = 0x02 + # All received enum values that are not listed above will be mapped + # to kUnknownEnumValue. This is a helper enum value that should only + # be used by code to process how it handles receiving an unknown + # enum value. This specific value should never be transmitted. + kUnknownEnumValue = 3 + + class PowerThresholdSourceEnum(MatterIntEnum): + kContract = 0x00 + kRegulator = 0x01 + kEquipment = 0x02 + # All received enum values that are not listed above will be mapped + # to kUnknownEnumValue. This is a helper enum value that should only + # be used by code to process how it handles receiving an unknown + # enum value. This specific value should never be transmitted. + kUnknownEnumValue = 3 + + class Bitmaps: + class Feature(IntFlag): + kPowerThreshold = 0x1 + + class Structs: + @dataclass + class PowerThresholdStruct(ClusterObject): + @ChipUtility.classproperty + def descriptor(cls) -> ClusterObjectDescriptor: + return ClusterObjectDescriptor( + Fields=[ + ClusterObjectFieldDescriptor(Label="powerThreshold", Tag=0, Type=typing.Optional[int]), + ClusterObjectFieldDescriptor(Label="apparentPowerThreshold", Tag=1, Type=typing.Optional[int]), + ClusterObjectFieldDescriptor(Label="powerThresholdSource", Tag=2, Type=typing.Union[Nullable, MeterIdentification.Enums.PowerThresholdSourceEnum]), + ]) + + powerThreshold: 'typing.Optional[int]' = None + apparentPowerThreshold: 'typing.Optional[int]' = None + powerThresholdSource: 'typing.Union[Nullable, MeterIdentification.Enums.PowerThresholdSourceEnum]' = NullValue + + class Attributes: + @dataclass + class MeterType(ClusterAttributeDescriptor): + @ChipUtility.classproperty + def cluster_id(cls) -> int: + return 0x00000B06 + + @ChipUtility.classproperty + def attribute_id(cls) -> int: + return 0x00000000 + + @ChipUtility.classproperty + def attribute_type(cls) -> ClusterObjectFieldDescriptor: + return ClusterObjectFieldDescriptor(Type=typing.Union[Nullable, MeterIdentification.Enums.MeterTypeEnum]) + + value: typing.Union[Nullable, MeterIdentification.Enums.MeterTypeEnum] = NullValue + + @dataclass + class PointOfDelivery(ClusterAttributeDescriptor): + @ChipUtility.classproperty + def cluster_id(cls) -> int: + return 0x00000B06 + + @ChipUtility.classproperty + def attribute_id(cls) -> int: + return 0x00000001 + + @ChipUtility.classproperty + def attribute_type(cls) -> ClusterObjectFieldDescriptor: + return ClusterObjectFieldDescriptor(Type=typing.Union[Nullable, str]) + + value: typing.Union[Nullable, str] = NullValue + + @dataclass + class MeterSerialNumber(ClusterAttributeDescriptor): + @ChipUtility.classproperty + def cluster_id(cls) -> int: + return 0x00000B06 + + @ChipUtility.classproperty + def attribute_id(cls) -> int: + return 0x00000002 + + @ChipUtility.classproperty + def attribute_type(cls) -> ClusterObjectFieldDescriptor: + return ClusterObjectFieldDescriptor(Type=typing.Union[Nullable, str]) + + value: typing.Union[Nullable, str] = NullValue + + @dataclass + class ProtocolVersion(ClusterAttributeDescriptor): + @ChipUtility.classproperty + def cluster_id(cls) -> int: + return 0x00000B06 + + @ChipUtility.classproperty + def attribute_id(cls) -> int: + return 0x00000003 + + @ChipUtility.classproperty + def attribute_type(cls) -> ClusterObjectFieldDescriptor: + return ClusterObjectFieldDescriptor(Type=typing.Union[None, Nullable, str]) + + value: typing.Union[None, Nullable, str] = None + + @dataclass + class PowerThreshold(ClusterAttributeDescriptor): + @ChipUtility.classproperty + def cluster_id(cls) -> int: + return 0x00000B06 + + @ChipUtility.classproperty + def attribute_id(cls) -> int: + return 0x00000004 + + @ChipUtility.classproperty + def attribute_type(cls) -> ClusterObjectFieldDescriptor: + return ClusterObjectFieldDescriptor(Type=typing.Union[None, Nullable, MeterIdentification.Structs.PowerThresholdStruct]) + + value: typing.Union[None, Nullable, MeterIdentification.Structs.PowerThresholdStruct] = None + + @dataclass + class GeneratedCommandList(ClusterAttributeDescriptor): + @ChipUtility.classproperty + def cluster_id(cls) -> int: + return 0x00000B06 + + @ChipUtility.classproperty + def attribute_id(cls) -> int: + return 0x0000FFF8 + + @ChipUtility.classproperty + def attribute_type(cls) -> ClusterObjectFieldDescriptor: + return ClusterObjectFieldDescriptor(Type=typing.List[uint]) + + value: typing.List[uint] = field(default_factory=lambda: []) + + @dataclass + class AcceptedCommandList(ClusterAttributeDescriptor): + @ChipUtility.classproperty + def cluster_id(cls) -> int: + return 0x00000B06 + + @ChipUtility.classproperty + def attribute_id(cls) -> int: + return 0x0000FFF9 + + @ChipUtility.classproperty + def attribute_type(cls) -> ClusterObjectFieldDescriptor: + return ClusterObjectFieldDescriptor(Type=typing.List[uint]) + + value: typing.List[uint] = field(default_factory=lambda: []) + + @dataclass + class AttributeList(ClusterAttributeDescriptor): + @ChipUtility.classproperty + def cluster_id(cls) -> int: + return 0x00000B06 + + @ChipUtility.classproperty + def attribute_id(cls) -> int: + return 0x0000FFFB + + @ChipUtility.classproperty + def attribute_type(cls) -> ClusterObjectFieldDescriptor: + return ClusterObjectFieldDescriptor(Type=typing.List[uint]) + + value: typing.List[uint] = field(default_factory=lambda: []) + + @dataclass + class FeatureMap(ClusterAttributeDescriptor): + @ChipUtility.classproperty + def cluster_id(cls) -> int: + return 0x00000B06 + + @ChipUtility.classproperty + def attribute_id(cls) -> int: + return 0x0000FFFC + + @ChipUtility.classproperty + def attribute_type(cls) -> ClusterObjectFieldDescriptor: + return ClusterObjectFieldDescriptor(Type=uint) + + value: uint = 0 + + @dataclass + class ClusterRevision(ClusterAttributeDescriptor): + @ChipUtility.classproperty + def cluster_id(cls) -> int: + return 0x00000B06 + + @ChipUtility.classproperty + def attribute_id(cls) -> int: + return 0x0000FFFD + + @ChipUtility.classproperty + def attribute_type(cls) -> ClusterObjectFieldDescriptor: + return ClusterObjectFieldDescriptor(Type=uint) + + value: uint = 0 + + @dataclass class UnitTesting(Cluster): id: typing.ClassVar[int] = 0xFFF1FC05 diff --git a/src/darwin/Framework/CHIP/zap-generated/MTRAttributeSpecifiedCheck.mm b/src/darwin/Framework/CHIP/zap-generated/MTRAttributeSpecifiedCheck.mm index d0c8dd1d7609f6..344d4923e179e7 100644 --- a/src/darwin/Framework/CHIP/zap-generated/MTRAttributeSpecifiedCheck.mm +++ b/src/darwin/Framework/CHIP/zap-generated/MTRAttributeSpecifiedCheck.mm @@ -6062,6 +6062,45 @@ static BOOL AttributeIsSpecifiedInTLSClientManagementCluster(AttributeId aAttrib } } } +static BOOL AttributeIsSpecifiedInMeterIdentificationCluster(AttributeId aAttributeId) +{ + using namespace Clusters::MeterIdentification; + switch (aAttributeId) { + case Attributes::MeterType::Id: { + return YES; + } + case Attributes::PointOfDelivery::Id: { + return YES; + } + case Attributes::MeterSerialNumber::Id: { + return YES; + } + case Attributes::ProtocolVersion::Id: { + return YES; + } + case Attributes::PowerThreshold::Id: { + return YES; + } + case Attributes::GeneratedCommandList::Id: { + return YES; + } + case Attributes::AcceptedCommandList::Id: { + return YES; + } + case Attributes::AttributeList::Id: { + return YES; + } + case Attributes::FeatureMap::Id: { + return YES; + } + case Attributes::ClusterRevision::Id: { + return YES; + } + default: { + return NO; + } + } +} static BOOL AttributeIsSpecifiedInUnitTestingCluster(AttributeId aAttributeId) { using namespace Clusters::UnitTesting; @@ -6762,6 +6801,9 @@ BOOL MTRAttributeIsSpecified(ClusterId aClusterId, AttributeId aAttributeId) case Clusters::TlsClientManagement::Id: { return AttributeIsSpecifiedInTLSClientManagementCluster(aAttributeId); } + case Clusters::MeterIdentification::Id: { + return AttributeIsSpecifiedInMeterIdentificationCluster(aAttributeId); + } case Clusters::UnitTesting::Id: { return AttributeIsSpecifiedInUnitTestingCluster(aAttributeId); } diff --git a/src/darwin/Framework/CHIP/zap-generated/MTRAttributeTLVValueDecoder.mm b/src/darwin/Framework/CHIP/zap-generated/MTRAttributeTLVValueDecoder.mm index 03eb7e5d094c75..c6052b76b5e2c4 100644 --- a/src/darwin/Framework/CHIP/zap-generated/MTRAttributeTLVValueDecoder.mm +++ b/src/darwin/Framework/CHIP/zap-generated/MTRAttributeTLVValueDecoder.mm @@ -18480,6 +18480,123 @@ static id _Nullable DecodeAttributeValueForTLSClientManagementCluster(AttributeI *aError = CHIP_ERROR_IM_MALFORMED_ATTRIBUTE_PATH_IB; return nil; } +static id _Nullable DecodeAttributeValueForMeterIdentificationCluster(AttributeId aAttributeId, TLV::TLVReader & aReader, CHIP_ERROR * aError) +{ + using namespace Clusters::MeterIdentification; + switch (aAttributeId) { + case Attributes::MeterType::Id: { + using TypeInfo = Attributes::MeterType::TypeInfo; + TypeInfo::DecodableType cppValue; + *aError = DataModel::Decode(aReader, cppValue); + if (*aError != CHIP_NO_ERROR) { + return nil; + } + NSNumber * _Nullable value; + if (cppValue.IsNull()) { + value = nil; + } else { + value = [NSNumber numberWithUnsignedChar:chip::to_underlying(cppValue.Value())]; + } + return value; + } + case Attributes::PointOfDelivery::Id: { + using TypeInfo = Attributes::PointOfDelivery::TypeInfo; + TypeInfo::DecodableType cppValue; + *aError = DataModel::Decode(aReader, cppValue); + if (*aError != CHIP_NO_ERROR) { + return nil; + } + NSString * _Nullable value; + if (cppValue.IsNull()) { + value = nil; + } else { + value = AsString(cppValue.Value()); + if (value == nil) { + CHIP_ERROR err = CHIP_ERROR_INVALID_ARGUMENT; + *aError = err; + return nil; + } + } + return value; + } + case Attributes::MeterSerialNumber::Id: { + using TypeInfo = Attributes::MeterSerialNumber::TypeInfo; + TypeInfo::DecodableType cppValue; + *aError = DataModel::Decode(aReader, cppValue); + if (*aError != CHIP_NO_ERROR) { + return nil; + } + NSString * _Nullable value; + if (cppValue.IsNull()) { + value = nil; + } else { + value = AsString(cppValue.Value()); + if (value == nil) { + CHIP_ERROR err = CHIP_ERROR_INVALID_ARGUMENT; + *aError = err; + return nil; + } + } + return value; + } + case Attributes::ProtocolVersion::Id: { + using TypeInfo = Attributes::ProtocolVersion::TypeInfo; + TypeInfo::DecodableType cppValue; + *aError = DataModel::Decode(aReader, cppValue); + if (*aError != CHIP_NO_ERROR) { + return nil; + } + NSString * _Nullable value; + if (cppValue.IsNull()) { + value = nil; + } else { + value = AsString(cppValue.Value()); + if (value == nil) { + CHIP_ERROR err = CHIP_ERROR_INVALID_ARGUMENT; + *aError = err; + return nil; + } + } + return value; + } + case Attributes::PowerThreshold::Id: { + using TypeInfo = Attributes::PowerThreshold::TypeInfo; + TypeInfo::DecodableType cppValue; + *aError = DataModel::Decode(aReader, cppValue); + if (*aError != CHIP_NO_ERROR) { + return nil; + } + MTRMeterIdentificationClusterPowerThresholdStruct * _Nullable value; + if (cppValue.IsNull()) { + value = nil; + } else { + value = [MTRMeterIdentificationClusterPowerThresholdStruct new]; + if (cppValue.Value().powerThreshold.HasValue()) { + value.powerThreshold = [NSNumber numberWithLongLong:cppValue.Value().powerThreshold.Value()]; + } else { + value.powerThreshold = nil; + } + if (cppValue.Value().apparentPowerThreshold.HasValue()) { + value.apparentPowerThreshold = [NSNumber numberWithLongLong:cppValue.Value().apparentPowerThreshold.Value()]; + } else { + value.apparentPowerThreshold = nil; + } + if (cppValue.Value().powerThresholdSource.IsNull()) { + value.powerThresholdSource = nil; + } else { + value.powerThresholdSource = [NSNumber numberWithUnsignedChar:chip::to_underlying(cppValue.Value().powerThresholdSource.Value())]; + } + } + return value; + } + default: { + break; + } + } + + *aError = CHIP_ERROR_IM_MALFORMED_ATTRIBUTE_PATH_IB; + return nil; +} static id _Nullable DecodeAttributeValueForUnitTestingCluster(AttributeId aAttributeId, TLV::TLVReader & aReader, CHIP_ERROR * aError) { using namespace Clusters::UnitTesting; @@ -20455,6 +20572,9 @@ id _Nullable MTRDecodeAttributeValue(const ConcreteAttributePath & aPath, TLV::T case Clusters::TlsClientManagement::Id: { return DecodeAttributeValueForTLSClientManagementCluster(aPath.mAttributeId, aReader, aError); } + case Clusters::MeterIdentification::Id: { + return DecodeAttributeValueForMeterIdentificationCluster(aPath.mAttributeId, aReader, aError); + } case Clusters::UnitTesting::Id: { return DecodeAttributeValueForUnitTestingCluster(aPath.mAttributeId, aReader, aError); } diff --git a/src/darwin/Framework/CHIP/zap-generated/MTRBaseClusters.h b/src/darwin/Framework/CHIP/zap-generated/MTRBaseClusters.h index c63a0e7f63e2c9..9558ede5324bce 100644 --- a/src/darwin/Framework/CHIP/zap-generated/MTRBaseClusters.h +++ b/src/darwin/Framework/CHIP/zap-generated/MTRBaseClusters.h @@ -15519,6 +15519,91 @@ MTR_PROVISIONALLY_AVAILABLE @end +/** + * Cluster Meter Identification + * + * This field SHALL indicate the Power Threshold Information. + */ +MTR_PROVISIONALLY_AVAILABLE +@interface MTRBaseClusterMeterIdentification : MTRGenericBaseCluster + +- (void)readAttributeMeterTypeWithCompletion:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completion MTR_PROVISIONALLY_AVAILABLE; +- (void)subscribeAttributeMeterTypeWithParams:(MTRSubscribeParams *)params + subscriptionEstablished:(MTRSubscriptionEstablishedHandler _Nullable)subscriptionEstablished + reportHandler:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))reportHandler MTR_PROVISIONALLY_AVAILABLE; ++ (void)readAttributeMeterTypeWithClusterStateCache:(MTRClusterStateCacheContainer *)clusterStateCacheContainer endpoint:(NSNumber *)endpoint queue:(dispatch_queue_t)queue completion:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completion MTR_PROVISIONALLY_AVAILABLE; + +- (void)readAttributePointOfDeliveryWithCompletion:(void (^)(NSString * _Nullable value, NSError * _Nullable error))completion MTR_PROVISIONALLY_AVAILABLE; +- (void)subscribeAttributePointOfDeliveryWithParams:(MTRSubscribeParams *)params + subscriptionEstablished:(MTRSubscriptionEstablishedHandler _Nullable)subscriptionEstablished + reportHandler:(void (^)(NSString * _Nullable value, NSError * _Nullable error))reportHandler MTR_PROVISIONALLY_AVAILABLE; ++ (void)readAttributePointOfDeliveryWithClusterStateCache:(MTRClusterStateCacheContainer *)clusterStateCacheContainer endpoint:(NSNumber *)endpoint queue:(dispatch_queue_t)queue completion:(void (^)(NSString * _Nullable value, NSError * _Nullable error))completion MTR_PROVISIONALLY_AVAILABLE; + +- (void)readAttributeMeterSerialNumberWithCompletion:(void (^)(NSString * _Nullable value, NSError * _Nullable error))completion MTR_PROVISIONALLY_AVAILABLE; +- (void)subscribeAttributeMeterSerialNumberWithParams:(MTRSubscribeParams *)params + subscriptionEstablished:(MTRSubscriptionEstablishedHandler _Nullable)subscriptionEstablished + reportHandler:(void (^)(NSString * _Nullable value, NSError * _Nullable error))reportHandler MTR_PROVISIONALLY_AVAILABLE; ++ (void)readAttributeMeterSerialNumberWithClusterStateCache:(MTRClusterStateCacheContainer *)clusterStateCacheContainer endpoint:(NSNumber *)endpoint queue:(dispatch_queue_t)queue completion:(void (^)(NSString * _Nullable value, NSError * _Nullable error))completion MTR_PROVISIONALLY_AVAILABLE; + +- (void)readAttributeProtocolVersionWithCompletion:(void (^)(NSString * _Nullable value, NSError * _Nullable error))completion MTR_PROVISIONALLY_AVAILABLE; +- (void)subscribeAttributeProtocolVersionWithParams:(MTRSubscribeParams *)params + subscriptionEstablished:(MTRSubscriptionEstablishedHandler _Nullable)subscriptionEstablished + reportHandler:(void (^)(NSString * _Nullable value, NSError * _Nullable error))reportHandler MTR_PROVISIONALLY_AVAILABLE; ++ (void)readAttributeProtocolVersionWithClusterStateCache:(MTRClusterStateCacheContainer *)clusterStateCacheContainer endpoint:(NSNumber *)endpoint queue:(dispatch_queue_t)queue completion:(void (^)(NSString * _Nullable value, NSError * _Nullable error))completion MTR_PROVISIONALLY_AVAILABLE; + +- (void)readAttributePowerThresholdWithCompletion:(void (^)(MTRMeterIdentificationClusterPowerThresholdStruct * _Nullable value, NSError * _Nullable error))completion MTR_PROVISIONALLY_AVAILABLE; +- (void)subscribeAttributePowerThresholdWithParams:(MTRSubscribeParams *)params + subscriptionEstablished:(MTRSubscriptionEstablishedHandler _Nullable)subscriptionEstablished + reportHandler:(void (^)(MTRMeterIdentificationClusterPowerThresholdStruct * _Nullable value, NSError * _Nullable error))reportHandler MTR_PROVISIONALLY_AVAILABLE; ++ (void)readAttributePowerThresholdWithClusterStateCache:(MTRClusterStateCacheContainer *)clusterStateCacheContainer endpoint:(NSNumber *)endpoint queue:(dispatch_queue_t)queue completion:(void (^)(MTRMeterIdentificationClusterPowerThresholdStruct * _Nullable value, NSError * _Nullable error))completion MTR_PROVISIONALLY_AVAILABLE; + +- (void)readAttributeGeneratedCommandListWithCompletion:(void (^)(NSArray * _Nullable value, NSError * _Nullable error))completion MTR_PROVISIONALLY_AVAILABLE; +- (void)subscribeAttributeGeneratedCommandListWithParams:(MTRSubscribeParams *)params + subscriptionEstablished:(MTRSubscriptionEstablishedHandler _Nullable)subscriptionEstablished + reportHandler:(void (^)(NSArray * _Nullable value, NSError * _Nullable error))reportHandler MTR_PROVISIONALLY_AVAILABLE; ++ (void)readAttributeGeneratedCommandListWithClusterStateCache:(MTRClusterStateCacheContainer *)clusterStateCacheContainer endpoint:(NSNumber *)endpoint queue:(dispatch_queue_t)queue completion:(void (^)(NSArray * _Nullable value, NSError * _Nullable error))completion MTR_PROVISIONALLY_AVAILABLE; + +- (void)readAttributeAcceptedCommandListWithCompletion:(void (^)(NSArray * _Nullable value, NSError * _Nullable error))completion MTR_PROVISIONALLY_AVAILABLE; +- (void)subscribeAttributeAcceptedCommandListWithParams:(MTRSubscribeParams *)params + subscriptionEstablished:(MTRSubscriptionEstablishedHandler _Nullable)subscriptionEstablished + reportHandler:(void (^)(NSArray * _Nullable value, NSError * _Nullable error))reportHandler MTR_PROVISIONALLY_AVAILABLE; ++ (void)readAttributeAcceptedCommandListWithClusterStateCache:(MTRClusterStateCacheContainer *)clusterStateCacheContainer endpoint:(NSNumber *)endpoint queue:(dispatch_queue_t)queue completion:(void (^)(NSArray * _Nullable value, NSError * _Nullable error))completion MTR_PROVISIONALLY_AVAILABLE; + +- (void)readAttributeAttributeListWithCompletion:(void (^)(NSArray * _Nullable value, NSError * _Nullable error))completion MTR_PROVISIONALLY_AVAILABLE; +- (void)subscribeAttributeAttributeListWithParams:(MTRSubscribeParams *)params + subscriptionEstablished:(MTRSubscriptionEstablishedHandler _Nullable)subscriptionEstablished + reportHandler:(void (^)(NSArray * _Nullable value, NSError * _Nullable error))reportHandler MTR_PROVISIONALLY_AVAILABLE; ++ (void)readAttributeAttributeListWithClusterStateCache:(MTRClusterStateCacheContainer *)clusterStateCacheContainer endpoint:(NSNumber *)endpoint queue:(dispatch_queue_t)queue completion:(void (^)(NSArray * _Nullable value, NSError * _Nullable error))completion MTR_PROVISIONALLY_AVAILABLE; + +- (void)readAttributeFeatureMapWithCompletion:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completion MTR_PROVISIONALLY_AVAILABLE; +- (void)subscribeAttributeFeatureMapWithParams:(MTRSubscribeParams *)params + subscriptionEstablished:(MTRSubscriptionEstablishedHandler _Nullable)subscriptionEstablished + reportHandler:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))reportHandler MTR_PROVISIONALLY_AVAILABLE; ++ (void)readAttributeFeatureMapWithClusterStateCache:(MTRClusterStateCacheContainer *)clusterStateCacheContainer endpoint:(NSNumber *)endpoint queue:(dispatch_queue_t)queue completion:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completion MTR_PROVISIONALLY_AVAILABLE; + +- (void)readAttributeClusterRevisionWithCompletion:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completion MTR_PROVISIONALLY_AVAILABLE; +- (void)subscribeAttributeClusterRevisionWithParams:(MTRSubscribeParams *)params + subscriptionEstablished:(MTRSubscriptionEstablishedHandler _Nullable)subscriptionEstablished + reportHandler:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))reportHandler MTR_PROVISIONALLY_AVAILABLE; ++ (void)readAttributeClusterRevisionWithClusterStateCache:(MTRClusterStateCacheContainer *)clusterStateCacheContainer endpoint:(NSNumber *)endpoint queue:(dispatch_queue_t)queue completion:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completion MTR_PROVISIONALLY_AVAILABLE; + +- (instancetype)init NS_UNAVAILABLE; ++ (instancetype)new NS_UNAVAILABLE; + +@end + +@interface MTRBaseClusterMeterIdentification (Availability) + +/** + * For all instance methods (reads, writes, commands) that take a completion, + * the completion will be called on the provided queue. + */ +- (instancetype _Nullable)initWithDevice:(MTRBaseDevice *)device + endpointID:(NSNumber *)endpointID + queue:(dispatch_queue_t)queue MTR_PROVISIONALLY_AVAILABLE; + +@end + /** * Cluster Unit Testing * @@ -20895,6 +20980,22 @@ typedef NS_ENUM(uint8_t, MTRTLSClientManagementTLSEndpointStatus) { MTRTLSClientManagementTLSEndpointStatusInUse MTR_PROVISIONALLY_AVAILABLE = 0x01, } MTR_PROVISIONALLY_AVAILABLE; +typedef NS_ENUM(uint8_t, MTRMeterIdentificationMeterType) { + MTRMeterIdentificationMeterTypeUtility MTR_PROVISIONALLY_AVAILABLE = 0x00, + MTRMeterIdentificationMeterTypePrivate MTR_PROVISIONALLY_AVAILABLE = 0x01, + MTRMeterIdentificationMeterTypeGeneric MTR_PROVISIONALLY_AVAILABLE = 0x02, +} MTR_PROVISIONALLY_AVAILABLE; + +typedef NS_ENUM(uint8_t, MTRMeterIdentificationPowerThresholdSource) { + MTRMeterIdentificationPowerThresholdSourceContract MTR_PROVISIONALLY_AVAILABLE = 0x00, + MTRMeterIdentificationPowerThresholdSourceRegulator MTR_PROVISIONALLY_AVAILABLE = 0x01, + MTRMeterIdentificationPowerThresholdSourceEquipment MTR_PROVISIONALLY_AVAILABLE = 0x02, +} MTR_PROVISIONALLY_AVAILABLE; + +typedef NS_OPTIONS(uint32_t, MTRMeterIdentificationFeature) { + MTRMeterIdentificationFeaturePowerThreshold MTR_PROVISIONALLY_AVAILABLE = 0x1, +} MTR_PROVISIONALLY_AVAILABLE; + typedef NS_ENUM(uint8_t, MTRUnitTestingSimple) { MTRUnitTestingSimpleUnspecified MTR_AVAILABLE(ios(16.4), macos(13.3), watchos(9.4), tvos(16.4)) = 0x00, MTRUnitTestingSimpleValueA MTR_AVAILABLE(ios(16.4), macos(13.3), watchos(9.4), tvos(16.4)) = 0x01, diff --git a/src/darwin/Framework/CHIP/zap-generated/MTRBaseClusters.mm b/src/darwin/Framework/CHIP/zap-generated/MTRBaseClusters.mm index 870f40768e0c16..075be79034c5c1 100644 --- a/src/darwin/Framework/CHIP/zap-generated/MTRBaseClusters.mm +++ b/src/darwin/Framework/CHIP/zap-generated/MTRBaseClusters.mm @@ -104226,6 +104226,370 @@ + (void)readAttributeClusterRevisionWithClusterStateCache:(MTRClusterStateCacheC @end +@implementation MTRBaseClusterMeterIdentification + +- (void)readAttributeMeterTypeWithCompletion:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completion +{ + using TypeInfo = MeterIdentification::Attributes::MeterType::TypeInfo; + [self.device _readKnownAttributeWithEndpointID:self.endpointID + clusterID:@(TypeInfo::GetClusterId()) + attributeID:@(TypeInfo::GetAttributeId()) + params:nil + queue:self.callbackQueue + completion:completion]; +} + +- (void)subscribeAttributeMeterTypeWithParams:(MTRSubscribeParams * _Nonnull)params + subscriptionEstablished:(MTRSubscriptionEstablishedHandler _Nullable)subscriptionEstablished + reportHandler:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))reportHandler +{ + using TypeInfo = MeterIdentification::Attributes::MeterType::TypeInfo; + [self.device _subscribeToKnownAttributeWithEndpointID:self.endpointID + clusterID:@(TypeInfo::GetClusterId()) + attributeID:@(TypeInfo::GetAttributeId()) + params:params + queue:self.callbackQueue + reportHandler:reportHandler + subscriptionEstablished:subscriptionEstablished]; +} + ++ (void)readAttributeMeterTypeWithClusterStateCache:(MTRClusterStateCacheContainer *)clusterStateCacheContainer endpoint:(NSNumber *)endpoint queue:(dispatch_queue_t)queue completion:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completion +{ + using TypeInfo = MeterIdentification::Attributes::MeterType::TypeInfo; + [clusterStateCacheContainer + _readKnownCachedAttributeWithEndpointID:static_cast<chip::EndpointId>([endpoint unsignedShortValue]) + clusterID:TypeInfo::GetClusterId() + attributeID:TypeInfo::GetAttributeId() + queue:queue + completion:completion]; +} + +- (void)readAttributePointOfDeliveryWithCompletion:(void (^)(NSString * _Nullable value, NSError * _Nullable error))completion +{ + using TypeInfo = MeterIdentification::Attributes::PointOfDelivery::TypeInfo; + [self.device _readKnownAttributeWithEndpointID:self.endpointID + clusterID:@(TypeInfo::GetClusterId()) + attributeID:@(TypeInfo::GetAttributeId()) + params:nil + queue:self.callbackQueue + completion:completion]; +} + +- (void)subscribeAttributePointOfDeliveryWithParams:(MTRSubscribeParams * _Nonnull)params + subscriptionEstablished:(MTRSubscriptionEstablishedHandler _Nullable)subscriptionEstablished + reportHandler:(void (^)(NSString * _Nullable value, NSError * _Nullable error))reportHandler +{ + using TypeInfo = MeterIdentification::Attributes::PointOfDelivery::TypeInfo; + [self.device _subscribeToKnownAttributeWithEndpointID:self.endpointID + clusterID:@(TypeInfo::GetClusterId()) + attributeID:@(TypeInfo::GetAttributeId()) + params:params + queue:self.callbackQueue + reportHandler:reportHandler + subscriptionEstablished:subscriptionEstablished]; +} + ++ (void)readAttributePointOfDeliveryWithClusterStateCache:(MTRClusterStateCacheContainer *)clusterStateCacheContainer endpoint:(NSNumber *)endpoint queue:(dispatch_queue_t)queue completion:(void (^)(NSString * _Nullable value, NSError * _Nullable error))completion +{ + using TypeInfo = MeterIdentification::Attributes::PointOfDelivery::TypeInfo; + [clusterStateCacheContainer + _readKnownCachedAttributeWithEndpointID:static_cast<chip::EndpointId>([endpoint unsignedShortValue]) + clusterID:TypeInfo::GetClusterId() + attributeID:TypeInfo::GetAttributeId() + queue:queue + completion:completion]; +} + +- (void)readAttributeMeterSerialNumberWithCompletion:(void (^)(NSString * _Nullable value, NSError * _Nullable error))completion +{ + using TypeInfo = MeterIdentification::Attributes::MeterSerialNumber::TypeInfo; + [self.device _readKnownAttributeWithEndpointID:self.endpointID + clusterID:@(TypeInfo::GetClusterId()) + attributeID:@(TypeInfo::GetAttributeId()) + params:nil + queue:self.callbackQueue + completion:completion]; +} + +- (void)subscribeAttributeMeterSerialNumberWithParams:(MTRSubscribeParams * _Nonnull)params + subscriptionEstablished:(MTRSubscriptionEstablishedHandler _Nullable)subscriptionEstablished + reportHandler:(void (^)(NSString * _Nullable value, NSError * _Nullable error))reportHandler +{ + using TypeInfo = MeterIdentification::Attributes::MeterSerialNumber::TypeInfo; + [self.device _subscribeToKnownAttributeWithEndpointID:self.endpointID + clusterID:@(TypeInfo::GetClusterId()) + attributeID:@(TypeInfo::GetAttributeId()) + params:params + queue:self.callbackQueue + reportHandler:reportHandler + subscriptionEstablished:subscriptionEstablished]; +} + ++ (void)readAttributeMeterSerialNumberWithClusterStateCache:(MTRClusterStateCacheContainer *)clusterStateCacheContainer endpoint:(NSNumber *)endpoint queue:(dispatch_queue_t)queue completion:(void (^)(NSString * _Nullable value, NSError * _Nullable error))completion +{ + using TypeInfo = MeterIdentification::Attributes::MeterSerialNumber::TypeInfo; + [clusterStateCacheContainer + _readKnownCachedAttributeWithEndpointID:static_cast<chip::EndpointId>([endpoint unsignedShortValue]) + clusterID:TypeInfo::GetClusterId() + attributeID:TypeInfo::GetAttributeId() + queue:queue + completion:completion]; +} + +- (void)readAttributeProtocolVersionWithCompletion:(void (^)(NSString * _Nullable value, NSError * _Nullable error))completion +{ + using TypeInfo = MeterIdentification::Attributes::ProtocolVersion::TypeInfo; + [self.device _readKnownAttributeWithEndpointID:self.endpointID + clusterID:@(TypeInfo::GetClusterId()) + attributeID:@(TypeInfo::GetAttributeId()) + params:nil + queue:self.callbackQueue + completion:completion]; +} + +- (void)subscribeAttributeProtocolVersionWithParams:(MTRSubscribeParams * _Nonnull)params + subscriptionEstablished:(MTRSubscriptionEstablishedHandler _Nullable)subscriptionEstablished + reportHandler:(void (^)(NSString * _Nullable value, NSError * _Nullable error))reportHandler +{ + using TypeInfo = MeterIdentification::Attributes::ProtocolVersion::TypeInfo; + [self.device _subscribeToKnownAttributeWithEndpointID:self.endpointID + clusterID:@(TypeInfo::GetClusterId()) + attributeID:@(TypeInfo::GetAttributeId()) + params:params + queue:self.callbackQueue + reportHandler:reportHandler + subscriptionEstablished:subscriptionEstablished]; +} + ++ (void)readAttributeProtocolVersionWithClusterStateCache:(MTRClusterStateCacheContainer *)clusterStateCacheContainer endpoint:(NSNumber *)endpoint queue:(dispatch_queue_t)queue completion:(void (^)(NSString * _Nullable value, NSError * _Nullable error))completion +{ + using TypeInfo = MeterIdentification::Attributes::ProtocolVersion::TypeInfo; + [clusterStateCacheContainer + _readKnownCachedAttributeWithEndpointID:static_cast<chip::EndpointId>([endpoint unsignedShortValue]) + clusterID:TypeInfo::GetClusterId() + attributeID:TypeInfo::GetAttributeId() + queue:queue + completion:completion]; +} + +- (void)readAttributePowerThresholdWithCompletion:(void (^)(MTRMeterIdentificationClusterPowerThresholdStruct * _Nullable value, NSError * _Nullable error))completion +{ + using TypeInfo = MeterIdentification::Attributes::PowerThreshold::TypeInfo; + [self.device _readKnownAttributeWithEndpointID:self.endpointID + clusterID:@(TypeInfo::GetClusterId()) + attributeID:@(TypeInfo::GetAttributeId()) + params:nil + queue:self.callbackQueue + completion:completion]; +} + +- (void)subscribeAttributePowerThresholdWithParams:(MTRSubscribeParams * _Nonnull)params + subscriptionEstablished:(MTRSubscriptionEstablishedHandler _Nullable)subscriptionEstablished + reportHandler:(void (^)(MTRMeterIdentificationClusterPowerThresholdStruct * _Nullable value, NSError * _Nullable error))reportHandler +{ + using TypeInfo = MeterIdentification::Attributes::PowerThreshold::TypeInfo; + [self.device _subscribeToKnownAttributeWithEndpointID:self.endpointID + clusterID:@(TypeInfo::GetClusterId()) + attributeID:@(TypeInfo::GetAttributeId()) + params:params + queue:self.callbackQueue + reportHandler:reportHandler + subscriptionEstablished:subscriptionEstablished]; +} + ++ (void)readAttributePowerThresholdWithClusterStateCache:(MTRClusterStateCacheContainer *)clusterStateCacheContainer endpoint:(NSNumber *)endpoint queue:(dispatch_queue_t)queue completion:(void (^)(MTRMeterIdentificationClusterPowerThresholdStruct * _Nullable value, NSError * _Nullable error))completion +{ + using TypeInfo = MeterIdentification::Attributes::PowerThreshold::TypeInfo; + [clusterStateCacheContainer + _readKnownCachedAttributeWithEndpointID:static_cast<chip::EndpointId>([endpoint unsignedShortValue]) + clusterID:TypeInfo::GetClusterId() + attributeID:TypeInfo::GetAttributeId() + queue:queue + completion:completion]; +} + +- (void)readAttributeGeneratedCommandListWithCompletion:(void (^)(NSArray * _Nullable value, NSError * _Nullable error))completion +{ + using TypeInfo = MeterIdentification::Attributes::GeneratedCommandList::TypeInfo; + [self.device _readKnownAttributeWithEndpointID:self.endpointID + clusterID:@(TypeInfo::GetClusterId()) + attributeID:@(TypeInfo::GetAttributeId()) + params:nil + queue:self.callbackQueue + completion:completion]; +} + +- (void)subscribeAttributeGeneratedCommandListWithParams:(MTRSubscribeParams * _Nonnull)params + subscriptionEstablished:(MTRSubscriptionEstablishedHandler _Nullable)subscriptionEstablished + reportHandler:(void (^)(NSArray * _Nullable value, NSError * _Nullable error))reportHandler +{ + using TypeInfo = MeterIdentification::Attributes::GeneratedCommandList::TypeInfo; + [self.device _subscribeToKnownAttributeWithEndpointID:self.endpointID + clusterID:@(TypeInfo::GetClusterId()) + attributeID:@(TypeInfo::GetAttributeId()) + params:params + queue:self.callbackQueue + reportHandler:reportHandler + subscriptionEstablished:subscriptionEstablished]; +} + ++ (void)readAttributeGeneratedCommandListWithClusterStateCache:(MTRClusterStateCacheContainer *)clusterStateCacheContainer endpoint:(NSNumber *)endpoint queue:(dispatch_queue_t)queue completion:(void (^)(NSArray * _Nullable value, NSError * _Nullable error))completion +{ + using TypeInfo = MeterIdentification::Attributes::GeneratedCommandList::TypeInfo; + [clusterStateCacheContainer + _readKnownCachedAttributeWithEndpointID:static_cast<chip::EndpointId>([endpoint unsignedShortValue]) + clusterID:TypeInfo::GetClusterId() + attributeID:TypeInfo::GetAttributeId() + queue:queue + completion:completion]; +} + +- (void)readAttributeAcceptedCommandListWithCompletion:(void (^)(NSArray * _Nullable value, NSError * _Nullable error))completion +{ + using TypeInfo = MeterIdentification::Attributes::AcceptedCommandList::TypeInfo; + [self.device _readKnownAttributeWithEndpointID:self.endpointID + clusterID:@(TypeInfo::GetClusterId()) + attributeID:@(TypeInfo::GetAttributeId()) + params:nil + queue:self.callbackQueue + completion:completion]; +} + +- (void)subscribeAttributeAcceptedCommandListWithParams:(MTRSubscribeParams * _Nonnull)params + subscriptionEstablished:(MTRSubscriptionEstablishedHandler _Nullable)subscriptionEstablished + reportHandler:(void (^)(NSArray * _Nullable value, NSError * _Nullable error))reportHandler +{ + using TypeInfo = MeterIdentification::Attributes::AcceptedCommandList::TypeInfo; + [self.device _subscribeToKnownAttributeWithEndpointID:self.endpointID + clusterID:@(TypeInfo::GetClusterId()) + attributeID:@(TypeInfo::GetAttributeId()) + params:params + queue:self.callbackQueue + reportHandler:reportHandler + subscriptionEstablished:subscriptionEstablished]; +} + ++ (void)readAttributeAcceptedCommandListWithClusterStateCache:(MTRClusterStateCacheContainer *)clusterStateCacheContainer endpoint:(NSNumber *)endpoint queue:(dispatch_queue_t)queue completion:(void (^)(NSArray * _Nullable value, NSError * _Nullable error))completion +{ + using TypeInfo = MeterIdentification::Attributes::AcceptedCommandList::TypeInfo; + [clusterStateCacheContainer + _readKnownCachedAttributeWithEndpointID:static_cast<chip::EndpointId>([endpoint unsignedShortValue]) + clusterID:TypeInfo::GetClusterId() + attributeID:TypeInfo::GetAttributeId() + queue:queue + completion:completion]; +} + +- (void)readAttributeAttributeListWithCompletion:(void (^)(NSArray * _Nullable value, NSError * _Nullable error))completion +{ + using TypeInfo = MeterIdentification::Attributes::AttributeList::TypeInfo; + [self.device _readKnownAttributeWithEndpointID:self.endpointID + clusterID:@(TypeInfo::GetClusterId()) + attributeID:@(TypeInfo::GetAttributeId()) + params:nil + queue:self.callbackQueue + completion:completion]; +} + +- (void)subscribeAttributeAttributeListWithParams:(MTRSubscribeParams * _Nonnull)params + subscriptionEstablished:(MTRSubscriptionEstablishedHandler _Nullable)subscriptionEstablished + reportHandler:(void (^)(NSArray * _Nullable value, NSError * _Nullable error))reportHandler +{ + using TypeInfo = MeterIdentification::Attributes::AttributeList::TypeInfo; + [self.device _subscribeToKnownAttributeWithEndpointID:self.endpointID + clusterID:@(TypeInfo::GetClusterId()) + attributeID:@(TypeInfo::GetAttributeId()) + params:params + queue:self.callbackQueue + reportHandler:reportHandler + subscriptionEstablished:subscriptionEstablished]; +} + ++ (void)readAttributeAttributeListWithClusterStateCache:(MTRClusterStateCacheContainer *)clusterStateCacheContainer endpoint:(NSNumber *)endpoint queue:(dispatch_queue_t)queue completion:(void (^)(NSArray * _Nullable value, NSError * _Nullable error))completion +{ + using TypeInfo = MeterIdentification::Attributes::AttributeList::TypeInfo; + [clusterStateCacheContainer + _readKnownCachedAttributeWithEndpointID:static_cast<chip::EndpointId>([endpoint unsignedShortValue]) + clusterID:TypeInfo::GetClusterId() + attributeID:TypeInfo::GetAttributeId() + queue:queue + completion:completion]; +} + +- (void)readAttributeFeatureMapWithCompletion:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completion +{ + using TypeInfo = MeterIdentification::Attributes::FeatureMap::TypeInfo; + [self.device _readKnownAttributeWithEndpointID:self.endpointID + clusterID:@(TypeInfo::GetClusterId()) + attributeID:@(TypeInfo::GetAttributeId()) + params:nil + queue:self.callbackQueue + completion:completion]; +} + +- (void)subscribeAttributeFeatureMapWithParams:(MTRSubscribeParams * _Nonnull)params + subscriptionEstablished:(MTRSubscriptionEstablishedHandler _Nullable)subscriptionEstablished + reportHandler:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))reportHandler +{ + using TypeInfo = MeterIdentification::Attributes::FeatureMap::TypeInfo; + [self.device _subscribeToKnownAttributeWithEndpointID:self.endpointID + clusterID:@(TypeInfo::GetClusterId()) + attributeID:@(TypeInfo::GetAttributeId()) + params:params + queue:self.callbackQueue + reportHandler:reportHandler + subscriptionEstablished:subscriptionEstablished]; +} + ++ (void)readAttributeFeatureMapWithClusterStateCache:(MTRClusterStateCacheContainer *)clusterStateCacheContainer endpoint:(NSNumber *)endpoint queue:(dispatch_queue_t)queue completion:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completion +{ + using TypeInfo = MeterIdentification::Attributes::FeatureMap::TypeInfo; + [clusterStateCacheContainer + _readKnownCachedAttributeWithEndpointID:static_cast<chip::EndpointId>([endpoint unsignedShortValue]) + clusterID:TypeInfo::GetClusterId() + attributeID:TypeInfo::GetAttributeId() + queue:queue + completion:completion]; +} + +- (void)readAttributeClusterRevisionWithCompletion:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completion +{ + using TypeInfo = MeterIdentification::Attributes::ClusterRevision::TypeInfo; + [self.device _readKnownAttributeWithEndpointID:self.endpointID + clusterID:@(TypeInfo::GetClusterId()) + attributeID:@(TypeInfo::GetAttributeId()) + params:nil + queue:self.callbackQueue + completion:completion]; +} + +- (void)subscribeAttributeClusterRevisionWithParams:(MTRSubscribeParams * _Nonnull)params + subscriptionEstablished:(MTRSubscriptionEstablishedHandler _Nullable)subscriptionEstablished + reportHandler:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))reportHandler +{ + using TypeInfo = MeterIdentification::Attributes::ClusterRevision::TypeInfo; + [self.device _subscribeToKnownAttributeWithEndpointID:self.endpointID + clusterID:@(TypeInfo::GetClusterId()) + attributeID:@(TypeInfo::GetAttributeId()) + params:params + queue:self.callbackQueue + reportHandler:reportHandler + subscriptionEstablished:subscriptionEstablished]; +} + ++ (void)readAttributeClusterRevisionWithClusterStateCache:(MTRClusterStateCacheContainer *)clusterStateCacheContainer endpoint:(NSNumber *)endpoint queue:(dispatch_queue_t)queue completion:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completion +{ + using TypeInfo = MeterIdentification::Attributes::ClusterRevision::TypeInfo; + [clusterStateCacheContainer + _readKnownCachedAttributeWithEndpointID:static_cast<chip::EndpointId>([endpoint unsignedShortValue]) + clusterID:TypeInfo::GetClusterId() + attributeID:TypeInfo::GetAttributeId() + queue:queue + completion:completion]; +} + +@end + @implementation MTRBaseClusterUnitTesting - (void)testWithCompletion:(MTRStatusCompletion)completion diff --git a/src/darwin/Framework/CHIP/zap-generated/MTRClusterConstants.h b/src/darwin/Framework/CHIP/zap-generated/MTRClusterConstants.h index f493dcdf03fba7..666c2b0dfe4291 100644 --- a/src/darwin/Framework/CHIP/zap-generated/MTRClusterConstants.h +++ b/src/darwin/Framework/CHIP/zap-generated/MTRClusterConstants.h @@ -209,6 +209,7 @@ typedef NS_ENUM(uint32_t, MTRClusterIDType) { MTRClusterIDTypeCommissionerControlID MTR_AVAILABLE(ios(18.4), macos(15.4), watchos(11.4), tvos(18.4)) = 0x00000751, MTRClusterIDTypeTLSCertificateManagementID MTR_PROVISIONALLY_AVAILABLE = 0x00000801, MTRClusterIDTypeTLSClientManagementID MTR_PROVISIONALLY_AVAILABLE = 0x00000802, + MTRClusterIDTypeMeterIdentificationID MTR_PROVISIONALLY_AVAILABLE = 0x00000B06, MTRClusterIDTypeUnitTestingID MTR_AVAILABLE(ios(16.4), macos(13.3), watchos(9.4), tvos(16.4)) = 0xFFF1FC05, MTRClusterIDTypeSampleMEIID MTR_PROVISIONALLY_AVAILABLE = 0xFFF1FC20, @@ -4785,6 +4786,18 @@ typedef NS_ENUM(uint32_t, MTRAttributeIDType) { MTRAttributeIDTypeClusterTLSClientManagementAttributeFeatureMapID MTR_PROVISIONALLY_AVAILABLE = MTRAttributeIDTypeGlobalAttributeFeatureMapID, MTRAttributeIDTypeClusterTLSClientManagementAttributeClusterRevisionID MTR_PROVISIONALLY_AVAILABLE = MTRAttributeIDTypeGlobalAttributeClusterRevisionID, + // Cluster MeterIdentification attributes + MTRAttributeIDTypeClusterMeterIdentificationAttributeMeterTypeID MTR_PROVISIONALLY_AVAILABLE = 0x00000000, + MTRAttributeIDTypeClusterMeterIdentificationAttributePointOfDeliveryID MTR_PROVISIONALLY_AVAILABLE = 0x00000001, + MTRAttributeIDTypeClusterMeterIdentificationAttributeMeterSerialNumberID MTR_PROVISIONALLY_AVAILABLE = 0x00000002, + MTRAttributeIDTypeClusterMeterIdentificationAttributeProtocolVersionID MTR_PROVISIONALLY_AVAILABLE = 0x00000003, + MTRAttributeIDTypeClusterMeterIdentificationAttributePowerThresholdID MTR_PROVISIONALLY_AVAILABLE = 0x00000004, + MTRAttributeIDTypeClusterMeterIdentificationAttributeGeneratedCommandListID MTR_PROVISIONALLY_AVAILABLE = MTRAttributeIDTypeGlobalAttributeGeneratedCommandListID, + MTRAttributeIDTypeClusterMeterIdentificationAttributeAcceptedCommandListID MTR_PROVISIONALLY_AVAILABLE = MTRAttributeIDTypeGlobalAttributeAcceptedCommandListID, + MTRAttributeIDTypeClusterMeterIdentificationAttributeAttributeListID MTR_PROVISIONALLY_AVAILABLE = MTRAttributeIDTypeGlobalAttributeAttributeListID, + MTRAttributeIDTypeClusterMeterIdentificationAttributeFeatureMapID MTR_PROVISIONALLY_AVAILABLE = MTRAttributeIDTypeGlobalAttributeFeatureMapID, + MTRAttributeIDTypeClusterMeterIdentificationAttributeClusterRevisionID MTR_PROVISIONALLY_AVAILABLE = MTRAttributeIDTypeGlobalAttributeClusterRevisionID, + // Cluster TestCluster deprecated attribute names MTRClusterTestClusterAttributeBooleanID MTR_DEPRECATED("Please use MTRAttributeIDTypeClusterUnitTestingAttributeBooleanID", ios(16.1, 16.4), macos(13.0, 13.3), watchos(9.1, 9.4), tvos(16.1, 16.4)) diff --git a/src/darwin/Framework/CHIP/zap-generated/MTRClusterNames.mm b/src/darwin/Framework/CHIP/zap-generated/MTRClusterNames.mm index 9e2653571e303d..6948bbc4dd638c 100644 --- a/src/darwin/Framework/CHIP/zap-generated/MTRClusterNames.mm +++ b/src/darwin/Framework/CHIP/zap-generated/MTRClusterNames.mm @@ -405,6 +405,9 @@ case MTRClusterIDTypeTLSClientManagementID: result = @"TLSClientManagement"; break; + case MTRClusterIDTypeMeterIdentificationID: + result = @"MeterIdentification"; + break; case MTRClusterIDTypeUnitTestingID: result = @"UnitTesting"; break; @@ -8354,6 +8357,57 @@ } break; + case MTRClusterIDTypeMeterIdentificationID: + + switch (attributeID) { + + // Cluster MeterIdentification attributes + case MTRAttributeIDTypeClusterMeterIdentificationAttributeMeterTypeID: + result = @"MeterType"; + break; + + case MTRAttributeIDTypeClusterMeterIdentificationAttributePointOfDeliveryID: + result = @"PointOfDelivery"; + break; + + case MTRAttributeIDTypeClusterMeterIdentificationAttributeMeterSerialNumberID: + result = @"MeterSerialNumber"; + break; + + case MTRAttributeIDTypeClusterMeterIdentificationAttributeProtocolVersionID: + result = @"ProtocolVersion"; + break; + + case MTRAttributeIDTypeClusterMeterIdentificationAttributePowerThresholdID: + result = @"PowerThreshold"; + break; + + case MTRAttributeIDTypeClusterMeterIdentificationAttributeGeneratedCommandListID: + result = @"GeneratedCommandList"; + break; + + case MTRAttributeIDTypeClusterMeterIdentificationAttributeAcceptedCommandListID: + result = @"AcceptedCommandList"; + break; + + case MTRAttributeIDTypeClusterMeterIdentificationAttributeAttributeListID: + result = @"AttributeList"; + break; + + case MTRAttributeIDTypeClusterMeterIdentificationAttributeFeatureMapID: + result = @"FeatureMap"; + break; + + case MTRAttributeIDTypeClusterMeterIdentificationAttributeClusterRevisionID: + result = @"ClusterRevision"; + break; + + default: + result = [NSString stringWithFormat:@"<Unknown attributeID %u>", attributeID]; + break; + } + break; + case MTRClusterIDTypeUnitTestingID: switch (attributeID) { @@ -11336,6 +11390,16 @@ } break; + case MTRClusterIDTypeMeterIdentificationID: + + switch (commandID) { + + default: + result = [NSString stringWithFormat:@"<Unknown commandID %u>", commandID]; + break; + } + break; + case MTRClusterIDTypeUnitTestingID: switch (commandID) { @@ -13106,6 +13170,16 @@ } break; + case MTRClusterIDTypeMeterIdentificationID: + + switch (commandID) { + + default: + result = [NSString stringWithFormat:@"<Unknown commandID %u>", commandID]; + break; + } + break; + case MTRClusterIDTypeUnitTestingID: switch (commandID) { @@ -14976,6 +15050,16 @@ } break; + case MTRClusterIDTypeMeterIdentificationID: + + switch (eventID) { + + default: + result = [NSString stringWithFormat:@"<Unknown eventID %u>", eventID]; + break; + } + break; + case MTRClusterIDTypeUnitTestingID: switch (eventID) { diff --git a/src/darwin/Framework/CHIP/zap-generated/MTRClusters.h b/src/darwin/Framework/CHIP/zap-generated/MTRClusters.h index 53732f76a0a3c0..64e9366150cd7d 100644 --- a/src/darwin/Framework/CHIP/zap-generated/MTRClusters.h +++ b/src/darwin/Framework/CHIP/zap-generated/MTRClusters.h @@ -7242,6 +7242,50 @@ MTR_PROVISIONALLY_AVAILABLE @end +/** + * Cluster Meter Identification + * This field SHALL indicate the Power Threshold Information. + */ +MTR_PROVISIONALLY_AVAILABLE +@interface MTRClusterMeterIdentification : MTRGenericCluster + +- (NSDictionary<NSString *, id> * _Nullable)readAttributeMeterTypeWithParams:(MTRReadParams * _Nullable)params MTR_PROVISIONALLY_AVAILABLE; + +- (NSDictionary<NSString *, id> * _Nullable)readAttributePointOfDeliveryWithParams:(MTRReadParams * _Nullable)params MTR_PROVISIONALLY_AVAILABLE; + +- (NSDictionary<NSString *, id> * _Nullable)readAttributeMeterSerialNumberWithParams:(MTRReadParams * _Nullable)params MTR_PROVISIONALLY_AVAILABLE; + +- (NSDictionary<NSString *, id> * _Nullable)readAttributeProtocolVersionWithParams:(MTRReadParams * _Nullable)params MTR_PROVISIONALLY_AVAILABLE; + +- (NSDictionary<NSString *, id> * _Nullable)readAttributePowerThresholdWithParams:(MTRReadParams * _Nullable)params MTR_PROVISIONALLY_AVAILABLE; + +- (NSDictionary<NSString *, id> * _Nullable)readAttributeGeneratedCommandListWithParams:(MTRReadParams * _Nullable)params MTR_PROVISIONALLY_AVAILABLE; + +- (NSDictionary<NSString *, id> * _Nullable)readAttributeAcceptedCommandListWithParams:(MTRReadParams * _Nullable)params MTR_PROVISIONALLY_AVAILABLE; + +- (NSDictionary<NSString *, id> * _Nullable)readAttributeAttributeListWithParams:(MTRReadParams * _Nullable)params MTR_PROVISIONALLY_AVAILABLE; + +- (NSDictionary<NSString *, id> * _Nullable)readAttributeFeatureMapWithParams:(MTRReadParams * _Nullable)params MTR_PROVISIONALLY_AVAILABLE; + +- (NSDictionary<NSString *, id> * _Nullable)readAttributeClusterRevisionWithParams:(MTRReadParams * _Nullable)params MTR_PROVISIONALLY_AVAILABLE; + +- (instancetype)init NS_UNAVAILABLE; ++ (instancetype)new NS_UNAVAILABLE; + +@end + +@interface MTRClusterMeterIdentification (Availability) + +/** + * The queue is currently unused, but may be used in the future for calling completions + * for command invocations if commands are added to this cluster. + */ +- (instancetype _Nullable)initWithDevice:(MTRDevice *)device + endpointID:(NSNumber *)endpointID + queue:(dispatch_queue_t)queue MTR_PROVISIONALLY_AVAILABLE; + +@end + /** * Cluster Unit Testing * The Test Cluster is meant to validate the generated code diff --git a/src/darwin/Framework/CHIP/zap-generated/MTRClusters.mm b/src/darwin/Framework/CHIP/zap-generated/MTRClusters.mm index a5077ab2810558..4354ee77ed4f49 100644 --- a/src/darwin/Framework/CHIP/zap-generated/MTRClusters.mm +++ b/src/darwin/Framework/CHIP/zap-generated/MTRClusters.mm @@ -21303,6 +21303,60 @@ - (void)removeEndpointWithParams:(MTRTLSClientManagementClusterRemoveEndpointPar @end +@implementation MTRClusterMeterIdentification + +- (NSDictionary<NSString *, id> * _Nullable)readAttributeMeterTypeWithParams:(MTRReadParams * _Nullable)params +{ + return [self.device readAttributeWithEndpointID:self.endpointID clusterID:@(MTRClusterIDTypeMeterIdentificationID) attributeID:@(MTRAttributeIDTypeClusterMeterIdentificationAttributeMeterTypeID) params:params]; +} + +- (NSDictionary<NSString *, id> * _Nullable)readAttributePointOfDeliveryWithParams:(MTRReadParams * _Nullable)params +{ + return [self.device readAttributeWithEndpointID:self.endpointID clusterID:@(MTRClusterIDTypeMeterIdentificationID) attributeID:@(MTRAttributeIDTypeClusterMeterIdentificationAttributePointOfDeliveryID) params:params]; +} + +- (NSDictionary<NSString *, id> * _Nullable)readAttributeMeterSerialNumberWithParams:(MTRReadParams * _Nullable)params +{ + return [self.device readAttributeWithEndpointID:self.endpointID clusterID:@(MTRClusterIDTypeMeterIdentificationID) attributeID:@(MTRAttributeIDTypeClusterMeterIdentificationAttributeMeterSerialNumberID) params:params]; +} + +- (NSDictionary<NSString *, id> * _Nullable)readAttributeProtocolVersionWithParams:(MTRReadParams * _Nullable)params +{ + return [self.device readAttributeWithEndpointID:self.endpointID clusterID:@(MTRClusterIDTypeMeterIdentificationID) attributeID:@(MTRAttributeIDTypeClusterMeterIdentificationAttributeProtocolVersionID) params:params]; +} + +- (NSDictionary<NSString *, id> * _Nullable)readAttributePowerThresholdWithParams:(MTRReadParams * _Nullable)params +{ + return [self.device readAttributeWithEndpointID:self.endpointID clusterID:@(MTRClusterIDTypeMeterIdentificationID) attributeID:@(MTRAttributeIDTypeClusterMeterIdentificationAttributePowerThresholdID) params:params]; +} + +- (NSDictionary<NSString *, id> * _Nullable)readAttributeGeneratedCommandListWithParams:(MTRReadParams * _Nullable)params +{ + return [self.device readAttributeWithEndpointID:self.endpointID clusterID:@(MTRClusterIDTypeMeterIdentificationID) attributeID:@(MTRAttributeIDTypeClusterMeterIdentificationAttributeGeneratedCommandListID) params:params]; +} + +- (NSDictionary<NSString *, id> * _Nullable)readAttributeAcceptedCommandListWithParams:(MTRReadParams * _Nullable)params +{ + return [self.device readAttributeWithEndpointID:self.endpointID clusterID:@(MTRClusterIDTypeMeterIdentificationID) attributeID:@(MTRAttributeIDTypeClusterMeterIdentificationAttributeAcceptedCommandListID) params:params]; +} + +- (NSDictionary<NSString *, id> * _Nullable)readAttributeAttributeListWithParams:(MTRReadParams * _Nullable)params +{ + return [self.device readAttributeWithEndpointID:self.endpointID clusterID:@(MTRClusterIDTypeMeterIdentificationID) attributeID:@(MTRAttributeIDTypeClusterMeterIdentificationAttributeAttributeListID) params:params]; +} + +- (NSDictionary<NSString *, id> * _Nullable)readAttributeFeatureMapWithParams:(MTRReadParams * _Nullable)params +{ + return [self.device readAttributeWithEndpointID:self.endpointID clusterID:@(MTRClusterIDTypeMeterIdentificationID) attributeID:@(MTRAttributeIDTypeClusterMeterIdentificationAttributeFeatureMapID) params:params]; +} + +- (NSDictionary<NSString *, id> * _Nullable)readAttributeClusterRevisionWithParams:(MTRReadParams * _Nullable)params +{ + return [self.device readAttributeWithEndpointID:self.endpointID clusterID:@(MTRClusterIDTypeMeterIdentificationID) attributeID:@(MTRAttributeIDTypeClusterMeterIdentificationAttributeClusterRevisionID) params:params]; +} + +@end + @implementation MTRClusterUnitTesting - (void)testWithExpectedValues:(NSArray<NSDictionary<NSString *, id> *> *)expectedValues expectedValueInterval:(NSNumber *)expectedValueIntervalMs completion:(MTRStatusCompletion)completion diff --git a/src/darwin/Framework/CHIP/zap-generated/MTRCommandTimedCheck.mm b/src/darwin/Framework/CHIP/zap-generated/MTRCommandTimedCheck.mm index 2207c19248a7ca..2056a4fd46d747 100644 --- a/src/darwin/Framework/CHIP/zap-generated/MTRCommandTimedCheck.mm +++ b/src/darwin/Framework/CHIP/zap-generated/MTRCommandTimedCheck.mm @@ -1232,6 +1232,15 @@ static BOOL CommandNeedsTimedInvokeInTLSClientManagementCluster(AttributeId aAtt } } } +static BOOL CommandNeedsTimedInvokeInMeterIdentificationCluster(AttributeId aAttributeId) +{ + using namespace Clusters::MeterIdentification; + switch (aAttributeId) { + default: { + return NO; + } + } +} static BOOL CommandNeedsTimedInvokeInUnitTestingCluster(AttributeId aAttributeId) { using namespace Clusters::UnitTesting; @@ -1638,6 +1647,9 @@ BOOL MTRCommandNeedsTimedInvoke(NSNumber * _Nonnull aClusterID, NSNumber * _Nonn case Clusters::TlsClientManagement::Id: { return CommandNeedsTimedInvokeInTLSClientManagementCluster(commandID); } + case Clusters::MeterIdentification::Id: { + return CommandNeedsTimedInvokeInMeterIdentificationCluster(commandID); + } case Clusters::UnitTesting::Id: { return CommandNeedsTimedInvokeInUnitTestingCluster(commandID); } diff --git a/src/darwin/Framework/CHIP/zap-generated/MTREventTLVValueDecoder.mm b/src/darwin/Framework/CHIP/zap-generated/MTREventTLVValueDecoder.mm index c71e7360ef6734..1e4d79c4893a09 100644 --- a/src/darwin/Framework/CHIP/zap-generated/MTREventTLVValueDecoder.mm +++ b/src/darwin/Framework/CHIP/zap-generated/MTREventTLVValueDecoder.mm @@ -4855,6 +4855,18 @@ static id _Nullable DecodeEventPayloadForTLSClientManagementCluster(EventId aEve *aError = CHIP_ERROR_IM_MALFORMED_EVENT_PATH_IB; return nil; } +static id _Nullable DecodeEventPayloadForMeterIdentificationCluster(EventId aEventId, TLV::TLVReader & aReader, CHIP_ERROR * aError) +{ + using namespace Clusters::MeterIdentification; + switch (aEventId) { + default: { + break; + } + } + + *aError = CHIP_ERROR_IM_MALFORMED_EVENT_PATH_IB; + return nil; +} static id _Nullable DecodeEventPayloadForUnitTestingCluster(EventId aEventId, TLV::TLVReader & aReader, CHIP_ERROR * aError) { using namespace Clusters::UnitTesting; @@ -5425,6 +5437,9 @@ id _Nullable MTRDecodeEventPayload(const ConcreteEventPath & aPath, TLV::TLVRead case Clusters::TlsClientManagement::Id: { return DecodeEventPayloadForTLSClientManagementCluster(aPath.mEventId, aReader, aError); } + case Clusters::MeterIdentification::Id: { + return DecodeEventPayloadForMeterIdentificationCluster(aPath.mEventId, aReader, aError); + } case Clusters::UnitTesting::Id: { return DecodeEventPayloadForUnitTestingCluster(aPath.mEventId, aReader, aError); } diff --git a/src/darwin/Framework/CHIP/zap-generated/MTRStructsObjc.h b/src/darwin/Framework/CHIP/zap-generated/MTRStructsObjc.h index a0d83d1940f84f..37f771e918f8af 100644 --- a/src/darwin/Framework/CHIP/zap-generated/MTRStructsObjc.h +++ b/src/darwin/Framework/CHIP/zap-generated/MTRStructsObjc.h @@ -2463,6 +2463,13 @@ MTR_PROVISIONALLY_AVAILABLE @property (nonatomic, copy) NSNumber * _Nonnull status MTR_PROVISIONALLY_AVAILABLE; @end +MTR_PROVISIONALLY_AVAILABLE +@interface MTRMeterIdentificationClusterPowerThresholdStruct : NSObject <NSCopying> +@property (nonatomic, copy) NSNumber * _Nullable powerThreshold MTR_PROVISIONALLY_AVAILABLE; +@property (nonatomic, copy) NSNumber * _Nullable apparentPowerThreshold MTR_PROVISIONALLY_AVAILABLE; +@property (nonatomic, copy) NSNumber * _Nullable powerThresholdSource MTR_PROVISIONALLY_AVAILABLE; +@end + MTR_AVAILABLE(ios(16.4), macos(13.3), watchos(9.4), tvos(16.4)) @interface MTRUnitTestingClusterSimpleStruct : NSObject <NSCopying> @property (nonatomic, copy) NSNumber * _Nonnull a MTR_AVAILABLE(ios(16.4), macos(13.3), watchos(9.4), tvos(16.4)); diff --git a/src/darwin/Framework/CHIP/zap-generated/MTRStructsObjc.mm b/src/darwin/Framework/CHIP/zap-generated/MTRStructsObjc.mm index 694c25a4e9a594..9bde226458b4d6 100644 --- a/src/darwin/Framework/CHIP/zap-generated/MTRStructsObjc.mm +++ b/src/darwin/Framework/CHIP/zap-generated/MTRStructsObjc.mm @@ -10310,6 +10310,39 @@ - (NSString *)description @end +@implementation MTRMeterIdentificationClusterPowerThresholdStruct +- (instancetype)init +{ + if (self = [super init]) { + + _powerThreshold = nil; + + _apparentPowerThreshold = nil; + + _powerThresholdSource = nil; + } + return self; +} + +- (id)copyWithZone:(NSZone * _Nullable)zone +{ + auto other = [[MTRMeterIdentificationClusterPowerThresholdStruct alloc] init]; + + other.powerThreshold = self.powerThreshold; + other.apparentPowerThreshold = self.apparentPowerThreshold; + other.powerThresholdSource = self.powerThresholdSource; + + return other; +} + +- (NSString *)description +{ + NSString * descriptionString = [NSString stringWithFormat:@"<%@: powerThreshold:%@; apparentPowerThreshold:%@; powerThresholdSource:%@; >", NSStringFromClass([self class]), _powerThreshold, _apparentPowerThreshold, _powerThresholdSource]; + return descriptionString; +} + +@end + @implementation MTRUnitTestingClusterSimpleStruct - (instancetype)init { diff --git a/zzz_generated/app-common/app-common/zap-generated/attributes/Accessors.cpp b/zzz_generated/app-common/app-common/zap-generated/attributes/Accessors.cpp index 798e2399891db7..1871e84d5a52d2 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 @@ -40106,6 +40106,467 @@ Protocols::InteractionModel::Status Set(EndpointId endpoint, uint16_t value) } // namespace Attributes } // namespace TlsClientManagement +namespace MeterIdentification { +namespace Attributes { + +namespace MeterType { + +Protocols::InteractionModel::Status Get(EndpointId endpoint, + DataModel::Nullable<chip::app::Clusters::MeterIdentification::MeterTypeEnum> & value) +{ + using Traits = NumericAttributeTraits<chip::app::Clusters::MeterIdentification::MeterTypeEnum>; + Traits::StorageType temp; + uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp); + Protocols::InteractionModel::Status status = + emberAfReadAttribute(endpoint, Clusters::MeterIdentification::Id, Id, readable, sizeof(temp)); + VerifyOrReturnError(Protocols::InteractionModel::Status::Success == status, status); + if (Traits::IsNullValue(temp)) + { + value.SetNull(); + } + else + { + value.SetNonNull() = Traits::StorageToWorking(temp); + } + return status; +} + +Protocols::InteractionModel::Status Set(EndpointId endpoint, chip::app::Clusters::MeterIdentification::MeterTypeEnum value, + MarkAttributeDirty markDirty) +{ + using Traits = NumericAttributeTraits<chip::app::Clusters::MeterIdentification::MeterTypeEnum>; + if (!Traits::CanRepresentValue(/* isNullable = */ true, value)) + { + return Protocols::InteractionModel::Status::ConstraintError; + } + Traits::StorageType storageValue; + Traits::WorkingToStorage(value, storageValue); + uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue); + return emberAfWriteAttribute(ConcreteAttributePath(endpoint, Clusters::MeterIdentification::Id, Id), + EmberAfWriteDataInput(writable, ZCL_ENUM8_ATTRIBUTE_TYPE).SetMarkDirty(markDirty)); +} + +Protocols::InteractionModel::Status Set(EndpointId endpoint, chip::app::Clusters::MeterIdentification::MeterTypeEnum value) +{ + using Traits = NumericAttributeTraits<chip::app::Clusters::MeterIdentification::MeterTypeEnum>; + if (!Traits::CanRepresentValue(/* isNullable = */ true, value)) + { + return Protocols::InteractionModel::Status::ConstraintError; + } + Traits::StorageType storageValue; + Traits::WorkingToStorage(value, storageValue); + uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue); + return emberAfWriteAttribute(endpoint, Clusters::MeterIdentification::Id, Id, writable, ZCL_ENUM8_ATTRIBUTE_TYPE); +} + +Protocols::InteractionModel::Status SetNull(EndpointId endpoint, MarkAttributeDirty markDirty) +{ + using Traits = NumericAttributeTraits<chip::app::Clusters::MeterIdentification::MeterTypeEnum>; + Traits::StorageType value; + Traits::SetNull(value); + uint8_t * writable = Traits::ToAttributeStoreRepresentation(value); + return emberAfWriteAttribute(ConcreteAttributePath(endpoint, Clusters::MeterIdentification::Id, Id), + EmberAfWriteDataInput(writable, ZCL_ENUM8_ATTRIBUTE_TYPE).SetMarkDirty(markDirty)); +} + +Protocols::InteractionModel::Status SetNull(EndpointId endpoint) +{ + using Traits = NumericAttributeTraits<chip::app::Clusters::MeterIdentification::MeterTypeEnum>; + Traits::StorageType value; + Traits::SetNull(value); + uint8_t * writable = Traits::ToAttributeStoreRepresentation(value); + return emberAfWriteAttribute(endpoint, Clusters::MeterIdentification::Id, Id, writable, ZCL_ENUM8_ATTRIBUTE_TYPE); +} + +Protocols::InteractionModel::Status +Set(EndpointId endpoint, const chip::app::DataModel::Nullable<chip::app::Clusters::MeterIdentification::MeterTypeEnum> & value, + MarkAttributeDirty markDirty) +{ + if (value.IsNull()) + { + return SetNull(endpoint, markDirty); + } + + return Set(endpoint, value.Value(), markDirty); +} + +Protocols::InteractionModel::Status +Set(EndpointId endpoint, const chip::app::DataModel::Nullable<chip::app::Clusters::MeterIdentification::MeterTypeEnum> & value) +{ + if (value.IsNull()) + { + return SetNull(endpoint); + } + + return Set(endpoint, value.Value()); +} + +} // namespace MeterType + +namespace PointOfDelivery { + +Protocols::InteractionModel::Status Get(EndpointId endpoint, DataModel::Nullable<chip::MutableCharSpan> & value) +{ + if (value.IsNull()) + { + ChipLogError(Zcl, "Null Nullable<Span> passed to MeterIdentification::PointOfDelivery::Get"); + return Protocols::InteractionModel::Status::Failure; + } + + uint8_t zclString[64 + 1]; + Protocols::InteractionModel::Status status = + emberAfReadAttribute(endpoint, Clusters::MeterIdentification::Id, Id, zclString, sizeof(zclString)); + VerifyOrReturnError(Protocols::InteractionModel::Status::Success == status, status); + size_t length = emberAfStringLength(zclString); + if (length == NumericAttributeTraits<uint8_t>::kNullValue) + { + value.SetNull(); + return Protocols::InteractionModel::Status::Success; + } + auto & span = value.Value(); + + VerifyOrReturnError(span.size() == 64, Protocols::InteractionModel::Status::InvalidDataType); + memcpy(span.data(), &zclString[1], 64); + span.reduce_size(length); + return status; +} + +Protocols::InteractionModel::Status Set(EndpointId endpoint, chip::CharSpan value, MarkAttributeDirty markDirty) +{ + + static_assert(64 < NumericAttributeTraits<uint8_t>::kNullValue, "value.size() might be too big"); + VerifyOrReturnError(value.size() <= 64, Protocols::InteractionModel::Status::ConstraintError); + uint8_t zclString[64 + 1]; + auto length = static_cast<uint8_t>(value.size()); + Encoding::Put8(zclString, length); + memcpy(&zclString[1], value.data(), value.size()); + return emberAfWriteAttribute(ConcreteAttributePath(endpoint, Clusters::MeterIdentification::Id, Id), + EmberAfWriteDataInput(zclString, ZCL_CHAR_STRING_ATTRIBUTE_TYPE).SetMarkDirty(markDirty)); +} + +Protocols::InteractionModel::Status Set(EndpointId endpoint, chip::CharSpan value) +{ + + static_assert(64 < NumericAttributeTraits<uint8_t>::kNullValue, "value.size() might be too big"); + VerifyOrReturnError(value.size() <= 64, Protocols::InteractionModel::Status::ConstraintError); + uint8_t zclString[64 + 1]; + auto length = static_cast<uint8_t>(value.size()); + Encoding::Put8(zclString, length); + memcpy(&zclString[1], value.data(), value.size()); + return emberAfWriteAttribute(endpoint, Clusters::MeterIdentification::Id, Id, zclString, ZCL_CHAR_STRING_ATTRIBUTE_TYPE); +} + +Protocols::InteractionModel::Status SetNull(EndpointId endpoint, MarkAttributeDirty markDirty) +{ + uint8_t zclString[1] = { 0xFF }; + return emberAfWriteAttribute(ConcreteAttributePath(endpoint, Clusters::MeterIdentification::Id, Id), + EmberAfWriteDataInput(zclString, ZCL_CHAR_STRING_ATTRIBUTE_TYPE).SetMarkDirty(markDirty)); +} + +Protocols::InteractionModel::Status SetNull(EndpointId endpoint) +{ + uint8_t zclString[1] = { 0xFF }; + return emberAfWriteAttribute(endpoint, Clusters::MeterIdentification::Id, Id, zclString, ZCL_CHAR_STRING_ATTRIBUTE_TYPE); +} + +Protocols::InteractionModel::Status Set(EndpointId endpoint, const chip::app::DataModel::Nullable<chip::CharSpan> & value, + MarkAttributeDirty markDirty) +{ + if (value.IsNull()) + { + return SetNull(endpoint, markDirty); + } + + return Set(endpoint, value.Value(), markDirty); +} + +Protocols::InteractionModel::Status Set(EndpointId endpoint, const chip::app::DataModel::Nullable<chip::CharSpan> & value) +{ + if (value.IsNull()) + { + return SetNull(endpoint); + } + + return Set(endpoint, value.Value()); +} + +} // namespace PointOfDelivery + +namespace MeterSerialNumber { + +Protocols::InteractionModel::Status Get(EndpointId endpoint, DataModel::Nullable<chip::MutableCharSpan> & value) +{ + if (value.IsNull()) + { + ChipLogError(Zcl, "Null Nullable<Span> passed to MeterIdentification::MeterSerialNumber::Get"); + return Protocols::InteractionModel::Status::Failure; + } + + uint8_t zclString[64 + 1]; + Protocols::InteractionModel::Status status = + emberAfReadAttribute(endpoint, Clusters::MeterIdentification::Id, Id, zclString, sizeof(zclString)); + VerifyOrReturnError(Protocols::InteractionModel::Status::Success == status, status); + size_t length = emberAfStringLength(zclString); + if (length == NumericAttributeTraits<uint8_t>::kNullValue) + { + value.SetNull(); + return Protocols::InteractionModel::Status::Success; + } + auto & span = value.Value(); + + VerifyOrReturnError(span.size() == 64, Protocols::InteractionModel::Status::InvalidDataType); + memcpy(span.data(), &zclString[1], 64); + span.reduce_size(length); + return status; +} + +Protocols::InteractionModel::Status Set(EndpointId endpoint, chip::CharSpan value, MarkAttributeDirty markDirty) +{ + + static_assert(64 < NumericAttributeTraits<uint8_t>::kNullValue, "value.size() might be too big"); + VerifyOrReturnError(value.size() <= 64, Protocols::InteractionModel::Status::ConstraintError); + uint8_t zclString[64 + 1]; + auto length = static_cast<uint8_t>(value.size()); + Encoding::Put8(zclString, length); + memcpy(&zclString[1], value.data(), value.size()); + return emberAfWriteAttribute(ConcreteAttributePath(endpoint, Clusters::MeterIdentification::Id, Id), + EmberAfWriteDataInput(zclString, ZCL_CHAR_STRING_ATTRIBUTE_TYPE).SetMarkDirty(markDirty)); +} + +Protocols::InteractionModel::Status Set(EndpointId endpoint, chip::CharSpan value) +{ + + static_assert(64 < NumericAttributeTraits<uint8_t>::kNullValue, "value.size() might be too big"); + VerifyOrReturnError(value.size() <= 64, Protocols::InteractionModel::Status::ConstraintError); + uint8_t zclString[64 + 1]; + auto length = static_cast<uint8_t>(value.size()); + Encoding::Put8(zclString, length); + memcpy(&zclString[1], value.data(), value.size()); + return emberAfWriteAttribute(endpoint, Clusters::MeterIdentification::Id, Id, zclString, ZCL_CHAR_STRING_ATTRIBUTE_TYPE); +} + +Protocols::InteractionModel::Status SetNull(EndpointId endpoint, MarkAttributeDirty markDirty) +{ + uint8_t zclString[1] = { 0xFF }; + return emberAfWriteAttribute(ConcreteAttributePath(endpoint, Clusters::MeterIdentification::Id, Id), + EmberAfWriteDataInput(zclString, ZCL_CHAR_STRING_ATTRIBUTE_TYPE).SetMarkDirty(markDirty)); +} + +Protocols::InteractionModel::Status SetNull(EndpointId endpoint) +{ + uint8_t zclString[1] = { 0xFF }; + return emberAfWriteAttribute(endpoint, Clusters::MeterIdentification::Id, Id, zclString, ZCL_CHAR_STRING_ATTRIBUTE_TYPE); +} + +Protocols::InteractionModel::Status Set(EndpointId endpoint, const chip::app::DataModel::Nullable<chip::CharSpan> & value, + MarkAttributeDirty markDirty) +{ + if (value.IsNull()) + { + return SetNull(endpoint, markDirty); + } + + return Set(endpoint, value.Value(), markDirty); +} + +Protocols::InteractionModel::Status Set(EndpointId endpoint, const chip::app::DataModel::Nullable<chip::CharSpan> & value) +{ + if (value.IsNull()) + { + return SetNull(endpoint); + } + + return Set(endpoint, value.Value()); +} + +} // namespace MeterSerialNumber + +namespace ProtocolVersion { + +Protocols::InteractionModel::Status Get(EndpointId endpoint, DataModel::Nullable<chip::MutableCharSpan> & value) +{ + if (value.IsNull()) + { + ChipLogError(Zcl, "Null Nullable<Span> passed to MeterIdentification::ProtocolVersion::Get"); + return Protocols::InteractionModel::Status::Failure; + } + + uint8_t zclString[64 + 1]; + Protocols::InteractionModel::Status status = + emberAfReadAttribute(endpoint, Clusters::MeterIdentification::Id, Id, zclString, sizeof(zclString)); + VerifyOrReturnError(Protocols::InteractionModel::Status::Success == status, status); + size_t length = emberAfStringLength(zclString); + if (length == NumericAttributeTraits<uint8_t>::kNullValue) + { + value.SetNull(); + return Protocols::InteractionModel::Status::Success; + } + auto & span = value.Value(); + + VerifyOrReturnError(span.size() == 64, Protocols::InteractionModel::Status::InvalidDataType); + memcpy(span.data(), &zclString[1], 64); + span.reduce_size(length); + return status; +} + +Protocols::InteractionModel::Status Set(EndpointId endpoint, chip::CharSpan value, MarkAttributeDirty markDirty) +{ + + static_assert(64 < NumericAttributeTraits<uint8_t>::kNullValue, "value.size() might be too big"); + VerifyOrReturnError(value.size() <= 64, Protocols::InteractionModel::Status::ConstraintError); + uint8_t zclString[64 + 1]; + auto length = static_cast<uint8_t>(value.size()); + Encoding::Put8(zclString, length); + memcpy(&zclString[1], value.data(), value.size()); + return emberAfWriteAttribute(ConcreteAttributePath(endpoint, Clusters::MeterIdentification::Id, Id), + EmberAfWriteDataInput(zclString, ZCL_CHAR_STRING_ATTRIBUTE_TYPE).SetMarkDirty(markDirty)); +} + +Protocols::InteractionModel::Status Set(EndpointId endpoint, chip::CharSpan value) +{ + + static_assert(64 < NumericAttributeTraits<uint8_t>::kNullValue, "value.size() might be too big"); + VerifyOrReturnError(value.size() <= 64, Protocols::InteractionModel::Status::ConstraintError); + uint8_t zclString[64 + 1]; + auto length = static_cast<uint8_t>(value.size()); + Encoding::Put8(zclString, length); + memcpy(&zclString[1], value.data(), value.size()); + return emberAfWriteAttribute(endpoint, Clusters::MeterIdentification::Id, Id, zclString, ZCL_CHAR_STRING_ATTRIBUTE_TYPE); +} + +Protocols::InteractionModel::Status SetNull(EndpointId endpoint, MarkAttributeDirty markDirty) +{ + uint8_t zclString[1] = { 0xFF }; + return emberAfWriteAttribute(ConcreteAttributePath(endpoint, Clusters::MeterIdentification::Id, Id), + EmberAfWriteDataInput(zclString, ZCL_CHAR_STRING_ATTRIBUTE_TYPE).SetMarkDirty(markDirty)); +} + +Protocols::InteractionModel::Status SetNull(EndpointId endpoint) +{ + uint8_t zclString[1] = { 0xFF }; + return emberAfWriteAttribute(endpoint, Clusters::MeterIdentification::Id, Id, zclString, ZCL_CHAR_STRING_ATTRIBUTE_TYPE); +} + +Protocols::InteractionModel::Status Set(EndpointId endpoint, const chip::app::DataModel::Nullable<chip::CharSpan> & value, + MarkAttributeDirty markDirty) +{ + if (value.IsNull()) + { + return SetNull(endpoint, markDirty); + } + + return Set(endpoint, value.Value(), markDirty); +} + +Protocols::InteractionModel::Status Set(EndpointId endpoint, const chip::app::DataModel::Nullable<chip::CharSpan> & value) +{ + if (value.IsNull()) + { + return SetNull(endpoint); + } + + return Set(endpoint, value.Value()); +} + +} // namespace ProtocolVersion + +namespace FeatureMap { + +Protocols::InteractionModel::Status Get(EndpointId endpoint, uint32_t * value) +{ + using Traits = NumericAttributeTraits<uint32_t>; + Traits::StorageType temp; + uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp); + Protocols::InteractionModel::Status status = + emberAfReadAttribute(endpoint, Clusters::MeterIdentification::Id, Id, readable, sizeof(temp)); + VerifyOrReturnError(Protocols::InteractionModel::Status::Success == status, status); + if (!Traits::CanRepresentValue(/* isNullable = */ false, temp)) + { + return Protocols::InteractionModel::Status::ConstraintError; + } + *value = Traits::StorageToWorking(temp); + return status; +} + +Protocols::InteractionModel::Status Set(EndpointId endpoint, uint32_t value, MarkAttributeDirty markDirty) +{ + using Traits = NumericAttributeTraits<uint32_t>; + if (!Traits::CanRepresentValue(/* isNullable = */ false, value)) + { + return Protocols::InteractionModel::Status::ConstraintError; + } + Traits::StorageType storageValue; + Traits::WorkingToStorage(value, storageValue); + uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue); + return emberAfWriteAttribute(ConcreteAttributePath(endpoint, Clusters::MeterIdentification::Id, Id), + EmberAfWriteDataInput(writable, ZCL_BITMAP32_ATTRIBUTE_TYPE).SetMarkDirty(markDirty)); +} + +Protocols::InteractionModel::Status Set(EndpointId endpoint, uint32_t value) +{ + using Traits = NumericAttributeTraits<uint32_t>; + if (!Traits::CanRepresentValue(/* isNullable = */ false, value)) + { + return Protocols::InteractionModel::Status::ConstraintError; + } + Traits::StorageType storageValue; + Traits::WorkingToStorage(value, storageValue); + uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue); + return emberAfWriteAttribute(endpoint, Clusters::MeterIdentification::Id, Id, writable, ZCL_BITMAP32_ATTRIBUTE_TYPE); +} + +} // namespace FeatureMap + +namespace ClusterRevision { + +Protocols::InteractionModel::Status Get(EndpointId endpoint, uint16_t * value) +{ + using Traits = NumericAttributeTraits<uint16_t>; + Traits::StorageType temp; + uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp); + Protocols::InteractionModel::Status status = + emberAfReadAttribute(endpoint, Clusters::MeterIdentification::Id, Id, readable, sizeof(temp)); + VerifyOrReturnError(Protocols::InteractionModel::Status::Success == status, status); + if (!Traits::CanRepresentValue(/* isNullable = */ false, temp)) + { + return Protocols::InteractionModel::Status::ConstraintError; + } + *value = Traits::StorageToWorking(temp); + return status; +} + +Protocols::InteractionModel::Status Set(EndpointId endpoint, uint16_t value, MarkAttributeDirty markDirty) +{ + using Traits = NumericAttributeTraits<uint16_t>; + if (!Traits::CanRepresentValue(/* isNullable = */ false, value)) + { + return Protocols::InteractionModel::Status::ConstraintError; + } + Traits::StorageType storageValue; + Traits::WorkingToStorage(value, storageValue); + uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue); + return emberAfWriteAttribute(ConcreteAttributePath(endpoint, Clusters::MeterIdentification::Id, Id), + EmberAfWriteDataInput(writable, ZCL_INT16U_ATTRIBUTE_TYPE).SetMarkDirty(markDirty)); +} + +Protocols::InteractionModel::Status Set(EndpointId endpoint, uint16_t value) +{ + using Traits = NumericAttributeTraits<uint16_t>; + if (!Traits::CanRepresentValue(/* isNullable = */ false, value)) + { + return Protocols::InteractionModel::Status::ConstraintError; + } + Traits::StorageType storageValue; + Traits::WorkingToStorage(value, storageValue); + uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue); + return emberAfWriteAttribute(endpoint, Clusters::MeterIdentification::Id, Id, writable, ZCL_INT16U_ATTRIBUTE_TYPE); +} + +} // namespace ClusterRevision + +} // namespace Attributes +} // namespace MeterIdentification + namespace UnitTesting { namespace Attributes { diff --git a/zzz_generated/app-common/app-common/zap-generated/attributes/Accessors.h b/zzz_generated/app-common/app-common/zap-generated/attributes/Accessors.h index 7f0a512f619aaf..f215c0785cd3af 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 @@ -6090,6 +6090,72 @@ Protocols::InteractionModel::Status Set(EndpointId endpoint, uint16_t value, Mar } // namespace Attributes } // namespace TlsClientManagement +namespace MeterIdentification { +namespace Attributes { + +namespace MeterType { +Protocols::InteractionModel::Status +Get(EndpointId endpoint, DataModel::Nullable<chip::app::Clusters::MeterIdentification::MeterTypeEnum> & value); // MeterTypeEnum +Protocols::InteractionModel::Status Set(EndpointId endpoint, chip::app::Clusters::MeterIdentification::MeterTypeEnum value); +Protocols::InteractionModel::Status Set(EndpointId endpoint, chip::app::Clusters::MeterIdentification::MeterTypeEnum value, + MarkAttributeDirty markDirty); +Protocols::InteractionModel::Status SetNull(EndpointId endpoint); +Protocols::InteractionModel::Status SetNull(EndpointId endpoint, MarkAttributeDirty markDirty); +Protocols::InteractionModel::Status +Set(EndpointId endpoint, const chip::app::DataModel::Nullable<chip::app::Clusters::MeterIdentification::MeterTypeEnum> & value); +Protocols::InteractionModel::Status +Set(EndpointId endpoint, const chip::app::DataModel::Nullable<chip::app::Clusters::MeterIdentification::MeterTypeEnum> & value, + MarkAttributeDirty markDirty); +} // namespace MeterType + +namespace PointOfDelivery { +Protocols::InteractionModel::Status Get(EndpointId endpoint, DataModel::Nullable<chip::MutableCharSpan> & value); // char_string +Protocols::InteractionModel::Status Set(EndpointId endpoint, chip::CharSpan value); +Protocols::InteractionModel::Status Set(EndpointId endpoint, chip::CharSpan value, MarkAttributeDirty markDirty); +Protocols::InteractionModel::Status SetNull(EndpointId endpoint); +Protocols::InteractionModel::Status SetNull(EndpointId endpoint, MarkAttributeDirty markDirty); +Protocols::InteractionModel::Status Set(EndpointId endpoint, const chip::app::DataModel::Nullable<chip::CharSpan> & value); +Protocols::InteractionModel::Status Set(EndpointId endpoint, const chip::app::DataModel::Nullable<chip::CharSpan> & value, + MarkAttributeDirty markDirty); +} // namespace PointOfDelivery + +namespace MeterSerialNumber { +Protocols::InteractionModel::Status Get(EndpointId endpoint, DataModel::Nullable<chip::MutableCharSpan> & value); // char_string +Protocols::InteractionModel::Status Set(EndpointId endpoint, chip::CharSpan value); +Protocols::InteractionModel::Status Set(EndpointId endpoint, chip::CharSpan value, MarkAttributeDirty markDirty); +Protocols::InteractionModel::Status SetNull(EndpointId endpoint); +Protocols::InteractionModel::Status SetNull(EndpointId endpoint, MarkAttributeDirty markDirty); +Protocols::InteractionModel::Status Set(EndpointId endpoint, const chip::app::DataModel::Nullable<chip::CharSpan> & value); +Protocols::InteractionModel::Status Set(EndpointId endpoint, const chip::app::DataModel::Nullable<chip::CharSpan> & value, + MarkAttributeDirty markDirty); +} // namespace MeterSerialNumber + +namespace ProtocolVersion { +Protocols::InteractionModel::Status Get(EndpointId endpoint, DataModel::Nullable<chip::MutableCharSpan> & value); // char_string +Protocols::InteractionModel::Status Set(EndpointId endpoint, chip::CharSpan value); +Protocols::InteractionModel::Status Set(EndpointId endpoint, chip::CharSpan value, MarkAttributeDirty markDirty); +Protocols::InteractionModel::Status SetNull(EndpointId endpoint); +Protocols::InteractionModel::Status SetNull(EndpointId endpoint, MarkAttributeDirty markDirty); +Protocols::InteractionModel::Status Set(EndpointId endpoint, const chip::app::DataModel::Nullable<chip::CharSpan> & value); +Protocols::InteractionModel::Status Set(EndpointId endpoint, const chip::app::DataModel::Nullable<chip::CharSpan> & value, + MarkAttributeDirty markDirty); +} // namespace ProtocolVersion + +namespace FeatureMap { +Protocols::InteractionModel::Status Get(EndpointId endpoint, uint32_t * value); // bitmap32 +Protocols::InteractionModel::Status Set(EndpointId endpoint, uint32_t value); +Protocols::InteractionModel::Status Set(EndpointId endpoint, uint32_t value, MarkAttributeDirty markDirty); +} // namespace FeatureMap + +namespace ClusterRevision { +Protocols::InteractionModel::Status Get(EndpointId endpoint, uint16_t * value); // int16u +Protocols::InteractionModel::Status Set(EndpointId endpoint, uint16_t value); +Protocols::InteractionModel::Status Set(EndpointId endpoint, uint16_t value, MarkAttributeDirty markDirty); +} // namespace ClusterRevision + +} // namespace Attributes +} // namespace MeterIdentification + namespace UnitTesting { namespace Attributes { diff --git a/zzz_generated/app-common/app-common/zap-generated/callback.h b/zzz_generated/app-common/app-common/zap-generated/callback.h index 6d21397d7e3a5d..6c8d22567ec71f 100644 --- a/zzz_generated/app-common/app-common/zap-generated/callback.h +++ b/zzz_generated/app-common/app-common/zap-generated/callback.h @@ -678,6 +678,11 @@ void emberAfTlsCertificateManagementClusterInitCallback(chip::EndpointId endpoin */ void emberAfTlsClientManagementClusterInitCallback(chip::EndpointId endpoint); +/** + * @param endpoint Endpoint that is being initialized + */ +void emberAfMeterIdentificationClusterInitCallback(chip::EndpointId endpoint); + /** * @param endpoint Endpoint that is being initialized */ @@ -5677,6 +5682,44 @@ chip::Protocols::InteractionModel::Status MatterTlsClientManagementClusterServer */ void emberAfTlsClientManagementClusterServerTickCallback(chip::EndpointId endpoint); +// +// Meter Identification Cluster +// + +/** + * @param endpoint Endpoint that is being initialized + */ +void emberAfMeterIdentificationClusterServerInitCallback(chip::EndpointId endpoint); + +/** + * @param endpoint Endpoint that is being shutdown + */ +void MatterMeterIdentificationClusterServerShutdownCallback(chip::EndpointId endpoint); + +/** + * @param endpoint Endpoint that is being initialized + */ +void emberAfMeterIdentificationClusterClientInitCallback(chip::EndpointId endpoint); + +/** + * @param attributePath Concrete attribute path that changed + */ +void MatterMeterIdentificationClusterServerAttributeChangedCallback(const chip::app::ConcreteAttributePath & attributePath); + +/** + * @param attributePath Concrete attribute path to be changed + * @param attributeType Attribute type + * @param size Attribute size + * @param value Attribute value + */ +chip::Protocols::InteractionModel::Status MatterMeterIdentificationClusterServerPreAttributeChangedCallback( + const chip::app::ConcreteAttributePath & attributePath, EmberAfAttributeType attributeType, uint16_t size, uint8_t * value); + +/** + * @param endpoint Endpoint that is being served + */ +void emberAfMeterIdentificationClusterServerTickCallback(chip::EndpointId endpoint); + // // Unit Testing Cluster // diff --git a/zzz_generated/app-common/app-common/zap-generated/cluster-enums-check.h b/zzz_generated/app-common/app-common/zap-generated/cluster-enums-check.h index d7dee64ce43025..709e9f0a02f937 100644 --- a/zzz_generated/app-common/app-common/zap-generated/cluster-enums-check.h +++ b/zzz_generated/app-common/app-common/zap-generated/cluster-enums-check.h @@ -3941,6 +3941,33 @@ static auto __attribute__((unused)) EnsureKnownEnumValue(TlsClientManagement::TL } } +static auto __attribute__((unused)) EnsureKnownEnumValue(MeterIdentification::MeterTypeEnum val) +{ + using EnumType = MeterIdentification::MeterTypeEnum; + switch (val) + { + case EnumType::kUtility: + case EnumType::kPrivate: + case EnumType::kGeneric: + return val; + default: + return EnumType::kUnknownEnumValue; + } +} +static auto __attribute__((unused)) EnsureKnownEnumValue(MeterIdentification::PowerThresholdSourceEnum val) +{ + using EnumType = MeterIdentification::PowerThresholdSourceEnum; + switch (val) + { + case EnumType::kContract: + case EnumType::kRegulator: + case EnumType::kEquipment: + return val; + default: + return EnumType::kUnknownEnumValue; + } +} + static auto __attribute__((unused)) EnsureKnownEnumValue(UnitTesting::SimpleEnum val) { using EnumType = UnitTesting::SimpleEnum; diff --git a/zzz_generated/app-common/app-common/zap-generated/cluster-enums.h b/zzz_generated/app-common/app-common/zap-generated/cluster-enums.h index d85756468ae614..0fb8ae8c1f8b00 100644 --- a/zzz_generated/app-common/app-common/zap-generated/cluster-enums.h +++ b/zzz_generated/app-common/app-common/zap-generated/cluster-enums.h @@ -5937,6 +5937,41 @@ enum class TLSEndpointStatusEnum : uint8_t }; } // namespace TlsClientManagement +namespace MeterIdentification { + +// Enum for MeterTypeEnum +enum class MeterTypeEnum : uint8_t +{ + kUtility = 0x00, + kPrivate = 0x01, + kGeneric = 0x02, + // All received enum values that are not listed above will be mapped + // to kUnknownEnumValue. This is a helper enum value that should only + // be used by code to process how it handles receiving and unknown + // enum value. This specific should never be transmitted. + kUnknownEnumValue = 3, +}; + +// Enum for PowerThresholdSourceEnum +enum class PowerThresholdSourceEnum : uint8_t +{ + kContract = 0x00, + kRegulator = 0x01, + kEquipment = 0x02, + // All received enum values that are not listed above will be mapped + // to kUnknownEnumValue. This is a helper enum value that should only + // be used by code to process how it handles receiving and unknown + // enum value. This specific should never be transmitted. + kUnknownEnumValue = 3, +}; + +// Bitmap for Feature +enum class Feature : uint32_t +{ + kPowerThreshold = 0x1, +}; +} // namespace MeterIdentification + namespace UnitTesting { // Enum for SimpleEnum 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 99fdb553b58858..7a0319a9752c3a 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 @@ -33901,6 +33901,92 @@ CHIP_ERROR TypeInfo::DecodableType::Decode(TLV::TLVReader & reader, const Concre namespace Events {} // namespace Events } // namespace TlsClientManagement +namespace MeterIdentification { +namespace Structs { + +namespace PowerThresholdStruct { +CHIP_ERROR Type::Encode(TLV::TLVWriter & aWriter, TLV::Tag aTag) const +{ + DataModel::WrappedStructEncoder encoder{ aWriter, aTag }; + encoder.Encode(to_underlying(Fields::kPowerThreshold), powerThreshold); + encoder.Encode(to_underlying(Fields::kApparentPowerThreshold), apparentPowerThreshold); + encoder.Encode(to_underlying(Fields::kPowerThresholdSource), powerThresholdSource); + return encoder.Finalize(); +} + +CHIP_ERROR DecodableType::Decode(TLV::TLVReader & reader) +{ + detail::StructDecodeIterator __iterator(reader); + while (true) + { + auto __element = __iterator.Next(); + if (std::holds_alternative<CHIP_ERROR>(__element)) + { + return std::get<CHIP_ERROR>(__element); + } + + CHIP_ERROR err = CHIP_NO_ERROR; + const uint8_t __context_tag = std::get<uint8_t>(__element); + + if (__context_tag == to_underlying(Fields::kPowerThreshold)) + { + err = DataModel::Decode(reader, powerThreshold); + } + else if (__context_tag == to_underlying(Fields::kApparentPowerThreshold)) + { + err = DataModel::Decode(reader, apparentPowerThreshold); + } + else if (__context_tag == to_underlying(Fields::kPowerThresholdSource)) + { + err = DataModel::Decode(reader, powerThresholdSource); + } + else + { + } + + ReturnErrorOnFailure(err); + } +} + +} // namespace PowerThresholdStruct +} // namespace Structs + +namespace Commands {} // namespace Commands + +namespace Attributes { +CHIP_ERROR TypeInfo::DecodableType::Decode(TLV::TLVReader & reader, const ConcreteAttributePath & path) +{ + switch (path.mAttributeId) + { + case Attributes::MeterType::TypeInfo::GetAttributeId(): + return DataModel::Decode(reader, meterType); + case Attributes::PointOfDelivery::TypeInfo::GetAttributeId(): + return DataModel::Decode(reader, pointOfDelivery); + case Attributes::MeterSerialNumber::TypeInfo::GetAttributeId(): + return DataModel::Decode(reader, meterSerialNumber); + case Attributes::ProtocolVersion::TypeInfo::GetAttributeId(): + return DataModel::Decode(reader, protocolVersion); + case Attributes::PowerThreshold::TypeInfo::GetAttributeId(): + return DataModel::Decode(reader, powerThreshold); + case Attributes::GeneratedCommandList::TypeInfo::GetAttributeId(): + return DataModel::Decode(reader, generatedCommandList); + case Attributes::AcceptedCommandList::TypeInfo::GetAttributeId(): + return DataModel::Decode(reader, acceptedCommandList); + case Attributes::AttributeList::TypeInfo::GetAttributeId(): + return DataModel::Decode(reader, attributeList); + case Attributes::FeatureMap::TypeInfo::GetAttributeId(): + return DataModel::Decode(reader, featureMap); + case Attributes::ClusterRevision::TypeInfo::GetAttributeId(): + return DataModel::Decode(reader, clusterRevision); + default: + return CHIP_NO_ERROR; + } +} +} // namespace Attributes + +namespace Events {} // namespace Events + +} // namespace MeterIdentification namespace UnitTesting { namespace Structs { 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 29ab08927ce611..2d213fcf4162b0 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 @@ -46545,6 +46545,155 @@ struct TypeInfo }; } // namespace Attributes } // namespace TlsClientManagement +namespace MeterIdentification { +namespace Structs { +namespace PowerThresholdStruct { +enum class Fields : uint8_t +{ + kPowerThreshold = 0, + kApparentPowerThreshold = 1, + kPowerThresholdSource = 2, +}; + +struct Type +{ +public: + Optional<int64_t> powerThreshold; + Optional<int64_t> apparentPowerThreshold; + DataModel::Nullable<PowerThresholdSourceEnum> powerThresholdSource; + + CHIP_ERROR Decode(TLV::TLVReader & reader); + + static constexpr bool kIsFabricScoped = false; + + CHIP_ERROR Encode(TLV::TLVWriter & aWriter, TLV::Tag aTag) const; +}; + +using DecodableType = Type; + +} // namespace PowerThresholdStruct +} // namespace Structs + +namespace Attributes { + +namespace MeterType { +struct TypeInfo +{ + using Type = chip::app::DataModel::Nullable<chip::app::Clusters::MeterIdentification::MeterTypeEnum>; + using DecodableType = chip::app::DataModel::Nullable<chip::app::Clusters::MeterIdentification::MeterTypeEnum>; + using DecodableArgType = const chip::app::DataModel::Nullable<chip::app::Clusters::MeterIdentification::MeterTypeEnum> &; + + static constexpr ClusterId GetClusterId() { return Clusters::MeterIdentification::Id; } + static constexpr AttributeId GetAttributeId() { return Attributes::MeterType::Id; } + static constexpr bool MustUseTimedWrite() { return false; } +}; +} // namespace MeterType +namespace PointOfDelivery { +struct TypeInfo +{ + using Type = chip::app::DataModel::Nullable<chip::CharSpan>; + using DecodableType = chip::app::DataModel::Nullable<chip::CharSpan>; + using DecodableArgType = const chip::app::DataModel::Nullable<chip::CharSpan> &; + + static constexpr ClusterId GetClusterId() { return Clusters::MeterIdentification::Id; } + static constexpr AttributeId GetAttributeId() { return Attributes::PointOfDelivery::Id; } + static constexpr bool MustUseTimedWrite() { return false; } + static constexpr size_t MaxLength() { return 64; } +}; +} // namespace PointOfDelivery +namespace MeterSerialNumber { +struct TypeInfo +{ + using Type = chip::app::DataModel::Nullable<chip::CharSpan>; + using DecodableType = chip::app::DataModel::Nullable<chip::CharSpan>; + using DecodableArgType = const chip::app::DataModel::Nullable<chip::CharSpan> &; + + static constexpr ClusterId GetClusterId() { return Clusters::MeterIdentification::Id; } + static constexpr AttributeId GetAttributeId() { return Attributes::MeterSerialNumber::Id; } + static constexpr bool MustUseTimedWrite() { return false; } + static constexpr size_t MaxLength() { return 64; } +}; +} // namespace MeterSerialNumber +namespace ProtocolVersion { +struct TypeInfo +{ + using Type = chip::app::DataModel::Nullable<chip::CharSpan>; + using DecodableType = chip::app::DataModel::Nullable<chip::CharSpan>; + using DecodableArgType = const chip::app::DataModel::Nullable<chip::CharSpan> &; + + static constexpr ClusterId GetClusterId() { return Clusters::MeterIdentification::Id; } + static constexpr AttributeId GetAttributeId() { return Attributes::ProtocolVersion::Id; } + static constexpr bool MustUseTimedWrite() { return false; } + static constexpr size_t MaxLength() { return 64; } +}; +} // namespace ProtocolVersion +namespace PowerThreshold { +struct TypeInfo +{ + using Type = chip::app::DataModel::Nullable<chip::app::Clusters::MeterIdentification::Structs::PowerThresholdStruct::Type>; + using DecodableType = + chip::app::DataModel::Nullable<chip::app::Clusters::MeterIdentification::Structs::PowerThresholdStruct::DecodableType>; + using DecodableArgType = const chip::app::DataModel::Nullable< + chip::app::Clusters::MeterIdentification::Structs::PowerThresholdStruct::DecodableType> &; + + static constexpr ClusterId GetClusterId() { return Clusters::MeterIdentification::Id; } + static constexpr AttributeId GetAttributeId() { return Attributes::PowerThreshold::Id; } + static constexpr bool MustUseTimedWrite() { return false; } +}; +} // namespace PowerThreshold +namespace GeneratedCommandList { +struct TypeInfo : public Clusters::Globals::Attributes::GeneratedCommandList::TypeInfo +{ + static constexpr ClusterId GetClusterId() { return Clusters::MeterIdentification::Id; } +}; +} // namespace GeneratedCommandList +namespace AcceptedCommandList { +struct TypeInfo : public Clusters::Globals::Attributes::AcceptedCommandList::TypeInfo +{ + static constexpr ClusterId GetClusterId() { return Clusters::MeterIdentification::Id; } +}; +} // namespace AcceptedCommandList +namespace AttributeList { +struct TypeInfo : public Clusters::Globals::Attributes::AttributeList::TypeInfo +{ + static constexpr ClusterId GetClusterId() { return Clusters::MeterIdentification::Id; } +}; +} // namespace AttributeList +namespace FeatureMap { +struct TypeInfo : public Clusters::Globals::Attributes::FeatureMap::TypeInfo +{ + static constexpr ClusterId GetClusterId() { return Clusters::MeterIdentification::Id; } +}; +} // namespace FeatureMap +namespace ClusterRevision { +struct TypeInfo : public Clusters::Globals::Attributes::ClusterRevision::TypeInfo +{ + static constexpr ClusterId GetClusterId() { return Clusters::MeterIdentification::Id; } +}; +} // namespace ClusterRevision + +struct TypeInfo +{ + struct DecodableType + { + static constexpr ClusterId GetClusterId() { return Clusters::MeterIdentification::Id; } + + CHIP_ERROR Decode(TLV::TLVReader & reader, const ConcreteAttributePath & path); + + Attributes::MeterType::TypeInfo::DecodableType meterType; + Attributes::PointOfDelivery::TypeInfo::DecodableType pointOfDelivery; + Attributes::MeterSerialNumber::TypeInfo::DecodableType meterSerialNumber; + Attributes::ProtocolVersion::TypeInfo::DecodableType protocolVersion; + Attributes::PowerThreshold::TypeInfo::DecodableType powerThreshold; + Attributes::GeneratedCommandList::TypeInfo::DecodableType generatedCommandList; + Attributes::AcceptedCommandList::TypeInfo::DecodableType acceptedCommandList; + Attributes::AttributeList::TypeInfo::DecodableType attributeList; + Attributes::FeatureMap::TypeInfo::DecodableType featureMap = static_cast<uint32_t>(0); + Attributes::ClusterRevision::TypeInfo::DecodableType clusterRevision = static_cast<uint16_t>(0); + }; +}; +} // namespace Attributes +} // namespace MeterIdentification namespace UnitTesting { namespace Structs { namespace SimpleStruct { diff --git a/zzz_generated/app-common/app-common/zap-generated/ids/Attributes.h b/zzz_generated/app-common/app-common/zap-generated/ids/Attributes.h index 0e82227dd2f57b..2c263f8257e15f 100644 --- a/zzz_generated/app-common/app-common/zap-generated/ids/Attributes.h +++ b/zzz_generated/app-common/app-common/zap-generated/ids/Attributes.h @@ -7457,6 +7457,52 @@ static constexpr AttributeId Id = Globals::Attributes::ClusterRevision::Id; } // namespace Attributes } // namespace TlsClientManagement +namespace MeterIdentification { +namespace Attributes { + +namespace MeterType { +static constexpr AttributeId Id = 0x00000000; +} // namespace MeterType + +namespace PointOfDelivery { +static constexpr AttributeId Id = 0x00000001; +} // namespace PointOfDelivery + +namespace MeterSerialNumber { +static constexpr AttributeId Id = 0x00000002; +} // namespace MeterSerialNumber + +namespace ProtocolVersion { +static constexpr AttributeId Id = 0x00000003; +} // namespace ProtocolVersion + +namespace PowerThreshold { +static constexpr AttributeId Id = 0x00000004; +} // namespace PowerThreshold + +namespace GeneratedCommandList { +static constexpr AttributeId Id = Globals::Attributes::GeneratedCommandList::Id; +} // namespace GeneratedCommandList + +namespace AcceptedCommandList { +static constexpr AttributeId Id = Globals::Attributes::AcceptedCommandList::Id; +} // namespace AcceptedCommandList + +namespace AttributeList { +static constexpr AttributeId Id = Globals::Attributes::AttributeList::Id; +} // namespace AttributeList + +namespace FeatureMap { +static constexpr AttributeId Id = Globals::Attributes::FeatureMap::Id; +} // namespace FeatureMap + +namespace ClusterRevision { +static constexpr AttributeId Id = Globals::Attributes::ClusterRevision::Id; +} // namespace ClusterRevision + +} // namespace Attributes +} // namespace MeterIdentification + namespace UnitTesting { namespace Attributes { diff --git a/zzz_generated/app-common/app-common/zap-generated/ids/Clusters.h b/zzz_generated/app-common/app-common/zap-generated/ids/Clusters.h index 601b25fb52246c..e50f0e894d5b07 100644 --- a/zzz_generated/app-common/app-common/zap-generated/ids/Clusters.h +++ b/zzz_generated/app-common/app-common/zap-generated/ids/Clusters.h @@ -412,6 +412,9 @@ static constexpr ClusterId Id = 0x00000801; namespace TlsClientManagement { static constexpr ClusterId Id = 0x00000802; } // namespace TlsClientManagement +namespace MeterIdentification { +static constexpr ClusterId Id = 0x00000B06; +} // namespace MeterIdentification namespace UnitTesting { static constexpr ClusterId Id = 0xFFF1FC05; } // namespace UnitTesting diff --git a/zzz_generated/chip-tool/zap-generated/cluster/Commands.h b/zzz_generated/chip-tool/zap-generated/cluster/Commands.h index a4e142fee41587..12b8c68c270fdb 100644 --- a/zzz_generated/chip-tool/zap-generated/cluster/Commands.h +++ b/zzz_generated/chip-tool/zap-generated/cluster/Commands.h @@ -164,6 +164,7 @@ | CommissionerControl | 0x0751 | | TlsCertificateManagement | 0x0801 | | TlsClientManagement | 0x0802 | +| MeterIdentification | 0x0B06 | | UnitTesting | 0xFFF1FC05| | FaultInjection | 0xFFF1FC06| | SampleMei | 0xFFF1FC20| @@ -16187,6 +16188,26 @@ class TlsClientManagementRemoveEndpoint : public ClusterCommand chip::app::Clusters::TlsClientManagement::Commands::RemoveEndpoint::Type mRequest; }; +/*----------------------------------------------------------------------------*\ +| Cluster MeterIdentification | 0x0B06 | +|------------------------------------------------------------------------------| +| Commands: | | +|------------------------------------------------------------------------------| +| Attributes: | | +| * MeterType | 0x0000 | +| * PointOfDelivery | 0x0001 | +| * MeterSerialNumber | 0x0002 | +| * ProtocolVersion | 0x0003 | +| * PowerThreshold | 0x0004 | +| * GeneratedCommandList | 0xFFF8 | +| * AcceptedCommandList | 0xFFF9 | +| * AttributeList | 0xFFFB | +| * FeatureMap | 0xFFFC | +| * ClusterRevision | 0xFFFD | +|------------------------------------------------------------------------------| +| Events: | | +\*----------------------------------------------------------------------------*/ + /*----------------------------------------------------------------------------*\ | Cluster UnitTesting | 0xFFF1FC05 | |------------------------------------------------------------------------------| @@ -29131,6 +29152,74 @@ void registerClusterTlsClientManagement(Commands & commands, CredentialIssuerCom commands.RegisterCluster(clusterName, clusterCommands); } +void registerClusterMeterIdentification(Commands & commands, CredentialIssuerCommands * credsIssuerConfig) +{ + using namespace chip::app::Clusters::MeterIdentification; + + const char * clusterName = "MeterIdentification"; + + commands_list clusterCommands = { + // + // Commands + // + make_unique<ClusterCommand>(Id, credsIssuerConfig), // + // + // Attributes + // + make_unique<ReadAttribute>(Id, credsIssuerConfig), // + make_unique<ReadAttribute>(Id, "meter-type", Attributes::MeterType::Id, credsIssuerConfig), // + make_unique<ReadAttribute>(Id, "point-of-delivery", Attributes::PointOfDelivery::Id, credsIssuerConfig), // + make_unique<ReadAttribute>(Id, "meter-serial-number", Attributes::MeterSerialNumber::Id, credsIssuerConfig), // + make_unique<ReadAttribute>(Id, "protocol-version", Attributes::ProtocolVersion::Id, credsIssuerConfig), // + make_unique<ReadAttribute>(Id, "power-threshold", Attributes::PowerThreshold::Id, credsIssuerConfig), // + make_unique<ReadAttribute>(Id, "generated-command-list", Attributes::GeneratedCommandList::Id, credsIssuerConfig), // + make_unique<ReadAttribute>(Id, "accepted-command-list", Attributes::AcceptedCommandList::Id, credsIssuerConfig), // + make_unique<ReadAttribute>(Id, "attribute-list", Attributes::AttributeList::Id, credsIssuerConfig), // + make_unique<ReadAttribute>(Id, "feature-map", Attributes::FeatureMap::Id, credsIssuerConfig), // + make_unique<ReadAttribute>(Id, "cluster-revision", Attributes::ClusterRevision::Id, credsIssuerConfig), // + make_unique<WriteAttribute<>>(Id, credsIssuerConfig), // + make_unique<WriteAttribute<chip::app::DataModel::Nullable<chip::app::Clusters::MeterIdentification::MeterTypeEnum>>>( + Id, "meter-type", 0, UINT8_MAX, Attributes::MeterType::Id, WriteCommandType::kForceWrite, credsIssuerConfig), // + make_unique<WriteAttribute<chip::app::DataModel::Nullable<chip::CharSpan>>>( + Id, "point-of-delivery", Attributes::PointOfDelivery::Id, WriteCommandType::kForceWrite, credsIssuerConfig), // + make_unique<WriteAttribute<chip::app::DataModel::Nullable<chip::CharSpan>>>( + Id, "meter-serial-number", Attributes::MeterSerialNumber::Id, WriteCommandType::kForceWrite, credsIssuerConfig), // + make_unique<WriteAttribute<chip::app::DataModel::Nullable<chip::CharSpan>>>( + Id, "protocol-version", Attributes::ProtocolVersion::Id, WriteCommandType::kForceWrite, credsIssuerConfig), // + make_unique<WriteAttributeAsComplex< + chip::app::DataModel::Nullable<chip::app::Clusters::MeterIdentification::Structs::PowerThresholdStruct::Type>>>( + Id, "power-threshold", Attributes::PowerThreshold::Id, WriteCommandType::kForceWrite, credsIssuerConfig), // + make_unique<WriteAttributeAsComplex<chip::app::DataModel::List<const chip::CommandId>>>( + Id, "generated-command-list", Attributes::GeneratedCommandList::Id, WriteCommandType::kForceWrite, + credsIssuerConfig), // + make_unique<WriteAttributeAsComplex<chip::app::DataModel::List<const chip::CommandId>>>( + Id, "accepted-command-list", Attributes::AcceptedCommandList::Id, WriteCommandType::kForceWrite, credsIssuerConfig), // + make_unique<WriteAttributeAsComplex<chip::app::DataModel::List<const chip::AttributeId>>>( + Id, "attribute-list", Attributes::AttributeList::Id, WriteCommandType::kForceWrite, credsIssuerConfig), // + make_unique<WriteAttribute<uint32_t>>(Id, "feature-map", 0, UINT32_MAX, Attributes::FeatureMap::Id, + WriteCommandType::kForceWrite, credsIssuerConfig), // + make_unique<WriteAttribute<uint16_t>>(Id, "cluster-revision", 0, UINT16_MAX, Attributes::ClusterRevision::Id, + WriteCommandType::kForceWrite, credsIssuerConfig), // + make_unique<SubscribeAttribute>(Id, credsIssuerConfig), // + make_unique<SubscribeAttribute>(Id, "meter-type", Attributes::MeterType::Id, credsIssuerConfig), // + make_unique<SubscribeAttribute>(Id, "point-of-delivery", Attributes::PointOfDelivery::Id, credsIssuerConfig), // + make_unique<SubscribeAttribute>(Id, "meter-serial-number", Attributes::MeterSerialNumber::Id, credsIssuerConfig), // + make_unique<SubscribeAttribute>(Id, "protocol-version", Attributes::ProtocolVersion::Id, credsIssuerConfig), // + make_unique<SubscribeAttribute>(Id, "power-threshold", Attributes::PowerThreshold::Id, credsIssuerConfig), // + make_unique<SubscribeAttribute>(Id, "generated-command-list", Attributes::GeneratedCommandList::Id, credsIssuerConfig), // + make_unique<SubscribeAttribute>(Id, "accepted-command-list", Attributes::AcceptedCommandList::Id, credsIssuerConfig), // + make_unique<SubscribeAttribute>(Id, "attribute-list", Attributes::AttributeList::Id, credsIssuerConfig), // + make_unique<SubscribeAttribute>(Id, "feature-map", Attributes::FeatureMap::Id, credsIssuerConfig), // + make_unique<SubscribeAttribute>(Id, "cluster-revision", Attributes::ClusterRevision::Id, credsIssuerConfig), // + // + // Events + // + make_unique<ReadEvent>(Id, credsIssuerConfig), // + make_unique<SubscribeEvent>(Id, credsIssuerConfig), // + }; + + commands.RegisterCluster(clusterName, clusterCommands); +} void registerClusterUnitTesting(Commands & commands, CredentialIssuerCommands * credsIssuerConfig) { using namespace chip::app::Clusters::UnitTesting; @@ -29869,6 +29958,7 @@ void registerClusters(Commands & commands, CredentialIssuerCommands * credsIssue registerClusterCommissionerControl(commands, credsIssuerConfig); registerClusterTlsCertificateManagement(commands, credsIssuerConfig); registerClusterTlsClientManagement(commands, credsIssuerConfig); + registerClusterMeterIdentification(commands, credsIssuerConfig); registerClusterUnitTesting(commands, credsIssuerConfig); registerClusterFaultInjection(commands, credsIssuerConfig); registerClusterSampleMei(commands, credsIssuerConfig); diff --git a/zzz_generated/chip-tool/zap-generated/cluster/ComplexArgumentParser.cpp b/zzz_generated/chip-tool/zap-generated/cluster/ComplexArgumentParser.cpp index de9b6c1110b158..16e02bf2c191c4 100644 --- a/zzz_generated/chip-tool/zap-generated/cluster/ComplexArgumentParser.cpp +++ b/zzz_generated/chip-tool/zap-generated/cluster/ComplexArgumentParser.cpp @@ -7343,6 +7343,49 @@ void ComplexArgumentParser::Finalize(chip::app::Clusters::TlsClientManagement::S ComplexArgumentParser::Finalize(request.status); } +CHIP_ERROR ComplexArgumentParser::Setup(const char * label, + chip::app::Clusters::MeterIdentification::Structs::PowerThresholdStruct::Type & request, + Json::Value & value) +{ + VerifyOrReturnError(value.isObject(), CHIP_ERROR_INVALID_ARGUMENT); + + // Copy to track which members we already processed. + Json::Value valueCopy(value); + + ReturnErrorOnFailure(ComplexArgumentParser::EnsureMemberExist("PowerThresholdStruct.powerThresholdSource", + "powerThresholdSource", value.isMember("powerThresholdSource"))); + + char labelWithMember[kMaxLabelLength]; + if (value.isMember("powerThreshold")) + { + snprintf(labelWithMember, sizeof(labelWithMember), "%s.%s", label, "powerThreshold"); + ReturnErrorOnFailure(ComplexArgumentParser::Setup(labelWithMember, request.powerThreshold, value["powerThreshold"])); + } + valueCopy.removeMember("powerThreshold"); + + if (value.isMember("apparentPowerThreshold")) + { + snprintf(labelWithMember, sizeof(labelWithMember), "%s.%s", label, "apparentPowerThreshold"); + ReturnErrorOnFailure( + ComplexArgumentParser::Setup(labelWithMember, request.apparentPowerThreshold, value["apparentPowerThreshold"])); + } + valueCopy.removeMember("apparentPowerThreshold"); + + snprintf(labelWithMember, sizeof(labelWithMember), "%s.%s", label, "powerThresholdSource"); + ReturnErrorOnFailure( + ComplexArgumentParser::Setup(labelWithMember, request.powerThresholdSource, value["powerThresholdSource"])); + valueCopy.removeMember("powerThresholdSource"); + + return ComplexArgumentParser::EnsureNoMembersRemaining(label, valueCopy); +} + +void ComplexArgumentParser::Finalize(chip::app::Clusters::MeterIdentification::Structs::PowerThresholdStruct::Type & request) +{ + ComplexArgumentParser::Finalize(request.powerThreshold); + ComplexArgumentParser::Finalize(request.apparentPowerThreshold); + ComplexArgumentParser::Finalize(request.powerThresholdSource); +} + CHIP_ERROR ComplexArgumentParser::Setup(const char * label, chip::app::Clusters::UnitTesting::Structs::SimpleStruct::Type & request, Json::Value & value) { diff --git a/zzz_generated/chip-tool/zap-generated/cluster/ComplexArgumentParser.h b/zzz_generated/chip-tool/zap-generated/cluster/ComplexArgumentParser.h index b9098cae1a9b7a..f84e2b61f653b5 100644 --- a/zzz_generated/chip-tool/zap-generated/cluster/ComplexArgumentParser.h +++ b/zzz_generated/chip-tool/zap-generated/cluster/ComplexArgumentParser.h @@ -845,6 +845,11 @@ static CHIP_ERROR Setup(const char * label, chip::app::Clusters::TlsClientManage static void Finalize(chip::app::Clusters::TlsClientManagement::Structs::TLSEndpointStruct::Type & request); +static CHIP_ERROR Setup(const char * label, chip::app::Clusters::MeterIdentification::Structs::PowerThresholdStruct::Type & request, + Json::Value & value); + +static void Finalize(chip::app::Clusters::MeterIdentification::Structs::PowerThresholdStruct::Type & request); + static CHIP_ERROR Setup(const char * label, chip::app::Clusters::UnitTesting::Structs::SimpleStruct::Type & request, Json::Value & value); diff --git a/zzz_generated/chip-tool/zap-generated/cluster/logging/DataModelLogger.cpp b/zzz_generated/chip-tool/zap-generated/cluster/logging/DataModelLogger.cpp index a8f9a53a2e2d1c..4ded16d2f4e07d 100644 --- a/zzz_generated/chip-tool/zap-generated/cluster/logging/DataModelLogger.cpp +++ b/zzz_generated/chip-tool/zap-generated/cluster/logging/DataModelLogger.cpp @@ -6497,6 +6497,40 @@ DataModelLogger::LogValue(const char * label, size_t indent, return CHIP_NO_ERROR; } +CHIP_ERROR +DataModelLogger::LogValue(const char * label, size_t indent, + const chip::app::Clusters::MeterIdentification::Structs::PowerThresholdStruct::DecodableType & value) +{ + DataModelLogger::LogString(label, indent, "{"); + { + CHIP_ERROR err = LogValue("PowerThreshold", indent + 1, value.powerThreshold); + if (err != CHIP_NO_ERROR) + { + DataModelLogger::LogString(indent + 1, "Struct truncated due to invalid value for 'PowerThreshold'"); + return err; + } + } + { + CHIP_ERROR err = LogValue("ApparentPowerThreshold", indent + 1, value.apparentPowerThreshold); + if (err != CHIP_NO_ERROR) + { + DataModelLogger::LogString(indent + 1, "Struct truncated due to invalid value for 'ApparentPowerThreshold'"); + return err; + } + } + { + CHIP_ERROR err = LogValue("PowerThresholdSource", indent + 1, value.powerThresholdSource); + if (err != CHIP_NO_ERROR) + { + DataModelLogger::LogString(indent + 1, "Struct truncated due to invalid value for 'PowerThresholdSource'"); + return err; + } + } + DataModelLogger::LogString(indent, "}"); + + return CHIP_NO_ERROR; +} + CHIP_ERROR DataModelLogger::LogValue(const char * label, size_t indent, const chip::app::Clusters::UnitTesting::Structs::SimpleStruct::DecodableType & value) { @@ -19778,6 +19812,63 @@ CHIP_ERROR DataModelLogger::LogAttribute(const chip::app::ConcreteDataAttributeP } break; } + case MeterIdentification::Id: { + switch (path.mAttributeId) + { + case MeterIdentification::Attributes::MeterType::Id: { + chip::app::DataModel::Nullable<chip::app::Clusters::MeterIdentification::MeterTypeEnum> value; + ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); + return DataModelLogger::LogValue("MeterType", 1, value); + } + case MeterIdentification::Attributes::PointOfDelivery::Id: { + chip::app::DataModel::Nullable<chip::CharSpan> value; + ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); + return DataModelLogger::LogValue("PointOfDelivery", 1, value); + } + case MeterIdentification::Attributes::MeterSerialNumber::Id: { + chip::app::DataModel::Nullable<chip::CharSpan> value; + ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); + return DataModelLogger::LogValue("MeterSerialNumber", 1, value); + } + case MeterIdentification::Attributes::ProtocolVersion::Id: { + chip::app::DataModel::Nullable<chip::CharSpan> value; + ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); + return DataModelLogger::LogValue("ProtocolVersion", 1, value); + } + case MeterIdentification::Attributes::PowerThreshold::Id: { + chip::app::DataModel::Nullable<chip::app::Clusters::MeterIdentification::Structs::PowerThresholdStruct::DecodableType> + value; + ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); + return DataModelLogger::LogValue("PowerThreshold", 1, value); + } + case MeterIdentification::Attributes::GeneratedCommandList::Id: { + chip::app::DataModel::DecodableList<chip::CommandId> value; + ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); + return DataModelLogger::LogGeneratedCommandId("GeneratedCommandList", 1, value, MeterIdentification::Id); + } + case MeterIdentification::Attributes::AcceptedCommandList::Id: { + chip::app::DataModel::DecodableList<chip::CommandId> value; + ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); + return DataModelLogger::LogAcceptedCommandId("AcceptedCommandList", 1, value, MeterIdentification::Id); + } + case MeterIdentification::Attributes::AttributeList::Id: { + chip::app::DataModel::DecodableList<chip::AttributeId> value; + ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); + return DataModelLogger::LogAttributeId("AttributeList", 1, value, MeterIdentification::Id); + } + case MeterIdentification::Attributes::FeatureMap::Id: { + uint32_t value; + ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); + return DataModelLogger::LogValue("FeatureMap", 1, value); + } + case MeterIdentification::Attributes::ClusterRevision::Id: { + uint16_t value; + ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); + return DataModelLogger::LogValue("ClusterRevision", 1, value); + } + } + break; + } case UnitTesting::Id: { switch (path.mAttributeId) { 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 dca4a0bbec80ba..68daafa4ad710f 100644 --- a/zzz_generated/chip-tool/zap-generated/cluster/logging/DataModelLogger.h +++ b/zzz_generated/chip-tool/zap-generated/cluster/logging/DataModelLogger.h @@ -520,6 +520,9 @@ LogValue(const char * label, size_t indent, static CHIP_ERROR LogValue(const char * label, size_t indent, const chip::app::Clusters::TlsClientManagement::Structs::TLSEndpointStruct::DecodableType & value); +static CHIP_ERROR LogValue(const char * label, size_t indent, + const chip::app::Clusters::MeterIdentification::Structs::PowerThresholdStruct::DecodableType & value); + static CHIP_ERROR LogValue(const char * label, size_t indent, const chip::app::Clusters::UnitTesting::Structs::SimpleStruct::DecodableType & value); diff --git a/zzz_generated/chip-tool/zap-generated/cluster/logging/EntryToText.cpp b/zzz_generated/chip-tool/zap-generated/cluster/logging/EntryToText.cpp index d7d97915eaef80..4fafbe4491cbb7 100644 --- a/zzz_generated/chip-tool/zap-generated/cluster/logging/EntryToText.cpp +++ b/zzz_generated/chip-tool/zap-generated/cluster/logging/EntryToText.cpp @@ -283,6 +283,8 @@ char const * ClusterIdToText(chip::ClusterId id) return "TlsCertificateManagement"; case chip::app::Clusters::TlsClientManagement::Id: return "TlsClientManagement"; + case chip::app::Clusters::MeterIdentification::Id: + return "MeterIdentification"; case chip::app::Clusters::UnitTesting::Id: return "UnitTesting"; case chip::app::Clusters::FaultInjection::Id: @@ -4517,6 +4519,33 @@ char const * AttributeIdToText(chip::ClusterId cluster, chip::AttributeId id) return "Unknown"; } } + case chip::app::Clusters::MeterIdentification::Id: { + switch (id) + { + case chip::app::Clusters::MeterIdentification::Attributes::MeterType::Id: + return "MeterType"; + case chip::app::Clusters::MeterIdentification::Attributes::PointOfDelivery::Id: + return "PointOfDelivery"; + case chip::app::Clusters::MeterIdentification::Attributes::MeterSerialNumber::Id: + return "MeterSerialNumber"; + case chip::app::Clusters::MeterIdentification::Attributes::ProtocolVersion::Id: + return "ProtocolVersion"; + case chip::app::Clusters::MeterIdentification::Attributes::PowerThreshold::Id: + return "PowerThreshold"; + case chip::app::Clusters::MeterIdentification::Attributes::GeneratedCommandList::Id: + return "GeneratedCommandList"; + case chip::app::Clusters::MeterIdentification::Attributes::AcceptedCommandList::Id: + return "AcceptedCommandList"; + case chip::app::Clusters::MeterIdentification::Attributes::AttributeList::Id: + return "AttributeList"; + case chip::app::Clusters::MeterIdentification::Attributes::FeatureMap::Id: + return "FeatureMap"; + case chip::app::Clusters::MeterIdentification::Attributes::ClusterRevision::Id: + return "ClusterRevision"; + default: + return "Unknown"; + } + } case chip::app::Clusters::UnitTesting::Id: { switch (id) { 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 c10f47653a2ffe..b5172ae189dc1a 100644 --- a/zzz_generated/darwin-framework-tool/zap-generated/cluster/Commands.h +++ b/zzz_generated/darwin-framework-tool/zap-generated/cluster/Commands.h @@ -166,6 +166,7 @@ | CommissionerControl | 0x0751 | | TlsCertificateManagement | 0x0801 | | TlsClientManagement | 0x0802 | +| MeterIdentification | 0x0B06 | | UnitTesting | 0xFFF1FC05| | FaultInjection | 0xFFF1FC06| | SampleMei | 0xFFF1FC20| @@ -164373,6 +164374,878 @@ class SubscribeAttributeTlsClientManagementClusterRevision : public SubscribeAtt } }; +#endif // MTR_ENABLE_PROVISIONAL +#endif // MTR_ENABLE_PROVISIONAL +#if MTR_ENABLE_PROVISIONAL +/*----------------------------------------------------------------------------*\ +| Cluster MeterIdentification | 0x0B06 | +|------------------------------------------------------------------------------| +| Commands: | | +|------------------------------------------------------------------------------| +| Attributes: | | +| * MeterType | 0x0000 | +| * PointOfDelivery | 0x0001 | +| * MeterSerialNumber | 0x0002 | +| * ProtocolVersion | 0x0003 | +| * PowerThreshold | 0x0004 | +| * GeneratedCommandList | 0xFFF8 | +| * AcceptedCommandList | 0xFFF9 | +| * AttributeList | 0xFFFB | +| * FeatureMap | 0xFFFC | +| * ClusterRevision | 0xFFFD | +|------------------------------------------------------------------------------| +| Events: | | +\*----------------------------------------------------------------------------*/ + +#if MTR_ENABLE_PROVISIONAL + +/* + * Attribute MeterType + */ +class ReadMeterIdentificationMeterType : public ReadAttribute { +public: + ReadMeterIdentificationMeterType() + : ReadAttribute("meter-type") + { + } + + ~ReadMeterIdentificationMeterType() + { + } + + CHIP_ERROR SendCommand(MTRBaseDevice * device, chip::EndpointId endpointId) override + { + constexpr chip::ClusterId clusterId = chip::app::Clusters::MeterIdentification::Id; + constexpr chip::AttributeId attributeId = chip::app::Clusters::MeterIdentification::Attributes::MeterType::Id; + + ChipLogProgress(chipTool, "Sending cluster (0x%08" PRIX32 ") ReadAttribute (0x%08" PRIX32 ") on endpoint %u", endpointId, clusterId, attributeId); + + dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL_WITH_AUTORELEASE_POOL); + __auto_type * cluster = [[MTRBaseClusterMeterIdentification alloc] initWithDevice:device endpointID:@(endpointId) queue:callbackQueue]; + [cluster readAttributeMeterTypeWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable error) { + NSLog(@"MeterIdentification.MeterType response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + LogNSError("MeterIdentification MeterType read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } + SetCommandExitStatus(error); + }]; + return CHIP_NO_ERROR; + } +}; + +class SubscribeAttributeMeterIdentificationMeterType : public SubscribeAttribute { +public: + SubscribeAttributeMeterIdentificationMeterType() + : SubscribeAttribute("meter-type") + { + } + + ~SubscribeAttributeMeterIdentificationMeterType() + { + } + + CHIP_ERROR SendCommand(MTRBaseDevice * device, chip::EndpointId endpointId) override + { + constexpr chip::ClusterId clusterId = chip::app::Clusters::MeterIdentification::Id; + constexpr chip::CommandId attributeId = chip::app::Clusters::MeterIdentification::Attributes::MeterType::Id; + + ChipLogProgress(chipTool, "Sending cluster (0x%08" PRIX32 ") ReportAttribute (0x%08" PRIX32 ") on endpoint %u", clusterId, attributeId, endpointId); + dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL_WITH_AUTORELEASE_POOL); + __auto_type * cluster = [[MTRBaseClusterMeterIdentification alloc] initWithDevice:device endpointID:@(endpointId) queue:callbackQueue]; + __auto_type * params = [[MTRSubscribeParams alloc] initWithMinInterval:@(mMinInterval) maxInterval:@(mMaxInterval)]; + if (mKeepSubscriptions.HasValue()) { + params.replaceExistingSubscriptions = !mKeepSubscriptions.Value(); + } + if (mFabricFiltered.HasValue()) { + params.filterByFabric = mFabricFiltered.Value(); + } + if (mAutoResubscribe.HasValue()) { + params.resubscribeAutomatically = mAutoResubscribe.Value(); + } + [cluster subscribeAttributeMeterTypeWithParams:params + subscriptionEstablished:^() { mSubscriptionEstablished = YES; } + reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { + NSLog(@"MeterIdentification.MeterType response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } + SetCommandExitStatus(error); + }]; + + return CHIP_NO_ERROR; + } +}; + +#endif // MTR_ENABLE_PROVISIONAL +#if MTR_ENABLE_PROVISIONAL + +/* + * Attribute PointOfDelivery + */ +class ReadMeterIdentificationPointOfDelivery : public ReadAttribute { +public: + ReadMeterIdentificationPointOfDelivery() + : ReadAttribute("point-of-delivery") + { + } + + ~ReadMeterIdentificationPointOfDelivery() + { + } + + CHIP_ERROR SendCommand(MTRBaseDevice * device, chip::EndpointId endpointId) override + { + constexpr chip::ClusterId clusterId = chip::app::Clusters::MeterIdentification::Id; + constexpr chip::AttributeId attributeId = chip::app::Clusters::MeterIdentification::Attributes::PointOfDelivery::Id; + + ChipLogProgress(chipTool, "Sending cluster (0x%08" PRIX32 ") ReadAttribute (0x%08" PRIX32 ") on endpoint %u", endpointId, clusterId, attributeId); + + dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL_WITH_AUTORELEASE_POOL); + __auto_type * cluster = [[MTRBaseClusterMeterIdentification alloc] initWithDevice:device endpointID:@(endpointId) queue:callbackQueue]; + [cluster readAttributePointOfDeliveryWithCompletion:^(NSString * _Nullable value, NSError * _Nullable error) { + NSLog(@"MeterIdentification.PointOfDelivery response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + LogNSError("MeterIdentification PointOfDelivery read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } + SetCommandExitStatus(error); + }]; + return CHIP_NO_ERROR; + } +}; + +class SubscribeAttributeMeterIdentificationPointOfDelivery : public SubscribeAttribute { +public: + SubscribeAttributeMeterIdentificationPointOfDelivery() + : SubscribeAttribute("point-of-delivery") + { + } + + ~SubscribeAttributeMeterIdentificationPointOfDelivery() + { + } + + CHIP_ERROR SendCommand(MTRBaseDevice * device, chip::EndpointId endpointId) override + { + constexpr chip::ClusterId clusterId = chip::app::Clusters::MeterIdentification::Id; + constexpr chip::CommandId attributeId = chip::app::Clusters::MeterIdentification::Attributes::PointOfDelivery::Id; + + ChipLogProgress(chipTool, "Sending cluster (0x%08" PRIX32 ") ReportAttribute (0x%08" PRIX32 ") on endpoint %u", clusterId, attributeId, endpointId); + dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL_WITH_AUTORELEASE_POOL); + __auto_type * cluster = [[MTRBaseClusterMeterIdentification alloc] initWithDevice:device endpointID:@(endpointId) queue:callbackQueue]; + __auto_type * params = [[MTRSubscribeParams alloc] initWithMinInterval:@(mMinInterval) maxInterval:@(mMaxInterval)]; + if (mKeepSubscriptions.HasValue()) { + params.replaceExistingSubscriptions = !mKeepSubscriptions.Value(); + } + if (mFabricFiltered.HasValue()) { + params.filterByFabric = mFabricFiltered.Value(); + } + if (mAutoResubscribe.HasValue()) { + params.resubscribeAutomatically = mAutoResubscribe.Value(); + } + [cluster subscribeAttributePointOfDeliveryWithParams:params + subscriptionEstablished:^() { mSubscriptionEstablished = YES; } + reportHandler:^(NSString * _Nullable value, NSError * _Nullable error) { + NSLog(@"MeterIdentification.PointOfDelivery response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } + SetCommandExitStatus(error); + }]; + + return CHIP_NO_ERROR; + } +}; + +#endif // MTR_ENABLE_PROVISIONAL +#if MTR_ENABLE_PROVISIONAL + +/* + * Attribute MeterSerialNumber + */ +class ReadMeterIdentificationMeterSerialNumber : public ReadAttribute { +public: + ReadMeterIdentificationMeterSerialNumber() + : ReadAttribute("meter-serial-number") + { + } + + ~ReadMeterIdentificationMeterSerialNumber() + { + } + + CHIP_ERROR SendCommand(MTRBaseDevice * device, chip::EndpointId endpointId) override + { + constexpr chip::ClusterId clusterId = chip::app::Clusters::MeterIdentification::Id; + constexpr chip::AttributeId attributeId = chip::app::Clusters::MeterIdentification::Attributes::MeterSerialNumber::Id; + + ChipLogProgress(chipTool, "Sending cluster (0x%08" PRIX32 ") ReadAttribute (0x%08" PRIX32 ") on endpoint %u", endpointId, clusterId, attributeId); + + dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL_WITH_AUTORELEASE_POOL); + __auto_type * cluster = [[MTRBaseClusterMeterIdentification alloc] initWithDevice:device endpointID:@(endpointId) queue:callbackQueue]; + [cluster readAttributeMeterSerialNumberWithCompletion:^(NSString * _Nullable value, NSError * _Nullable error) { + NSLog(@"MeterIdentification.MeterSerialNumber response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + LogNSError("MeterIdentification MeterSerialNumber read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } + SetCommandExitStatus(error); + }]; + return CHIP_NO_ERROR; + } +}; + +class SubscribeAttributeMeterIdentificationMeterSerialNumber : public SubscribeAttribute { +public: + SubscribeAttributeMeterIdentificationMeterSerialNumber() + : SubscribeAttribute("meter-serial-number") + { + } + + ~SubscribeAttributeMeterIdentificationMeterSerialNumber() + { + } + + CHIP_ERROR SendCommand(MTRBaseDevice * device, chip::EndpointId endpointId) override + { + constexpr chip::ClusterId clusterId = chip::app::Clusters::MeterIdentification::Id; + constexpr chip::CommandId attributeId = chip::app::Clusters::MeterIdentification::Attributes::MeterSerialNumber::Id; + + ChipLogProgress(chipTool, "Sending cluster (0x%08" PRIX32 ") ReportAttribute (0x%08" PRIX32 ") on endpoint %u", clusterId, attributeId, endpointId); + dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL_WITH_AUTORELEASE_POOL); + __auto_type * cluster = [[MTRBaseClusterMeterIdentification alloc] initWithDevice:device endpointID:@(endpointId) queue:callbackQueue]; + __auto_type * params = [[MTRSubscribeParams alloc] initWithMinInterval:@(mMinInterval) maxInterval:@(mMaxInterval)]; + if (mKeepSubscriptions.HasValue()) { + params.replaceExistingSubscriptions = !mKeepSubscriptions.Value(); + } + if (mFabricFiltered.HasValue()) { + params.filterByFabric = mFabricFiltered.Value(); + } + if (mAutoResubscribe.HasValue()) { + params.resubscribeAutomatically = mAutoResubscribe.Value(); + } + [cluster subscribeAttributeMeterSerialNumberWithParams:params + subscriptionEstablished:^() { mSubscriptionEstablished = YES; } + reportHandler:^(NSString * _Nullable value, NSError * _Nullable error) { + NSLog(@"MeterIdentification.MeterSerialNumber response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } + SetCommandExitStatus(error); + }]; + + return CHIP_NO_ERROR; + } +}; + +#endif // MTR_ENABLE_PROVISIONAL +#if MTR_ENABLE_PROVISIONAL + +/* + * Attribute ProtocolVersion + */ +class ReadMeterIdentificationProtocolVersion : public ReadAttribute { +public: + ReadMeterIdentificationProtocolVersion() + : ReadAttribute("protocol-version") + { + } + + ~ReadMeterIdentificationProtocolVersion() + { + } + + CHIP_ERROR SendCommand(MTRBaseDevice * device, chip::EndpointId endpointId) override + { + constexpr chip::ClusterId clusterId = chip::app::Clusters::MeterIdentification::Id; + constexpr chip::AttributeId attributeId = chip::app::Clusters::MeterIdentification::Attributes::ProtocolVersion::Id; + + ChipLogProgress(chipTool, "Sending cluster (0x%08" PRIX32 ") ReadAttribute (0x%08" PRIX32 ") on endpoint %u", endpointId, clusterId, attributeId); + + dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL_WITH_AUTORELEASE_POOL); + __auto_type * cluster = [[MTRBaseClusterMeterIdentification alloc] initWithDevice:device endpointID:@(endpointId) queue:callbackQueue]; + [cluster readAttributeProtocolVersionWithCompletion:^(NSString * _Nullable value, NSError * _Nullable error) { + NSLog(@"MeterIdentification.ProtocolVersion response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + LogNSError("MeterIdentification ProtocolVersion read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } + SetCommandExitStatus(error); + }]; + return CHIP_NO_ERROR; + } +}; + +class SubscribeAttributeMeterIdentificationProtocolVersion : public SubscribeAttribute { +public: + SubscribeAttributeMeterIdentificationProtocolVersion() + : SubscribeAttribute("protocol-version") + { + } + + ~SubscribeAttributeMeterIdentificationProtocolVersion() + { + } + + CHIP_ERROR SendCommand(MTRBaseDevice * device, chip::EndpointId endpointId) override + { + constexpr chip::ClusterId clusterId = chip::app::Clusters::MeterIdentification::Id; + constexpr chip::CommandId attributeId = chip::app::Clusters::MeterIdentification::Attributes::ProtocolVersion::Id; + + ChipLogProgress(chipTool, "Sending cluster (0x%08" PRIX32 ") ReportAttribute (0x%08" PRIX32 ") on endpoint %u", clusterId, attributeId, endpointId); + dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL_WITH_AUTORELEASE_POOL); + __auto_type * cluster = [[MTRBaseClusterMeterIdentification alloc] initWithDevice:device endpointID:@(endpointId) queue:callbackQueue]; + __auto_type * params = [[MTRSubscribeParams alloc] initWithMinInterval:@(mMinInterval) maxInterval:@(mMaxInterval)]; + if (mKeepSubscriptions.HasValue()) { + params.replaceExistingSubscriptions = !mKeepSubscriptions.Value(); + } + if (mFabricFiltered.HasValue()) { + params.filterByFabric = mFabricFiltered.Value(); + } + if (mAutoResubscribe.HasValue()) { + params.resubscribeAutomatically = mAutoResubscribe.Value(); + } + [cluster subscribeAttributeProtocolVersionWithParams:params + subscriptionEstablished:^() { mSubscriptionEstablished = YES; } + reportHandler:^(NSString * _Nullable value, NSError * _Nullable error) { + NSLog(@"MeterIdentification.ProtocolVersion response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } + SetCommandExitStatus(error); + }]; + + return CHIP_NO_ERROR; + } +}; + +#endif // MTR_ENABLE_PROVISIONAL +#if MTR_ENABLE_PROVISIONAL + +/* + * Attribute PowerThreshold + */ +class ReadMeterIdentificationPowerThreshold : public ReadAttribute { +public: + ReadMeterIdentificationPowerThreshold() + : ReadAttribute("power-threshold") + { + } + + ~ReadMeterIdentificationPowerThreshold() + { + } + + CHIP_ERROR SendCommand(MTRBaseDevice * device, chip::EndpointId endpointId) override + { + constexpr chip::ClusterId clusterId = chip::app::Clusters::MeterIdentification::Id; + constexpr chip::AttributeId attributeId = chip::app::Clusters::MeterIdentification::Attributes::PowerThreshold::Id; + + ChipLogProgress(chipTool, "Sending cluster (0x%08" PRIX32 ") ReadAttribute (0x%08" PRIX32 ") on endpoint %u", endpointId, clusterId, attributeId); + + dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL_WITH_AUTORELEASE_POOL); + __auto_type * cluster = [[MTRBaseClusterMeterIdentification alloc] initWithDevice:device endpointID:@(endpointId) queue:callbackQueue]; + [cluster readAttributePowerThresholdWithCompletion:^(MTRMeterIdentificationClusterPowerThresholdStruct * _Nullable value, NSError * _Nullable error) { + NSLog(@"MeterIdentification.PowerThreshold response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + LogNSError("MeterIdentification PowerThreshold read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } + SetCommandExitStatus(error); + }]; + return CHIP_NO_ERROR; + } +}; + +class SubscribeAttributeMeterIdentificationPowerThreshold : public SubscribeAttribute { +public: + SubscribeAttributeMeterIdentificationPowerThreshold() + : SubscribeAttribute("power-threshold") + { + } + + ~SubscribeAttributeMeterIdentificationPowerThreshold() + { + } + + CHIP_ERROR SendCommand(MTRBaseDevice * device, chip::EndpointId endpointId) override + { + constexpr chip::ClusterId clusterId = chip::app::Clusters::MeterIdentification::Id; + constexpr chip::CommandId attributeId = chip::app::Clusters::MeterIdentification::Attributes::PowerThreshold::Id; + + ChipLogProgress(chipTool, "Sending cluster (0x%08" PRIX32 ") ReportAttribute (0x%08" PRIX32 ") on endpoint %u", clusterId, attributeId, endpointId); + dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL_WITH_AUTORELEASE_POOL); + __auto_type * cluster = [[MTRBaseClusterMeterIdentification alloc] initWithDevice:device endpointID:@(endpointId) queue:callbackQueue]; + __auto_type * params = [[MTRSubscribeParams alloc] initWithMinInterval:@(mMinInterval) maxInterval:@(mMaxInterval)]; + if (mKeepSubscriptions.HasValue()) { + params.replaceExistingSubscriptions = !mKeepSubscriptions.Value(); + } + if (mFabricFiltered.HasValue()) { + params.filterByFabric = mFabricFiltered.Value(); + } + if (mAutoResubscribe.HasValue()) { + params.resubscribeAutomatically = mAutoResubscribe.Value(); + } + [cluster subscribeAttributePowerThresholdWithParams:params + subscriptionEstablished:^() { mSubscriptionEstablished = YES; } + reportHandler:^(MTRMeterIdentificationClusterPowerThresholdStruct * _Nullable value, NSError * _Nullable error) { + NSLog(@"MeterIdentification.PowerThreshold response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } + SetCommandExitStatus(error); + }]; + + return CHIP_NO_ERROR; + } +}; + +#endif // MTR_ENABLE_PROVISIONAL +#if MTR_ENABLE_PROVISIONAL + +/* + * Attribute GeneratedCommandList + */ +class ReadMeterIdentificationGeneratedCommandList : public ReadAttribute { +public: + ReadMeterIdentificationGeneratedCommandList() + : ReadAttribute("generated-command-list") + { + } + + ~ReadMeterIdentificationGeneratedCommandList() + { + } + + CHIP_ERROR SendCommand(MTRBaseDevice * device, chip::EndpointId endpointId) override + { + constexpr chip::ClusterId clusterId = chip::app::Clusters::MeterIdentification::Id; + constexpr chip::AttributeId attributeId = chip::app::Clusters::MeterIdentification::Attributes::GeneratedCommandList::Id; + + ChipLogProgress(chipTool, "Sending cluster (0x%08" PRIX32 ") ReadAttribute (0x%08" PRIX32 ") on endpoint %u", endpointId, clusterId, attributeId); + + dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL_WITH_AUTORELEASE_POOL); + __auto_type * cluster = [[MTRBaseClusterMeterIdentification alloc] initWithDevice:device endpointID:@(endpointId) queue:callbackQueue]; + [cluster readAttributeGeneratedCommandListWithCompletion:^(NSArray * _Nullable value, NSError * _Nullable error) { + NSLog(@"MeterIdentification.GeneratedCommandList response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + LogNSError("MeterIdentification GeneratedCommandList read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } + SetCommandExitStatus(error); + }]; + return CHIP_NO_ERROR; + } +}; + +class SubscribeAttributeMeterIdentificationGeneratedCommandList : public SubscribeAttribute { +public: + SubscribeAttributeMeterIdentificationGeneratedCommandList() + : SubscribeAttribute("generated-command-list") + { + } + + ~SubscribeAttributeMeterIdentificationGeneratedCommandList() + { + } + + CHIP_ERROR SendCommand(MTRBaseDevice * device, chip::EndpointId endpointId) override + { + constexpr chip::ClusterId clusterId = chip::app::Clusters::MeterIdentification::Id; + constexpr chip::CommandId attributeId = chip::app::Clusters::MeterIdentification::Attributes::GeneratedCommandList::Id; + + ChipLogProgress(chipTool, "Sending cluster (0x%08" PRIX32 ") ReportAttribute (0x%08" PRIX32 ") on endpoint %u", clusterId, attributeId, endpointId); + dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL_WITH_AUTORELEASE_POOL); + __auto_type * cluster = [[MTRBaseClusterMeterIdentification alloc] initWithDevice:device endpointID:@(endpointId) queue:callbackQueue]; + __auto_type * params = [[MTRSubscribeParams alloc] initWithMinInterval:@(mMinInterval) maxInterval:@(mMaxInterval)]; + if (mKeepSubscriptions.HasValue()) { + params.replaceExistingSubscriptions = !mKeepSubscriptions.Value(); + } + if (mFabricFiltered.HasValue()) { + params.filterByFabric = mFabricFiltered.Value(); + } + if (mAutoResubscribe.HasValue()) { + params.resubscribeAutomatically = mAutoResubscribe.Value(); + } + [cluster subscribeAttributeGeneratedCommandListWithParams:params + subscriptionEstablished:^() { mSubscriptionEstablished = YES; } + reportHandler:^(NSArray * _Nullable value, NSError * _Nullable error) { + NSLog(@"MeterIdentification.GeneratedCommandList response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } + SetCommandExitStatus(error); + }]; + + return CHIP_NO_ERROR; + } +}; + +#endif // MTR_ENABLE_PROVISIONAL +#if MTR_ENABLE_PROVISIONAL + +/* + * Attribute AcceptedCommandList + */ +class ReadMeterIdentificationAcceptedCommandList : public ReadAttribute { +public: + ReadMeterIdentificationAcceptedCommandList() + : ReadAttribute("accepted-command-list") + { + } + + ~ReadMeterIdentificationAcceptedCommandList() + { + } + + CHIP_ERROR SendCommand(MTRBaseDevice * device, chip::EndpointId endpointId) override + { + constexpr chip::ClusterId clusterId = chip::app::Clusters::MeterIdentification::Id; + constexpr chip::AttributeId attributeId = chip::app::Clusters::MeterIdentification::Attributes::AcceptedCommandList::Id; + + ChipLogProgress(chipTool, "Sending cluster (0x%08" PRIX32 ") ReadAttribute (0x%08" PRIX32 ") on endpoint %u", endpointId, clusterId, attributeId); + + dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL_WITH_AUTORELEASE_POOL); + __auto_type * cluster = [[MTRBaseClusterMeterIdentification alloc] initWithDevice:device endpointID:@(endpointId) queue:callbackQueue]; + [cluster readAttributeAcceptedCommandListWithCompletion:^(NSArray * _Nullable value, NSError * _Nullable error) { + NSLog(@"MeterIdentification.AcceptedCommandList response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + LogNSError("MeterIdentification AcceptedCommandList read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } + SetCommandExitStatus(error); + }]; + return CHIP_NO_ERROR; + } +}; + +class SubscribeAttributeMeterIdentificationAcceptedCommandList : public SubscribeAttribute { +public: + SubscribeAttributeMeterIdentificationAcceptedCommandList() + : SubscribeAttribute("accepted-command-list") + { + } + + ~SubscribeAttributeMeterIdentificationAcceptedCommandList() + { + } + + CHIP_ERROR SendCommand(MTRBaseDevice * device, chip::EndpointId endpointId) override + { + constexpr chip::ClusterId clusterId = chip::app::Clusters::MeterIdentification::Id; + constexpr chip::CommandId attributeId = chip::app::Clusters::MeterIdentification::Attributes::AcceptedCommandList::Id; + + ChipLogProgress(chipTool, "Sending cluster (0x%08" PRIX32 ") ReportAttribute (0x%08" PRIX32 ") on endpoint %u", clusterId, attributeId, endpointId); + dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL_WITH_AUTORELEASE_POOL); + __auto_type * cluster = [[MTRBaseClusterMeterIdentification alloc] initWithDevice:device endpointID:@(endpointId) queue:callbackQueue]; + __auto_type * params = [[MTRSubscribeParams alloc] initWithMinInterval:@(mMinInterval) maxInterval:@(mMaxInterval)]; + if (mKeepSubscriptions.HasValue()) { + params.replaceExistingSubscriptions = !mKeepSubscriptions.Value(); + } + if (mFabricFiltered.HasValue()) { + params.filterByFabric = mFabricFiltered.Value(); + } + if (mAutoResubscribe.HasValue()) { + params.resubscribeAutomatically = mAutoResubscribe.Value(); + } + [cluster subscribeAttributeAcceptedCommandListWithParams:params + subscriptionEstablished:^() { mSubscriptionEstablished = YES; } + reportHandler:^(NSArray * _Nullable value, NSError * _Nullable error) { + NSLog(@"MeterIdentification.AcceptedCommandList response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } + SetCommandExitStatus(error); + }]; + + return CHIP_NO_ERROR; + } +}; + +#endif // MTR_ENABLE_PROVISIONAL +#if MTR_ENABLE_PROVISIONAL + +/* + * Attribute AttributeList + */ +class ReadMeterIdentificationAttributeList : public ReadAttribute { +public: + ReadMeterIdentificationAttributeList() + : ReadAttribute("attribute-list") + { + } + + ~ReadMeterIdentificationAttributeList() + { + } + + CHIP_ERROR SendCommand(MTRBaseDevice * device, chip::EndpointId endpointId) override + { + constexpr chip::ClusterId clusterId = chip::app::Clusters::MeterIdentification::Id; + constexpr chip::AttributeId attributeId = chip::app::Clusters::MeterIdentification::Attributes::AttributeList::Id; + + ChipLogProgress(chipTool, "Sending cluster (0x%08" PRIX32 ") ReadAttribute (0x%08" PRIX32 ") on endpoint %u", endpointId, clusterId, attributeId); + + dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL_WITH_AUTORELEASE_POOL); + __auto_type * cluster = [[MTRBaseClusterMeterIdentification alloc] initWithDevice:device endpointID:@(endpointId) queue:callbackQueue]; + [cluster readAttributeAttributeListWithCompletion:^(NSArray * _Nullable value, NSError * _Nullable error) { + NSLog(@"MeterIdentification.AttributeList response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + LogNSError("MeterIdentification AttributeList read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } + SetCommandExitStatus(error); + }]; + return CHIP_NO_ERROR; + } +}; + +class SubscribeAttributeMeterIdentificationAttributeList : public SubscribeAttribute { +public: + SubscribeAttributeMeterIdentificationAttributeList() + : SubscribeAttribute("attribute-list") + { + } + + ~SubscribeAttributeMeterIdentificationAttributeList() + { + } + + CHIP_ERROR SendCommand(MTRBaseDevice * device, chip::EndpointId endpointId) override + { + constexpr chip::ClusterId clusterId = chip::app::Clusters::MeterIdentification::Id; + constexpr chip::CommandId attributeId = chip::app::Clusters::MeterIdentification::Attributes::AttributeList::Id; + + ChipLogProgress(chipTool, "Sending cluster (0x%08" PRIX32 ") ReportAttribute (0x%08" PRIX32 ") on endpoint %u", clusterId, attributeId, endpointId); + dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL_WITH_AUTORELEASE_POOL); + __auto_type * cluster = [[MTRBaseClusterMeterIdentification alloc] initWithDevice:device endpointID:@(endpointId) queue:callbackQueue]; + __auto_type * params = [[MTRSubscribeParams alloc] initWithMinInterval:@(mMinInterval) maxInterval:@(mMaxInterval)]; + if (mKeepSubscriptions.HasValue()) { + params.replaceExistingSubscriptions = !mKeepSubscriptions.Value(); + } + if (mFabricFiltered.HasValue()) { + params.filterByFabric = mFabricFiltered.Value(); + } + if (mAutoResubscribe.HasValue()) { + params.resubscribeAutomatically = mAutoResubscribe.Value(); + } + [cluster subscribeAttributeAttributeListWithParams:params + subscriptionEstablished:^() { mSubscriptionEstablished = YES; } + reportHandler:^(NSArray * _Nullable value, NSError * _Nullable error) { + NSLog(@"MeterIdentification.AttributeList response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } + SetCommandExitStatus(error); + }]; + + return CHIP_NO_ERROR; + } +}; + +#endif // MTR_ENABLE_PROVISIONAL +#if MTR_ENABLE_PROVISIONAL + +/* + * Attribute FeatureMap + */ +class ReadMeterIdentificationFeatureMap : public ReadAttribute { +public: + ReadMeterIdentificationFeatureMap() + : ReadAttribute("feature-map") + { + } + + ~ReadMeterIdentificationFeatureMap() + { + } + + CHIP_ERROR SendCommand(MTRBaseDevice * device, chip::EndpointId endpointId) override + { + constexpr chip::ClusterId clusterId = chip::app::Clusters::MeterIdentification::Id; + constexpr chip::AttributeId attributeId = chip::app::Clusters::MeterIdentification::Attributes::FeatureMap::Id; + + ChipLogProgress(chipTool, "Sending cluster (0x%08" PRIX32 ") ReadAttribute (0x%08" PRIX32 ") on endpoint %u", endpointId, clusterId, attributeId); + + dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL_WITH_AUTORELEASE_POOL); + __auto_type * cluster = [[MTRBaseClusterMeterIdentification alloc] initWithDevice:device endpointID:@(endpointId) queue:callbackQueue]; + [cluster readAttributeFeatureMapWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable error) { + NSLog(@"MeterIdentification.FeatureMap response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + LogNSError("MeterIdentification FeatureMap read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } + SetCommandExitStatus(error); + }]; + return CHIP_NO_ERROR; + } +}; + +class SubscribeAttributeMeterIdentificationFeatureMap : public SubscribeAttribute { +public: + SubscribeAttributeMeterIdentificationFeatureMap() + : SubscribeAttribute("feature-map") + { + } + + ~SubscribeAttributeMeterIdentificationFeatureMap() + { + } + + CHIP_ERROR SendCommand(MTRBaseDevice * device, chip::EndpointId endpointId) override + { + constexpr chip::ClusterId clusterId = chip::app::Clusters::MeterIdentification::Id; + constexpr chip::CommandId attributeId = chip::app::Clusters::MeterIdentification::Attributes::FeatureMap::Id; + + ChipLogProgress(chipTool, "Sending cluster (0x%08" PRIX32 ") ReportAttribute (0x%08" PRIX32 ") on endpoint %u", clusterId, attributeId, endpointId); + dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL_WITH_AUTORELEASE_POOL); + __auto_type * cluster = [[MTRBaseClusterMeterIdentification alloc] initWithDevice:device endpointID:@(endpointId) queue:callbackQueue]; + __auto_type * params = [[MTRSubscribeParams alloc] initWithMinInterval:@(mMinInterval) maxInterval:@(mMaxInterval)]; + if (mKeepSubscriptions.HasValue()) { + params.replaceExistingSubscriptions = !mKeepSubscriptions.Value(); + } + if (mFabricFiltered.HasValue()) { + params.filterByFabric = mFabricFiltered.Value(); + } + if (mAutoResubscribe.HasValue()) { + params.resubscribeAutomatically = mAutoResubscribe.Value(); + } + [cluster subscribeAttributeFeatureMapWithParams:params + subscriptionEstablished:^() { mSubscriptionEstablished = YES; } + reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { + NSLog(@"MeterIdentification.FeatureMap response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } + SetCommandExitStatus(error); + }]; + + return CHIP_NO_ERROR; + } +}; + +#endif // MTR_ENABLE_PROVISIONAL +#if MTR_ENABLE_PROVISIONAL + +/* + * Attribute ClusterRevision + */ +class ReadMeterIdentificationClusterRevision : public ReadAttribute { +public: + ReadMeterIdentificationClusterRevision() + : ReadAttribute("cluster-revision") + { + } + + ~ReadMeterIdentificationClusterRevision() + { + } + + CHIP_ERROR SendCommand(MTRBaseDevice * device, chip::EndpointId endpointId) override + { + constexpr chip::ClusterId clusterId = chip::app::Clusters::MeterIdentification::Id; + constexpr chip::AttributeId attributeId = chip::app::Clusters::MeterIdentification::Attributes::ClusterRevision::Id; + + ChipLogProgress(chipTool, "Sending cluster (0x%08" PRIX32 ") ReadAttribute (0x%08" PRIX32 ") on endpoint %u", endpointId, clusterId, attributeId); + + dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL_WITH_AUTORELEASE_POOL); + __auto_type * cluster = [[MTRBaseClusterMeterIdentification alloc] initWithDevice:device endpointID:@(endpointId) queue:callbackQueue]; + [cluster readAttributeClusterRevisionWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable error) { + NSLog(@"MeterIdentification.ClusterRevision response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + LogNSError("MeterIdentification ClusterRevision read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } + SetCommandExitStatus(error); + }]; + return CHIP_NO_ERROR; + } +}; + +class SubscribeAttributeMeterIdentificationClusterRevision : public SubscribeAttribute { +public: + SubscribeAttributeMeterIdentificationClusterRevision() + : SubscribeAttribute("cluster-revision") + { + } + + ~SubscribeAttributeMeterIdentificationClusterRevision() + { + } + + CHIP_ERROR SendCommand(MTRBaseDevice * device, chip::EndpointId endpointId) override + { + constexpr chip::ClusterId clusterId = chip::app::Clusters::MeterIdentification::Id; + constexpr chip::CommandId attributeId = chip::app::Clusters::MeterIdentification::Attributes::ClusterRevision::Id; + + ChipLogProgress(chipTool, "Sending cluster (0x%08" PRIX32 ") ReportAttribute (0x%08" PRIX32 ") on endpoint %u", clusterId, attributeId, endpointId); + dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL_WITH_AUTORELEASE_POOL); + __auto_type * cluster = [[MTRBaseClusterMeterIdentification alloc] initWithDevice:device endpointID:@(endpointId) queue:callbackQueue]; + __auto_type * params = [[MTRSubscribeParams alloc] initWithMinInterval:@(mMinInterval) maxInterval:@(mMaxInterval)]; + if (mKeepSubscriptions.HasValue()) { + params.replaceExistingSubscriptions = !mKeepSubscriptions.Value(); + } + if (mFabricFiltered.HasValue()) { + params.filterByFabric = mFabricFiltered.Value(); + } + if (mAutoResubscribe.HasValue()) { + params.resubscribeAutomatically = mAutoResubscribe.Value(); + } + [cluster subscribeAttributeClusterRevisionWithParams:params + subscriptionEstablished:^() { mSubscriptionEstablished = YES; } + reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { + NSLog(@"MeterIdentification.ClusterRevision response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } + SetCommandExitStatus(error); + }]; + + return CHIP_NO_ERROR; + } +}; + #endif // MTR_ENABLE_PROVISIONAL #endif // MTR_ENABLE_PROVISIONAL /*----------------------------------------------------------------------------*\ @@ -185380,6 +186253,63 @@ void registerClusterTlsClientManagement(Commands & commands) commands.RegisterCluster(clusterName, clusterCommands); #endif // MTR_ENABLE_PROVISIONAL } +void registerClusterMeterIdentification(Commands & commands) +{ +#if MTR_ENABLE_PROVISIONAL + using namespace chip::app::Clusters::MeterIdentification; + + const char * clusterName = "MeterIdentification"; + + commands_list clusterCommands = { + make_unique<ClusterCommand>(Id), // + make_unique<ReadAttribute>(Id), // + make_unique<WriteAttribute>(Id), // + make_unique<SubscribeAttribute>(Id), // +#if MTR_ENABLE_PROVISIONAL + make_unique<ReadMeterIdentificationMeterType>(), // + make_unique<SubscribeAttributeMeterIdentificationMeterType>(), // +#endif // MTR_ENABLE_PROVISIONAL +#if MTR_ENABLE_PROVISIONAL + make_unique<ReadMeterIdentificationPointOfDelivery>(), // + make_unique<SubscribeAttributeMeterIdentificationPointOfDelivery>(), // +#endif // MTR_ENABLE_PROVISIONAL +#if MTR_ENABLE_PROVISIONAL + make_unique<ReadMeterIdentificationMeterSerialNumber>(), // + make_unique<SubscribeAttributeMeterIdentificationMeterSerialNumber>(), // +#endif // MTR_ENABLE_PROVISIONAL +#if MTR_ENABLE_PROVISIONAL + make_unique<ReadMeterIdentificationProtocolVersion>(), // + make_unique<SubscribeAttributeMeterIdentificationProtocolVersion>(), // +#endif // MTR_ENABLE_PROVISIONAL +#if MTR_ENABLE_PROVISIONAL + make_unique<ReadMeterIdentificationPowerThreshold>(), // + make_unique<SubscribeAttributeMeterIdentificationPowerThreshold>(), // +#endif // MTR_ENABLE_PROVISIONAL +#if MTR_ENABLE_PROVISIONAL + make_unique<ReadMeterIdentificationGeneratedCommandList>(), // + make_unique<SubscribeAttributeMeterIdentificationGeneratedCommandList>(), // +#endif // MTR_ENABLE_PROVISIONAL +#if MTR_ENABLE_PROVISIONAL + make_unique<ReadMeterIdentificationAcceptedCommandList>(), // + make_unique<SubscribeAttributeMeterIdentificationAcceptedCommandList>(), // +#endif // MTR_ENABLE_PROVISIONAL +#if MTR_ENABLE_PROVISIONAL + make_unique<ReadMeterIdentificationAttributeList>(), // + make_unique<SubscribeAttributeMeterIdentificationAttributeList>(), // +#endif // MTR_ENABLE_PROVISIONAL +#if MTR_ENABLE_PROVISIONAL + make_unique<ReadMeterIdentificationFeatureMap>(), // + make_unique<SubscribeAttributeMeterIdentificationFeatureMap>(), // +#endif // MTR_ENABLE_PROVISIONAL +#if MTR_ENABLE_PROVISIONAL + make_unique<ReadMeterIdentificationClusterRevision>(), // + make_unique<SubscribeAttributeMeterIdentificationClusterRevision>(), // +#endif // MTR_ENABLE_PROVISIONAL + }; + + commands.RegisterCluster(clusterName, clusterCommands); +#endif // MTR_ENABLE_PROVISIONAL +} void registerClusterUnitTesting(Commands & commands) { using namespace chip::app::Clusters::UnitTesting; @@ -185922,6 +186852,7 @@ void registerClusters(Commands & commands) registerClusterCommissionerControl(commands); registerClusterTlsCertificateManagement(commands); registerClusterTlsClientManagement(commands); + registerClusterMeterIdentification(commands); registerClusterUnitTesting(commands); registerClusterSampleMei(commands); } From 4841257aa8ecbf3acfa0deee4388210fd3b93584 Mon Sep 17 00:00:00 2001 From: Dmitrii Popov <popovdg@gmail.com> Date: Sat, 15 Mar 2025 00:34:54 +0300 Subject: [PATCH 2/2] Code review fix. --- .../air-purifier-app.matter | 12 +++ .../air-quality-sensor-app.matter | 12 +++ .../all-clusters-app.matter | 12 +++ .../all-clusters-minimal-app.matter | 12 +++ .../bridge-common/bridge-app.matter | 12 +++ .../camera-common/camera-app.matter | 12 +++ ...p_rootnode_dimmablelight_bCwGYSDpoe.matter | 12 +++ .../rootnode_airpurifier_73a6fe2651.matter | 12 +++ ...umiditysensor_thermostat_56de3d5f45.matter | 12 +++ ...ootnode_airqualitysensor_e63187f6c9.matter | 12 +++ ...ootnode_basicvideoplayer_0ff86e943b.matter | 12 +++ ...de_colortemperaturelight_hbUnzYVeyn.matter | 12 +++ .../rootnode_contactsensor_27f76aeaf5.matter | 12 +++ .../rootnode_contactsensor_lFAGG1bfRO.matter | 12 +++ ...ualitysensor_powersource_367e7cea91.matter | 12 +++ .../rootnode_dimmablelight_bCwGYSDpoe.matter | 12 +++ ...tnode_dimmablepluginunit_f8a9a0b9d4.matter | 12 +++ .../rootnode_dishwasher_cc105034fe.matter | 12 +++ .../rootnode_doorlock_aNKYAreMXE.matter | 12 +++ ...tnode_extendedcolorlight_8lcaaYJVAa.matter | 12 +++ .../devices/rootnode_fan_7N2TobIlOX.matter | 12 +++ .../rootnode_flowsensor_1zVxHedlaV.matter | 12 +++ .../rootnode_genericswitch_2dfff6e516.matter | 12 +++ .../rootnode_genericswitch_9866e35d0b.matter | 12 +++ ...tnode_heatingcoolingunit_ncdGai1E5a.matter | 12 +++ .../rootnode_heatpump_87ivjRAECh.matter | 12 +++ .../rootnode_humiditysensor_Xyj4gda6Hb.matter | 12 +++ .../rootnode_laundrydryer_01796fe396.matter | 12 +++ .../rootnode_laundrywasher_fb10d238c8.matter | 12 +++ .../rootnode_lightsensor_lZQycTFcJK.matter | 12 +++ ...rootnode_occupancysensor_iHyVgifZuo.matter | 12 +++ .../rootnode_onofflight_bbs1b7IaOV.matter | 12 +++ .../rootnode_onofflight_samplemei.matter | 12 +++ ...ootnode_onofflightswitch_FsPlMr090Q.matter | 12 +++ ...rootnode_onoffpluginunit_Wtf8ss5EBY.matter | 12 +++ .../rootnode_pressuresensor_s0qC9wLH4k.matter | 12 +++ .../devices/rootnode_pump_5f904818cc.matter | 12 +++ .../devices/rootnode_pump_a811bb33a0.matter | 12 +++ .../rootnode_rainsensor_a7aa5d7738.matter | 12 +++ ...eraturecontrolledcabinet_ffdb696680.matter | 12 +++ ...ode_roboticvacuumcleaner_1807ff0c49.matter | 12 +++ ...tnode_roomairconditioner_9cf3607804.matter | 12 +++ .../rootnode_smokecoalarm_686fe0dcb8.matter | 12 +++ .../rootnode_speaker_RpzeXdimqA.matter | 12 +++ ...otnode_temperaturesensor_Qy1zkNW7c3.matter | 12 +++ .../rootnode_thermostat_bm3fb8dhYi.matter | 12 +++ ...node_waterfreezedetector_dd94a13a16.matter | 12 +++ ...otnode_waterleakdetector_0b067acfa3.matter | 12 +++ .../rootnode_watervalve_6bb39f1f67.matter | 12 +++ .../rootnode_windowcovering_RLCxaGi9Yx.matter | 12 +++ .../closure-common/closure-app.matter | 12 +++ .../data_model/contact-sensor-app.matter | 12 +++ .../contact-sensor-app.matter | 12 +++ .../nxp/zap-lit/contact-sensor-app.matter | 12 +++ .../nxp/zap-sit/contact-sensor-app.matter | 12 +++ .../dishwasher-common/dishwasher-app.matter | 12 +++ .../data_model/dishwasher-thread-app.matter | 12 +++ .../data_model/dishwasher-wifi-app.matter | 12 +++ .../energy-management-app.matter | 12 +++ .../fabric-bridge-app.matter | 12 +++ .../fabric-sync/bridge/fabric-bridge.matter | 12 +++ .../nxp/zap/laundry-washer-app.matter | 12 +++ .../icd-lit-light-switch-app.matter | 12 +++ .../light-switch-app.matter | 12 +++ .../light-switch-app/qpg/zap/switch.matter | 12 +++ .../lighting-common/lighting-app.matter | 12 +++ .../data_model/lighting-app-ethernet.matter | 12 +++ .../data_model/lighting-app-thread.matter | 12 +++ .../data_model/lighting-app-wifi.matter | 12 +++ .../lighting-common/lighting-app.matter | 12 +++ .../nxp/zap/lighting-on-off.matter | 12 +++ examples/lighting-app/qpg/zap/light.matter | 12 +++ .../data_model/lighting-thread-app.matter | 12 +++ .../data_model/lighting-wifi-app.matter | 12 +++ .../lit-icd-common/lit-icd-server-app.matter | 12 +++ examples/lock-app/lock-common/lock-app.matter | 12 +++ examples/lock-app/nxp/zap/lock-app.matter | 12 +++ examples/lock-app/qpg/zap/lock.matter | 12 +++ .../silabs/data_model/lock-app.matter | 12 +++ .../log-source-common/log-source-app.matter | 12 +++ .../microwave-oven-app.matter | 12 +++ .../network-manager-app.matter | 12 +++ .../ota-provider-app.matter | 12 +++ .../ota-requestor-app.matter | 12 +++ .../placeholder/linux/apps/app1/config.matter | 12 +++ .../placeholder/linux/apps/app2/config.matter | 12 +++ examples/pump-app/pump-common/pump-app.matter | 12 +++ .../silabs/data_model/pump-thread-app.matter | 12 +++ .../silabs/data_model/pump-wifi-app.matter | 12 +++ .../pump-controller-app.matter | 12 +++ .../refrigerator-app.matter | 12 +++ .../data_model/refrigerator-thread-app.matter | 12 +++ .../data_model/refrigerator-wifi-app.matter | 12 +++ examples/rvc-app/rvc-common/rvc-app.matter | 12 +++ .../smoke-co-alarm-app.matter | 12 +++ .../temperature-measurement.matter | 12 +++ .../terms-and-conditions-app.matter | 12 +++ .../nxp/zap/thermostat_matter_br.matter | 12 +++ .../nxp/zap/thermostat_matter_thread.matter | 12 +++ .../nxp/zap/thermostat_matter_wifi.matter | 12 +++ .../qpg/zap/thermostaticRadiatorValve.matter | 12 +++ .../thermostat-common/thermostat.matter | 12 +++ .../thread-br-common/thread-br-app.matter | 12 +++ examples/tv-app/tv-common/tv-app.matter | 12 +++ .../tv-casting-common/tv-casting-app.matter | 12 +++ .../virtual-device-app.matter | 12 +++ .../water-leak-detector-app.matter | 12 +++ examples/window-app/common/window-app.matter | 12 +++ .../chip/meter-identification-cluster.xml | 2 - .../data_model/controller-clusters.matter | 24 ++--- .../python/chip/clusters/Objects.py | 59 ++++++------ .../MTRAttributeTLVValueDecoder.mm | 4 +- .../CHIP/zap-generated/MTRBaseClusters.h | 18 ++-- .../CHIP/zap-generated/MTRBaseClusters.mm | 6 +- .../CHIP/zap-generated/MTRStructsObjc.h | 14 +-- .../CHIP/zap-generated/MTRStructsObjc.mm | 66 ++++++------- .../zap-generated/cluster-enums-check.h | 27 +++--- .../app-common/zap-generated/cluster-enums.h | 26 ++--- .../zap-generated/cluster-objects.cpp | 94 +++++++++---------- .../zap-generated/cluster-objects.h | 61 ++++++------ .../zap-generated/cluster/Commands.h | 2 +- .../cluster/ComplexArgumentParser.cpp | 86 ++++++++--------- .../cluster/ComplexArgumentParser.h | 10 +- .../cluster/logging/DataModelLogger.cpp | 70 +++++++------- .../cluster/logging/DataModelLogger.h | 6 +- .../zap-generated/cluster/Commands.h | 4 +- 126 files changed, 1582 insertions(+), 293 deletions(-) diff --git a/examples/air-purifier-app/air-purifier-common/air-purifier-app.matter b/examples/air-purifier-app/air-purifier-common/air-purifier-app.matter index f7960ccfe7fe20..239476f889d8b8 100644 --- a/examples/air-purifier-app/air-purifier-common/air-purifier-app.matter +++ b/examples/air-purifier-app/air-purifier-common/air-purifier-app.matter @@ -196,6 +196,12 @@ enum PositionTag : enum8 { kColumn = 6; } +enum PowerThresholdSourceEnum : enum8 { + kContract = 0; + kRegulator = 1; + kEquipment = 2; +} + enum RelativePositionTag : enum8 { kUnder = 0; kNextTo = 1; @@ -241,6 +247,12 @@ struct AtomicAttributeStatusStruct { status statusCode = 1; } +struct PowerThresholdStruct { + optional int64s powerThreshold = 0; + optional int64s apparentPowerThreshold = 1; + nullable PowerThresholdSourceEnum powerThresholdSource = 2; +} + /** Attributes and commands for putting a device into Identification mode (e.g. flashing a light). */ cluster Identify = 3 { revision 4; diff --git a/examples/air-quality-sensor-app/air-quality-sensor-common/air-quality-sensor-app.matter b/examples/air-quality-sensor-app/air-quality-sensor-common/air-quality-sensor-app.matter index bddd8222f8cf27..868f2485b6649e 100644 --- a/examples/air-quality-sensor-app/air-quality-sensor-common/air-quality-sensor-app.matter +++ b/examples/air-quality-sensor-app/air-quality-sensor-common/air-quality-sensor-app.matter @@ -196,6 +196,12 @@ enum PositionTag : enum8 { kColumn = 6; } +enum PowerThresholdSourceEnum : enum8 { + kContract = 0; + kRegulator = 1; + kEquipment = 2; +} + enum RelativePositionTag : enum8 { kUnder = 0; kNextTo = 1; @@ -241,6 +247,12 @@ struct AtomicAttributeStatusStruct { status statusCode = 1; } +struct PowerThresholdStruct { + optional int64s powerThreshold = 0; + optional int64s apparentPowerThreshold = 1; + nullable PowerThresholdSourceEnum powerThresholdSource = 2; +} + /** Attributes and commands for putting a device into Identification mode (e.g. flashing a light). */ cluster Identify = 3 { revision 4; 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 25926260acd84d..706040d6f1eb92 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 @@ -196,6 +196,12 @@ enum PositionTag : enum8 { kColumn = 6; } +enum PowerThresholdSourceEnum : enum8 { + kContract = 0; + kRegulator = 1; + kEquipment = 2; +} + enum RelativePositionTag : enum8 { kUnder = 0; kNextTo = 1; @@ -241,6 +247,12 @@ struct AtomicAttributeStatusStruct { status statusCode = 1; } +struct PowerThresholdStruct { + optional int64s powerThreshold = 0; + optional int64s apparentPowerThreshold = 1; + nullable PowerThresholdSourceEnum powerThresholdSource = 2; +} + /** Attributes and commands for putting a device into Identification mode (e.g. flashing a light). */ cluster Identify = 3 { revision 4; 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 55e5b3b0441bc6..de5614c72cdc0d 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 @@ -196,6 +196,12 @@ enum PositionTag : enum8 { kColumn = 6; } +enum PowerThresholdSourceEnum : enum8 { + kContract = 0; + kRegulator = 1; + kEquipment = 2; +} + enum RelativePositionTag : enum8 { kUnder = 0; kNextTo = 1; @@ -241,6 +247,12 @@ struct AtomicAttributeStatusStruct { status statusCode = 1; } +struct PowerThresholdStruct { + optional int64s powerThreshold = 0; + optional int64s apparentPowerThreshold = 1; + nullable PowerThresholdSourceEnum powerThresholdSource = 2; +} + /** Attributes and commands for putting a device into Identification mode (e.g. flashing a light). */ cluster Identify = 3 { revision 4; diff --git a/examples/bridge-app/bridge-common/bridge-app.matter b/examples/bridge-app/bridge-common/bridge-app.matter index da5e5107d94ab5..7845746f7337ca 100644 --- a/examples/bridge-app/bridge-common/bridge-app.matter +++ b/examples/bridge-app/bridge-common/bridge-app.matter @@ -196,6 +196,12 @@ enum PositionTag : enum8 { kColumn = 6; } +enum PowerThresholdSourceEnum : enum8 { + kContract = 0; + kRegulator = 1; + kEquipment = 2; +} + enum RelativePositionTag : enum8 { kUnder = 0; kNextTo = 1; @@ -241,6 +247,12 @@ struct AtomicAttributeStatusStruct { status statusCode = 1; } +struct PowerThresholdStruct { + optional int64s powerThreshold = 0; + optional int64s apparentPowerThreshold = 1; + nullable PowerThresholdSourceEnum powerThresholdSource = 2; +} + /** Attributes and commands for putting a device into Identification mode (e.g. flashing a light). */ cluster Identify = 3 { revision 4; diff --git a/examples/camera-app/camera-common/camera-app.matter b/examples/camera-app/camera-common/camera-app.matter index 9d44c5730189f2..2d4f1be1e73ff2 100644 --- a/examples/camera-app/camera-common/camera-app.matter +++ b/examples/camera-app/camera-common/camera-app.matter @@ -196,6 +196,12 @@ enum PositionTag : enum8 { kColumn = 6; } +enum PowerThresholdSourceEnum : enum8 { + kContract = 0; + kRegulator = 1; + kEquipment = 2; +} + enum RelativePositionTag : enum8 { kUnder = 0; kNextTo = 1; @@ -241,6 +247,12 @@ struct AtomicAttributeStatusStruct { status statusCode = 1; } +struct PowerThresholdStruct { + optional int64s powerThreshold = 0; + optional int64s apparentPowerThreshold = 1; + nullable PowerThresholdSourceEnum powerThresholdSource = 2; +} + /** Attributes and commands for putting a device into Identification mode (e.g. flashing a light). */ cluster Identify = 3 { revision 4; diff --git a/examples/chef/devices/noip_rootnode_dimmablelight_bCwGYSDpoe.matter b/examples/chef/devices/noip_rootnode_dimmablelight_bCwGYSDpoe.matter index 391c73a2c995e5..82595ee317fe80 100644 --- a/examples/chef/devices/noip_rootnode_dimmablelight_bCwGYSDpoe.matter +++ b/examples/chef/devices/noip_rootnode_dimmablelight_bCwGYSDpoe.matter @@ -196,6 +196,12 @@ enum PositionTag : enum8 { kColumn = 6; } +enum PowerThresholdSourceEnum : enum8 { + kContract = 0; + kRegulator = 1; + kEquipment = 2; +} + enum RelativePositionTag : enum8 { kUnder = 0; kNextTo = 1; @@ -241,6 +247,12 @@ struct AtomicAttributeStatusStruct { status statusCode = 1; } +struct PowerThresholdStruct { + optional int64s powerThreshold = 0; + optional int64s apparentPowerThreshold = 1; + nullable PowerThresholdSourceEnum powerThresholdSource = 2; +} + /** Attributes and commands for putting a device into Identification mode (e.g. flashing a light). */ cluster Identify = 3 { revision 4; diff --git a/examples/chef/devices/rootnode_airpurifier_73a6fe2651.matter b/examples/chef/devices/rootnode_airpurifier_73a6fe2651.matter index e2d379f86c0bb0..c6a371e5b4f5f3 100644 --- a/examples/chef/devices/rootnode_airpurifier_73a6fe2651.matter +++ b/examples/chef/devices/rootnode_airpurifier_73a6fe2651.matter @@ -196,6 +196,12 @@ enum PositionTag : enum8 { kColumn = 6; } +enum PowerThresholdSourceEnum : enum8 { + kContract = 0; + kRegulator = 1; + kEquipment = 2; +} + enum RelativePositionTag : enum8 { kUnder = 0; kNextTo = 1; @@ -241,6 +247,12 @@ struct AtomicAttributeStatusStruct { status statusCode = 1; } +struct PowerThresholdStruct { + optional int64s powerThreshold = 0; + optional int64s apparentPowerThreshold = 1; + nullable PowerThresholdSourceEnum powerThresholdSource = 2; +} + /** Attributes and commands for putting a device into Identification mode (e.g. flashing a light). */ cluster Identify = 3 { revision 4; diff --git a/examples/chef/devices/rootnode_airpurifier_airqualitysensor_temperaturesensor_humiditysensor_thermostat_56de3d5f45.matter b/examples/chef/devices/rootnode_airpurifier_airqualitysensor_temperaturesensor_humiditysensor_thermostat_56de3d5f45.matter index 7cb95430a5d9c9..42fc716e6d986f 100644 --- a/examples/chef/devices/rootnode_airpurifier_airqualitysensor_temperaturesensor_humiditysensor_thermostat_56de3d5f45.matter +++ b/examples/chef/devices/rootnode_airpurifier_airqualitysensor_temperaturesensor_humiditysensor_thermostat_56de3d5f45.matter @@ -196,6 +196,12 @@ enum PositionTag : enum8 { kColumn = 6; } +enum PowerThresholdSourceEnum : enum8 { + kContract = 0; + kRegulator = 1; + kEquipment = 2; +} + enum RelativePositionTag : enum8 { kUnder = 0; kNextTo = 1; @@ -241,6 +247,12 @@ struct AtomicAttributeStatusStruct { status statusCode = 1; } +struct PowerThresholdStruct { + optional int64s powerThreshold = 0; + optional int64s apparentPowerThreshold = 1; + nullable PowerThresholdSourceEnum powerThresholdSource = 2; +} + /** Attributes and commands for putting a device into Identification mode (e.g. flashing a light). */ cluster Identify = 3 { revision 4; diff --git a/examples/chef/devices/rootnode_airqualitysensor_e63187f6c9.matter b/examples/chef/devices/rootnode_airqualitysensor_e63187f6c9.matter index 1419631bc58969..2c44f406b28694 100644 --- a/examples/chef/devices/rootnode_airqualitysensor_e63187f6c9.matter +++ b/examples/chef/devices/rootnode_airqualitysensor_e63187f6c9.matter @@ -196,6 +196,12 @@ enum PositionTag : enum8 { kColumn = 6; } +enum PowerThresholdSourceEnum : enum8 { + kContract = 0; + kRegulator = 1; + kEquipment = 2; +} + enum RelativePositionTag : enum8 { kUnder = 0; kNextTo = 1; @@ -241,6 +247,12 @@ struct AtomicAttributeStatusStruct { status statusCode = 1; } +struct PowerThresholdStruct { + optional int64s powerThreshold = 0; + optional int64s apparentPowerThreshold = 1; + nullable PowerThresholdSourceEnum powerThresholdSource = 2; +} + /** Attributes and commands for putting a device into Identification mode (e.g. flashing a light). */ cluster Identify = 3 { revision 4; diff --git a/examples/chef/devices/rootnode_basicvideoplayer_0ff86e943b.matter b/examples/chef/devices/rootnode_basicvideoplayer_0ff86e943b.matter index a24ad5b84b9cae..b7407d90e977a6 100644 --- a/examples/chef/devices/rootnode_basicvideoplayer_0ff86e943b.matter +++ b/examples/chef/devices/rootnode_basicvideoplayer_0ff86e943b.matter @@ -196,6 +196,12 @@ enum PositionTag : enum8 { kColumn = 6; } +enum PowerThresholdSourceEnum : enum8 { + kContract = 0; + kRegulator = 1; + kEquipment = 2; +} + enum RelativePositionTag : enum8 { kUnder = 0; kNextTo = 1; @@ -241,6 +247,12 @@ struct AtomicAttributeStatusStruct { status statusCode = 1; } +struct PowerThresholdStruct { + optional int64s powerThreshold = 0; + optional int64s apparentPowerThreshold = 1; + nullable PowerThresholdSourceEnum powerThresholdSource = 2; +} + /** Attributes and commands for putting a device into Identification mode (e.g. flashing a light). */ cluster Identify = 3 { revision 4; diff --git a/examples/chef/devices/rootnode_colortemperaturelight_hbUnzYVeyn.matter b/examples/chef/devices/rootnode_colortemperaturelight_hbUnzYVeyn.matter index 4bb8b5d8e28832..0fed1d702e16af 100644 --- a/examples/chef/devices/rootnode_colortemperaturelight_hbUnzYVeyn.matter +++ b/examples/chef/devices/rootnode_colortemperaturelight_hbUnzYVeyn.matter @@ -196,6 +196,12 @@ enum PositionTag : enum8 { kColumn = 6; } +enum PowerThresholdSourceEnum : enum8 { + kContract = 0; + kRegulator = 1; + kEquipment = 2; +} + enum RelativePositionTag : enum8 { kUnder = 0; kNextTo = 1; @@ -241,6 +247,12 @@ struct AtomicAttributeStatusStruct { status statusCode = 1; } +struct PowerThresholdStruct { + optional int64s powerThreshold = 0; + optional int64s apparentPowerThreshold = 1; + nullable PowerThresholdSourceEnum powerThresholdSource = 2; +} + /** Attributes and commands for putting a device into Identification mode (e.g. flashing a light). */ cluster Identify = 3 { revision 4; diff --git a/examples/chef/devices/rootnode_contactsensor_27f76aeaf5.matter b/examples/chef/devices/rootnode_contactsensor_27f76aeaf5.matter index 284f75435366c3..676c5055ce6dda 100644 --- a/examples/chef/devices/rootnode_contactsensor_27f76aeaf5.matter +++ b/examples/chef/devices/rootnode_contactsensor_27f76aeaf5.matter @@ -196,6 +196,12 @@ enum PositionTag : enum8 { kColumn = 6; } +enum PowerThresholdSourceEnum : enum8 { + kContract = 0; + kRegulator = 1; + kEquipment = 2; +} + enum RelativePositionTag : enum8 { kUnder = 0; kNextTo = 1; @@ -241,6 +247,12 @@ struct AtomicAttributeStatusStruct { status statusCode = 1; } +struct PowerThresholdStruct { + optional int64s powerThreshold = 0; + optional int64s apparentPowerThreshold = 1; + nullable PowerThresholdSourceEnum powerThresholdSource = 2; +} + /** Attributes and commands for putting a device into Identification mode (e.g. flashing a light). */ cluster Identify = 3 { revision 4; diff --git a/examples/chef/devices/rootnode_contactsensor_lFAGG1bfRO.matter b/examples/chef/devices/rootnode_contactsensor_lFAGG1bfRO.matter index 66a3dd57e8c024..9ae75054543994 100644 --- a/examples/chef/devices/rootnode_contactsensor_lFAGG1bfRO.matter +++ b/examples/chef/devices/rootnode_contactsensor_lFAGG1bfRO.matter @@ -196,6 +196,12 @@ enum PositionTag : enum8 { kColumn = 6; } +enum PowerThresholdSourceEnum : enum8 { + kContract = 0; + kRegulator = 1; + kEquipment = 2; +} + enum RelativePositionTag : enum8 { kUnder = 0; kNextTo = 1; @@ -241,6 +247,12 @@ struct AtomicAttributeStatusStruct { status statusCode = 1; } +struct PowerThresholdStruct { + optional int64s powerThreshold = 0; + optional int64s apparentPowerThreshold = 1; + nullable PowerThresholdSourceEnum powerThresholdSource = 2; +} + /** Attributes and commands for putting a device into Identification mode (e.g. flashing a light). */ cluster Identify = 3 { revision 4; diff --git a/examples/chef/devices/rootnode_contactsensor_lightsensor_occupancysensor_temperaturesensor_pressuresensor_flowsensor_humiditysensor_airqualitysensor_powersource_367e7cea91.matter b/examples/chef/devices/rootnode_contactsensor_lightsensor_occupancysensor_temperaturesensor_pressuresensor_flowsensor_humiditysensor_airqualitysensor_powersource_367e7cea91.matter index e2efdc50628aac..ef1594ca4d2a79 100644 --- a/examples/chef/devices/rootnode_contactsensor_lightsensor_occupancysensor_temperaturesensor_pressuresensor_flowsensor_humiditysensor_airqualitysensor_powersource_367e7cea91.matter +++ b/examples/chef/devices/rootnode_contactsensor_lightsensor_occupancysensor_temperaturesensor_pressuresensor_flowsensor_humiditysensor_airqualitysensor_powersource_367e7cea91.matter @@ -196,6 +196,12 @@ enum PositionTag : enum8 { kColumn = 6; } +enum PowerThresholdSourceEnum : enum8 { + kContract = 0; + kRegulator = 1; + kEquipment = 2; +} + enum RelativePositionTag : enum8 { kUnder = 0; kNextTo = 1; @@ -241,6 +247,12 @@ struct AtomicAttributeStatusStruct { status statusCode = 1; } +struct PowerThresholdStruct { + optional int64s powerThreshold = 0; + optional int64s apparentPowerThreshold = 1; + nullable PowerThresholdSourceEnum powerThresholdSource = 2; +} + /** Attributes and commands for putting a device into Identification mode (e.g. flashing a light). */ cluster Identify = 3 { revision 4; diff --git a/examples/chef/devices/rootnode_dimmablelight_bCwGYSDpoe.matter b/examples/chef/devices/rootnode_dimmablelight_bCwGYSDpoe.matter index c4901e847b326a..26ffe55aa8d693 100644 --- a/examples/chef/devices/rootnode_dimmablelight_bCwGYSDpoe.matter +++ b/examples/chef/devices/rootnode_dimmablelight_bCwGYSDpoe.matter @@ -196,6 +196,12 @@ enum PositionTag : enum8 { kColumn = 6; } +enum PowerThresholdSourceEnum : enum8 { + kContract = 0; + kRegulator = 1; + kEquipment = 2; +} + enum RelativePositionTag : enum8 { kUnder = 0; kNextTo = 1; @@ -241,6 +247,12 @@ struct AtomicAttributeStatusStruct { status statusCode = 1; } +struct PowerThresholdStruct { + optional int64s powerThreshold = 0; + optional int64s apparentPowerThreshold = 1; + nullable PowerThresholdSourceEnum powerThresholdSource = 2; +} + /** Attributes and commands for putting a device into Identification mode (e.g. flashing a light). */ cluster Identify = 3 { revision 4; diff --git a/examples/chef/devices/rootnode_dimmablepluginunit_f8a9a0b9d4.matter b/examples/chef/devices/rootnode_dimmablepluginunit_f8a9a0b9d4.matter index 6395f513f93d44..6428b38baa7fdc 100644 --- a/examples/chef/devices/rootnode_dimmablepluginunit_f8a9a0b9d4.matter +++ b/examples/chef/devices/rootnode_dimmablepluginunit_f8a9a0b9d4.matter @@ -196,6 +196,12 @@ enum PositionTag : enum8 { kColumn = 6; } +enum PowerThresholdSourceEnum : enum8 { + kContract = 0; + kRegulator = 1; + kEquipment = 2; +} + enum RelativePositionTag : enum8 { kUnder = 0; kNextTo = 1; @@ -241,6 +247,12 @@ struct AtomicAttributeStatusStruct { status statusCode = 1; } +struct PowerThresholdStruct { + optional int64s powerThreshold = 0; + optional int64s apparentPowerThreshold = 1; + nullable PowerThresholdSourceEnum powerThresholdSource = 2; +} + /** Attributes and commands for putting a device into Identification mode (e.g. flashing a light). */ cluster Identify = 3 { revision 4; diff --git a/examples/chef/devices/rootnode_dishwasher_cc105034fe.matter b/examples/chef/devices/rootnode_dishwasher_cc105034fe.matter index aa95dae3186367..9beb2d34636a57 100644 --- a/examples/chef/devices/rootnode_dishwasher_cc105034fe.matter +++ b/examples/chef/devices/rootnode_dishwasher_cc105034fe.matter @@ -196,6 +196,12 @@ enum PositionTag : enum8 { kColumn = 6; } +enum PowerThresholdSourceEnum : enum8 { + kContract = 0; + kRegulator = 1; + kEquipment = 2; +} + enum RelativePositionTag : enum8 { kUnder = 0; kNextTo = 1; @@ -241,6 +247,12 @@ struct AtomicAttributeStatusStruct { status statusCode = 1; } +struct PowerThresholdStruct { + optional int64s powerThreshold = 0; + optional int64s apparentPowerThreshold = 1; + nullable PowerThresholdSourceEnum powerThresholdSource = 2; +} + /** Attributes and commands for putting a device into Identification mode (e.g. flashing a light). */ cluster Identify = 3 { revision 4; diff --git a/examples/chef/devices/rootnode_doorlock_aNKYAreMXE.matter b/examples/chef/devices/rootnode_doorlock_aNKYAreMXE.matter index 22d1f064688e9e..da3673ef878082 100644 --- a/examples/chef/devices/rootnode_doorlock_aNKYAreMXE.matter +++ b/examples/chef/devices/rootnode_doorlock_aNKYAreMXE.matter @@ -196,6 +196,12 @@ enum PositionTag : enum8 { kColumn = 6; } +enum PowerThresholdSourceEnum : enum8 { + kContract = 0; + kRegulator = 1; + kEquipment = 2; +} + enum RelativePositionTag : enum8 { kUnder = 0; kNextTo = 1; @@ -241,6 +247,12 @@ struct AtomicAttributeStatusStruct { status statusCode = 1; } +struct PowerThresholdStruct { + optional int64s powerThreshold = 0; + optional int64s apparentPowerThreshold = 1; + nullable PowerThresholdSourceEnum powerThresholdSource = 2; +} + /** Attributes and commands for putting a device into Identification mode (e.g. flashing a light). */ cluster Identify = 3 { revision 4; diff --git a/examples/chef/devices/rootnode_extendedcolorlight_8lcaaYJVAa.matter b/examples/chef/devices/rootnode_extendedcolorlight_8lcaaYJVAa.matter index 482715546279f9..bf9048e9ad739f 100644 --- a/examples/chef/devices/rootnode_extendedcolorlight_8lcaaYJVAa.matter +++ b/examples/chef/devices/rootnode_extendedcolorlight_8lcaaYJVAa.matter @@ -196,6 +196,12 @@ enum PositionTag : enum8 { kColumn = 6; } +enum PowerThresholdSourceEnum : enum8 { + kContract = 0; + kRegulator = 1; + kEquipment = 2; +} + enum RelativePositionTag : enum8 { kUnder = 0; kNextTo = 1; @@ -241,6 +247,12 @@ struct AtomicAttributeStatusStruct { status statusCode = 1; } +struct PowerThresholdStruct { + optional int64s powerThreshold = 0; + optional int64s apparentPowerThreshold = 1; + nullable PowerThresholdSourceEnum powerThresholdSource = 2; +} + /** Attributes and commands for putting a device into Identification mode (e.g. flashing a light). */ cluster Identify = 3 { revision 4; diff --git a/examples/chef/devices/rootnode_fan_7N2TobIlOX.matter b/examples/chef/devices/rootnode_fan_7N2TobIlOX.matter index a88c720c33275f..051943a676a07c 100644 --- a/examples/chef/devices/rootnode_fan_7N2TobIlOX.matter +++ b/examples/chef/devices/rootnode_fan_7N2TobIlOX.matter @@ -196,6 +196,12 @@ enum PositionTag : enum8 { kColumn = 6; } +enum PowerThresholdSourceEnum : enum8 { + kContract = 0; + kRegulator = 1; + kEquipment = 2; +} + enum RelativePositionTag : enum8 { kUnder = 0; kNextTo = 1; @@ -241,6 +247,12 @@ struct AtomicAttributeStatusStruct { status statusCode = 1; } +struct PowerThresholdStruct { + optional int64s powerThreshold = 0; + optional int64s apparentPowerThreshold = 1; + nullable PowerThresholdSourceEnum powerThresholdSource = 2; +} + /** Attributes and commands for putting a device into Identification mode (e.g. flashing a light). */ cluster Identify = 3 { revision 4; diff --git a/examples/chef/devices/rootnode_flowsensor_1zVxHedlaV.matter b/examples/chef/devices/rootnode_flowsensor_1zVxHedlaV.matter index f71eb3592481f2..2f623fee39dffa 100644 --- a/examples/chef/devices/rootnode_flowsensor_1zVxHedlaV.matter +++ b/examples/chef/devices/rootnode_flowsensor_1zVxHedlaV.matter @@ -196,6 +196,12 @@ enum PositionTag : enum8 { kColumn = 6; } +enum PowerThresholdSourceEnum : enum8 { + kContract = 0; + kRegulator = 1; + kEquipment = 2; +} + enum RelativePositionTag : enum8 { kUnder = 0; kNextTo = 1; @@ -241,6 +247,12 @@ struct AtomicAttributeStatusStruct { status statusCode = 1; } +struct PowerThresholdStruct { + optional int64s powerThreshold = 0; + optional int64s apparentPowerThreshold = 1; + nullable PowerThresholdSourceEnum powerThresholdSource = 2; +} + /** Attributes and commands for putting a device into Identification mode (e.g. flashing a light). */ cluster Identify = 3 { revision 4; diff --git a/examples/chef/devices/rootnode_genericswitch_2dfff6e516.matter b/examples/chef/devices/rootnode_genericswitch_2dfff6e516.matter index 23a0f88e79d85a..42063802fe67d9 100644 --- a/examples/chef/devices/rootnode_genericswitch_2dfff6e516.matter +++ b/examples/chef/devices/rootnode_genericswitch_2dfff6e516.matter @@ -196,6 +196,12 @@ enum PositionTag : enum8 { kColumn = 6; } +enum PowerThresholdSourceEnum : enum8 { + kContract = 0; + kRegulator = 1; + kEquipment = 2; +} + enum RelativePositionTag : enum8 { kUnder = 0; kNextTo = 1; @@ -241,6 +247,12 @@ struct AtomicAttributeStatusStruct { status statusCode = 1; } +struct PowerThresholdStruct { + optional int64s powerThreshold = 0; + optional int64s apparentPowerThreshold = 1; + nullable PowerThresholdSourceEnum powerThresholdSource = 2; +} + /** Attributes and commands for putting a device into Identification mode (e.g. flashing a light). */ cluster Identify = 3 { revision 4; diff --git a/examples/chef/devices/rootnode_genericswitch_9866e35d0b.matter b/examples/chef/devices/rootnode_genericswitch_9866e35d0b.matter index ab47b3925cc59a..9e31408b51c1aa 100644 --- a/examples/chef/devices/rootnode_genericswitch_9866e35d0b.matter +++ b/examples/chef/devices/rootnode_genericswitch_9866e35d0b.matter @@ -196,6 +196,12 @@ enum PositionTag : enum8 { kColumn = 6; } +enum PowerThresholdSourceEnum : enum8 { + kContract = 0; + kRegulator = 1; + kEquipment = 2; +} + enum RelativePositionTag : enum8 { kUnder = 0; kNextTo = 1; @@ -241,6 +247,12 @@ struct AtomicAttributeStatusStruct { status statusCode = 1; } +struct PowerThresholdStruct { + optional int64s powerThreshold = 0; + optional int64s apparentPowerThreshold = 1; + nullable PowerThresholdSourceEnum powerThresholdSource = 2; +} + /** Attributes and commands for putting a device into Identification mode (e.g. flashing a light). */ cluster Identify = 3 { revision 4; diff --git a/examples/chef/devices/rootnode_heatingcoolingunit_ncdGai1E5a.matter b/examples/chef/devices/rootnode_heatingcoolingunit_ncdGai1E5a.matter index 0cb9128f26971d..b62dc5b36fe188 100644 --- a/examples/chef/devices/rootnode_heatingcoolingunit_ncdGai1E5a.matter +++ b/examples/chef/devices/rootnode_heatingcoolingunit_ncdGai1E5a.matter @@ -196,6 +196,12 @@ enum PositionTag : enum8 { kColumn = 6; } +enum PowerThresholdSourceEnum : enum8 { + kContract = 0; + kRegulator = 1; + kEquipment = 2; +} + enum RelativePositionTag : enum8 { kUnder = 0; kNextTo = 1; @@ -241,6 +247,12 @@ struct AtomicAttributeStatusStruct { status statusCode = 1; } +struct PowerThresholdStruct { + optional int64s powerThreshold = 0; + optional int64s apparentPowerThreshold = 1; + nullable PowerThresholdSourceEnum powerThresholdSource = 2; +} + /** Attributes and commands for putting a device into Identification mode (e.g. flashing a light). */ cluster Identify = 3 { revision 4; diff --git a/examples/chef/devices/rootnode_heatpump_87ivjRAECh.matter b/examples/chef/devices/rootnode_heatpump_87ivjRAECh.matter index 3ece660adfca3e..bf8b69a90b942d 100644 --- a/examples/chef/devices/rootnode_heatpump_87ivjRAECh.matter +++ b/examples/chef/devices/rootnode_heatpump_87ivjRAECh.matter @@ -196,6 +196,12 @@ enum PositionTag : enum8 { kColumn = 6; } +enum PowerThresholdSourceEnum : enum8 { + kContract = 0; + kRegulator = 1; + kEquipment = 2; +} + enum RelativePositionTag : enum8 { kUnder = 0; kNextTo = 1; @@ -241,6 +247,12 @@ struct AtomicAttributeStatusStruct { status statusCode = 1; } +struct PowerThresholdStruct { + optional int64s powerThreshold = 0; + optional int64s apparentPowerThreshold = 1; + nullable PowerThresholdSourceEnum powerThresholdSource = 2; +} + /** Attributes and commands for putting a device into Identification mode (e.g. flashing a light). */ cluster Identify = 3 { revision 4; diff --git a/examples/chef/devices/rootnode_humiditysensor_Xyj4gda6Hb.matter b/examples/chef/devices/rootnode_humiditysensor_Xyj4gda6Hb.matter index f689613e7db0e0..7beb3621f84af2 100644 --- a/examples/chef/devices/rootnode_humiditysensor_Xyj4gda6Hb.matter +++ b/examples/chef/devices/rootnode_humiditysensor_Xyj4gda6Hb.matter @@ -196,6 +196,12 @@ enum PositionTag : enum8 { kColumn = 6; } +enum PowerThresholdSourceEnum : enum8 { + kContract = 0; + kRegulator = 1; + kEquipment = 2; +} + enum RelativePositionTag : enum8 { kUnder = 0; kNextTo = 1; @@ -241,6 +247,12 @@ struct AtomicAttributeStatusStruct { status statusCode = 1; } +struct PowerThresholdStruct { + optional int64s powerThreshold = 0; + optional int64s apparentPowerThreshold = 1; + nullable PowerThresholdSourceEnum powerThresholdSource = 2; +} + /** Attributes and commands for putting a device into Identification mode (e.g. flashing a light). */ cluster Identify = 3 { revision 4; diff --git a/examples/chef/devices/rootnode_laundrydryer_01796fe396.matter b/examples/chef/devices/rootnode_laundrydryer_01796fe396.matter index 10d19da2a772e1..54c85b751eaf3a 100644 --- a/examples/chef/devices/rootnode_laundrydryer_01796fe396.matter +++ b/examples/chef/devices/rootnode_laundrydryer_01796fe396.matter @@ -196,6 +196,12 @@ enum PositionTag : enum8 { kColumn = 6; } +enum PowerThresholdSourceEnum : enum8 { + kContract = 0; + kRegulator = 1; + kEquipment = 2; +} + enum RelativePositionTag : enum8 { kUnder = 0; kNextTo = 1; @@ -241,6 +247,12 @@ struct AtomicAttributeStatusStruct { status statusCode = 1; } +struct PowerThresholdStruct { + optional int64s powerThreshold = 0; + optional int64s apparentPowerThreshold = 1; + nullable PowerThresholdSourceEnum powerThresholdSource = 2; +} + /** Attributes and commands for putting a device into Identification mode (e.g. flashing a light). */ cluster Identify = 3 { revision 4; diff --git a/examples/chef/devices/rootnode_laundrywasher_fb10d238c8.matter b/examples/chef/devices/rootnode_laundrywasher_fb10d238c8.matter index 10af26d38c8276..329afbea5c82b0 100644 --- a/examples/chef/devices/rootnode_laundrywasher_fb10d238c8.matter +++ b/examples/chef/devices/rootnode_laundrywasher_fb10d238c8.matter @@ -196,6 +196,12 @@ enum PositionTag : enum8 { kColumn = 6; } +enum PowerThresholdSourceEnum : enum8 { + kContract = 0; + kRegulator = 1; + kEquipment = 2; +} + enum RelativePositionTag : enum8 { kUnder = 0; kNextTo = 1; @@ -241,6 +247,12 @@ struct AtomicAttributeStatusStruct { status statusCode = 1; } +struct PowerThresholdStruct { + optional int64s powerThreshold = 0; + optional int64s apparentPowerThreshold = 1; + nullable PowerThresholdSourceEnum powerThresholdSource = 2; +} + /** Attributes and commands for switching devices between 'On' and 'Off' states. */ cluster OnOff = 6 { revision 6; diff --git a/examples/chef/devices/rootnode_lightsensor_lZQycTFcJK.matter b/examples/chef/devices/rootnode_lightsensor_lZQycTFcJK.matter index cf7fa80e572b6f..8c2319ea40fdf0 100644 --- a/examples/chef/devices/rootnode_lightsensor_lZQycTFcJK.matter +++ b/examples/chef/devices/rootnode_lightsensor_lZQycTFcJK.matter @@ -196,6 +196,12 @@ enum PositionTag : enum8 { kColumn = 6; } +enum PowerThresholdSourceEnum : enum8 { + kContract = 0; + kRegulator = 1; + kEquipment = 2; +} + enum RelativePositionTag : enum8 { kUnder = 0; kNextTo = 1; @@ -241,6 +247,12 @@ struct AtomicAttributeStatusStruct { status statusCode = 1; } +struct PowerThresholdStruct { + optional int64s powerThreshold = 0; + optional int64s apparentPowerThreshold = 1; + nullable PowerThresholdSourceEnum powerThresholdSource = 2; +} + /** Attributes and commands for putting a device into Identification mode (e.g. flashing a light). */ cluster Identify = 3 { revision 4; diff --git a/examples/chef/devices/rootnode_occupancysensor_iHyVgifZuo.matter b/examples/chef/devices/rootnode_occupancysensor_iHyVgifZuo.matter index 9e48af26b42dfb..2983b22a47f743 100644 --- a/examples/chef/devices/rootnode_occupancysensor_iHyVgifZuo.matter +++ b/examples/chef/devices/rootnode_occupancysensor_iHyVgifZuo.matter @@ -196,6 +196,12 @@ enum PositionTag : enum8 { kColumn = 6; } +enum PowerThresholdSourceEnum : enum8 { + kContract = 0; + kRegulator = 1; + kEquipment = 2; +} + enum RelativePositionTag : enum8 { kUnder = 0; kNextTo = 1; @@ -241,6 +247,12 @@ struct AtomicAttributeStatusStruct { status statusCode = 1; } +struct PowerThresholdStruct { + optional int64s powerThreshold = 0; + optional int64s apparentPowerThreshold = 1; + nullable PowerThresholdSourceEnum powerThresholdSource = 2; +} + /** Attributes and commands for putting a device into Identification mode (e.g. flashing a light). */ cluster Identify = 3 { revision 4; diff --git a/examples/chef/devices/rootnode_onofflight_bbs1b7IaOV.matter b/examples/chef/devices/rootnode_onofflight_bbs1b7IaOV.matter index 5ea09c93aeaa3f..62ed97bcd68a5f 100644 --- a/examples/chef/devices/rootnode_onofflight_bbs1b7IaOV.matter +++ b/examples/chef/devices/rootnode_onofflight_bbs1b7IaOV.matter @@ -196,6 +196,12 @@ enum PositionTag : enum8 { kColumn = 6; } +enum PowerThresholdSourceEnum : enum8 { + kContract = 0; + kRegulator = 1; + kEquipment = 2; +} + enum RelativePositionTag : enum8 { kUnder = 0; kNextTo = 1; @@ -241,6 +247,12 @@ struct AtomicAttributeStatusStruct { status statusCode = 1; } +struct PowerThresholdStruct { + optional int64s powerThreshold = 0; + optional int64s apparentPowerThreshold = 1; + nullable PowerThresholdSourceEnum powerThresholdSource = 2; +} + /** Attributes and commands for putting a device into Identification mode (e.g. flashing a light). */ cluster Identify = 3 { revision 4; diff --git a/examples/chef/devices/rootnode_onofflight_samplemei.matter b/examples/chef/devices/rootnode_onofflight_samplemei.matter index fd59d60f4da13b..c9559dbbc0b400 100644 --- a/examples/chef/devices/rootnode_onofflight_samplemei.matter +++ b/examples/chef/devices/rootnode_onofflight_samplemei.matter @@ -196,6 +196,12 @@ enum PositionTag : enum8 { kColumn = 6; } +enum PowerThresholdSourceEnum : enum8 { + kContract = 0; + kRegulator = 1; + kEquipment = 2; +} + enum RelativePositionTag : enum8 { kUnder = 0; kNextTo = 1; @@ -241,6 +247,12 @@ struct AtomicAttributeStatusStruct { status statusCode = 1; } +struct PowerThresholdStruct { + optional int64s powerThreshold = 0; + optional int64s apparentPowerThreshold = 1; + nullable PowerThresholdSourceEnum powerThresholdSource = 2; +} + /** Attributes and commands for putting a device into Identification mode (e.g. flashing a light). */ cluster Identify = 3 { revision 4; diff --git a/examples/chef/devices/rootnode_onofflightswitch_FsPlMr090Q.matter b/examples/chef/devices/rootnode_onofflightswitch_FsPlMr090Q.matter index eb220b3e15312c..633c46c9ceb64e 100644 --- a/examples/chef/devices/rootnode_onofflightswitch_FsPlMr090Q.matter +++ b/examples/chef/devices/rootnode_onofflightswitch_FsPlMr090Q.matter @@ -196,6 +196,12 @@ enum PositionTag : enum8 { kColumn = 6; } +enum PowerThresholdSourceEnum : enum8 { + kContract = 0; + kRegulator = 1; + kEquipment = 2; +} + enum RelativePositionTag : enum8 { kUnder = 0; kNextTo = 1; @@ -241,6 +247,12 @@ struct AtomicAttributeStatusStruct { status statusCode = 1; } +struct PowerThresholdStruct { + optional int64s powerThreshold = 0; + optional int64s apparentPowerThreshold = 1; + nullable PowerThresholdSourceEnum powerThresholdSource = 2; +} + /** Attributes and commands for putting a device into Identification mode (e.g. flashing a light). */ cluster Identify = 3 { revision 4; diff --git a/examples/chef/devices/rootnode_onoffpluginunit_Wtf8ss5EBY.matter b/examples/chef/devices/rootnode_onoffpluginunit_Wtf8ss5EBY.matter index 25369fa9a10003..c8592a951b3ed5 100644 --- a/examples/chef/devices/rootnode_onoffpluginunit_Wtf8ss5EBY.matter +++ b/examples/chef/devices/rootnode_onoffpluginunit_Wtf8ss5EBY.matter @@ -196,6 +196,12 @@ enum PositionTag : enum8 { kColumn = 6; } +enum PowerThresholdSourceEnum : enum8 { + kContract = 0; + kRegulator = 1; + kEquipment = 2; +} + enum RelativePositionTag : enum8 { kUnder = 0; kNextTo = 1; @@ -241,6 +247,12 @@ struct AtomicAttributeStatusStruct { status statusCode = 1; } +struct PowerThresholdStruct { + optional int64s powerThreshold = 0; + optional int64s apparentPowerThreshold = 1; + nullable PowerThresholdSourceEnum powerThresholdSource = 2; +} + /** Attributes and commands for putting a device into Identification mode (e.g. flashing a light). */ cluster Identify = 3 { revision 4; diff --git a/examples/chef/devices/rootnode_pressuresensor_s0qC9wLH4k.matter b/examples/chef/devices/rootnode_pressuresensor_s0qC9wLH4k.matter index b6f88098b76fb0..cd7a622cc81e93 100644 --- a/examples/chef/devices/rootnode_pressuresensor_s0qC9wLH4k.matter +++ b/examples/chef/devices/rootnode_pressuresensor_s0qC9wLH4k.matter @@ -196,6 +196,12 @@ enum PositionTag : enum8 { kColumn = 6; } +enum PowerThresholdSourceEnum : enum8 { + kContract = 0; + kRegulator = 1; + kEquipment = 2; +} + enum RelativePositionTag : enum8 { kUnder = 0; kNextTo = 1; @@ -241,6 +247,12 @@ struct AtomicAttributeStatusStruct { status statusCode = 1; } +struct PowerThresholdStruct { + optional int64s powerThreshold = 0; + optional int64s apparentPowerThreshold = 1; + nullable PowerThresholdSourceEnum powerThresholdSource = 2; +} + /** Attributes and commands for putting a device into Identification mode (e.g. flashing a light). */ cluster Identify = 3 { revision 4; diff --git a/examples/chef/devices/rootnode_pump_5f904818cc.matter b/examples/chef/devices/rootnode_pump_5f904818cc.matter index 7360b37f4dcd9b..8b30796e661a0c 100644 --- a/examples/chef/devices/rootnode_pump_5f904818cc.matter +++ b/examples/chef/devices/rootnode_pump_5f904818cc.matter @@ -196,6 +196,12 @@ enum PositionTag : enum8 { kColumn = 6; } +enum PowerThresholdSourceEnum : enum8 { + kContract = 0; + kRegulator = 1; + kEquipment = 2; +} + enum RelativePositionTag : enum8 { kUnder = 0; kNextTo = 1; @@ -241,6 +247,12 @@ struct AtomicAttributeStatusStruct { status statusCode = 1; } +struct PowerThresholdStruct { + optional int64s powerThreshold = 0; + optional int64s apparentPowerThreshold = 1; + nullable PowerThresholdSourceEnum powerThresholdSource = 2; +} + /** Attributes and commands for putting a device into Identification mode (e.g. flashing a light). */ cluster Identify = 3 { revision 4; diff --git a/examples/chef/devices/rootnode_pump_a811bb33a0.matter b/examples/chef/devices/rootnode_pump_a811bb33a0.matter index dafa2e8aad0aae..ec9b0515c71479 100644 --- a/examples/chef/devices/rootnode_pump_a811bb33a0.matter +++ b/examples/chef/devices/rootnode_pump_a811bb33a0.matter @@ -196,6 +196,12 @@ enum PositionTag : enum8 { kColumn = 6; } +enum PowerThresholdSourceEnum : enum8 { + kContract = 0; + kRegulator = 1; + kEquipment = 2; +} + enum RelativePositionTag : enum8 { kUnder = 0; kNextTo = 1; @@ -241,6 +247,12 @@ struct AtomicAttributeStatusStruct { status statusCode = 1; } +struct PowerThresholdStruct { + optional int64s powerThreshold = 0; + optional int64s apparentPowerThreshold = 1; + nullable PowerThresholdSourceEnum powerThresholdSource = 2; +} + /** Attributes and commands for putting a device into Identification mode (e.g. flashing a light). */ cluster Identify = 3 { revision 4; diff --git a/examples/chef/devices/rootnode_rainsensor_a7aa5d7738.matter b/examples/chef/devices/rootnode_rainsensor_a7aa5d7738.matter index 45c00b132a930f..fb0da29d9662c5 100644 --- a/examples/chef/devices/rootnode_rainsensor_a7aa5d7738.matter +++ b/examples/chef/devices/rootnode_rainsensor_a7aa5d7738.matter @@ -196,6 +196,12 @@ enum PositionTag : enum8 { kColumn = 6; } +enum PowerThresholdSourceEnum : enum8 { + kContract = 0; + kRegulator = 1; + kEquipment = 2; +} + enum RelativePositionTag : enum8 { kUnder = 0; kNextTo = 1; @@ -241,6 +247,12 @@ struct AtomicAttributeStatusStruct { status statusCode = 1; } +struct PowerThresholdStruct { + optional int64s powerThreshold = 0; + optional int64s apparentPowerThreshold = 1; + nullable PowerThresholdSourceEnum powerThresholdSource = 2; +} + /** Attributes and commands for putting a device into Identification mode (e.g. flashing a light). */ cluster Identify = 3 { revision 4; diff --git a/examples/chef/devices/rootnode_refrigerator_temperaturecontrolledcabinet_temperaturecontrolledcabinet_ffdb696680.matter b/examples/chef/devices/rootnode_refrigerator_temperaturecontrolledcabinet_temperaturecontrolledcabinet_ffdb696680.matter index 5012f1c5a63421..a98584cb622646 100644 --- a/examples/chef/devices/rootnode_refrigerator_temperaturecontrolledcabinet_temperaturecontrolledcabinet_ffdb696680.matter +++ b/examples/chef/devices/rootnode_refrigerator_temperaturecontrolledcabinet_temperaturecontrolledcabinet_ffdb696680.matter @@ -196,6 +196,12 @@ enum PositionTag : enum8 { kColumn = 6; } +enum PowerThresholdSourceEnum : enum8 { + kContract = 0; + kRegulator = 1; + kEquipment = 2; +} + enum RelativePositionTag : enum8 { kUnder = 0; kNextTo = 1; @@ -241,6 +247,12 @@ struct AtomicAttributeStatusStruct { status statusCode = 1; } +struct PowerThresholdStruct { + optional int64s powerThreshold = 0; + optional int64s apparentPowerThreshold = 1; + nullable PowerThresholdSourceEnum powerThresholdSource = 2; +} + /** The Descriptor Cluster is meant to replace the support from the Zigbee Device Object (ZDO) for describing a node, its endpoints and clusters. */ cluster Descriptor = 29 { revision 2; diff --git a/examples/chef/devices/rootnode_roboticvacuumcleaner_1807ff0c49.matter b/examples/chef/devices/rootnode_roboticvacuumcleaner_1807ff0c49.matter index ac9bc592c3945f..bc1f97cde58f42 100644 --- a/examples/chef/devices/rootnode_roboticvacuumcleaner_1807ff0c49.matter +++ b/examples/chef/devices/rootnode_roboticvacuumcleaner_1807ff0c49.matter @@ -196,6 +196,12 @@ enum PositionTag : enum8 { kColumn = 6; } +enum PowerThresholdSourceEnum : enum8 { + kContract = 0; + kRegulator = 1; + kEquipment = 2; +} + enum RelativePositionTag : enum8 { kUnder = 0; kNextTo = 1; @@ -241,6 +247,12 @@ struct AtomicAttributeStatusStruct { status statusCode = 1; } +struct PowerThresholdStruct { + optional int64s powerThreshold = 0; + optional int64s apparentPowerThreshold = 1; + nullable PowerThresholdSourceEnum powerThresholdSource = 2; +} + /** Attributes and commands for putting a device into Identification mode (e.g. flashing a light). */ cluster Identify = 3 { revision 4; diff --git a/examples/chef/devices/rootnode_roomairconditioner_9cf3607804.matter b/examples/chef/devices/rootnode_roomairconditioner_9cf3607804.matter index dcb88705d7f0d2..b34828244e25fb 100644 --- a/examples/chef/devices/rootnode_roomairconditioner_9cf3607804.matter +++ b/examples/chef/devices/rootnode_roomairconditioner_9cf3607804.matter @@ -196,6 +196,12 @@ enum PositionTag : enum8 { kColumn = 6; } +enum PowerThresholdSourceEnum : enum8 { + kContract = 0; + kRegulator = 1; + kEquipment = 2; +} + enum RelativePositionTag : enum8 { kUnder = 0; kNextTo = 1; @@ -241,6 +247,12 @@ struct AtomicAttributeStatusStruct { status statusCode = 1; } +struct PowerThresholdStruct { + optional int64s powerThreshold = 0; + optional int64s apparentPowerThreshold = 1; + nullable PowerThresholdSourceEnum powerThresholdSource = 2; +} + /** Attributes and commands for putting a device into Identification mode (e.g. flashing a light). */ cluster Identify = 3 { revision 4; diff --git a/examples/chef/devices/rootnode_smokecoalarm_686fe0dcb8.matter b/examples/chef/devices/rootnode_smokecoalarm_686fe0dcb8.matter index 5255bc8de4c243..0fdff22e026222 100644 --- a/examples/chef/devices/rootnode_smokecoalarm_686fe0dcb8.matter +++ b/examples/chef/devices/rootnode_smokecoalarm_686fe0dcb8.matter @@ -196,6 +196,12 @@ enum PositionTag : enum8 { kColumn = 6; } +enum PowerThresholdSourceEnum : enum8 { + kContract = 0; + kRegulator = 1; + kEquipment = 2; +} + enum RelativePositionTag : enum8 { kUnder = 0; kNextTo = 1; @@ -241,6 +247,12 @@ struct AtomicAttributeStatusStruct { status statusCode = 1; } +struct PowerThresholdStruct { + optional int64s powerThreshold = 0; + optional int64s apparentPowerThreshold = 1; + nullable PowerThresholdSourceEnum powerThresholdSource = 2; +} + /** Attributes and commands for putting a device into Identification mode (e.g. flashing a light). */ cluster Identify = 3 { revision 4; diff --git a/examples/chef/devices/rootnode_speaker_RpzeXdimqA.matter b/examples/chef/devices/rootnode_speaker_RpzeXdimqA.matter index 8c8a6dc2d02af0..f299ac39d92902 100644 --- a/examples/chef/devices/rootnode_speaker_RpzeXdimqA.matter +++ b/examples/chef/devices/rootnode_speaker_RpzeXdimqA.matter @@ -196,6 +196,12 @@ enum PositionTag : enum8 { kColumn = 6; } +enum PowerThresholdSourceEnum : enum8 { + kContract = 0; + kRegulator = 1; + kEquipment = 2; +} + enum RelativePositionTag : enum8 { kUnder = 0; kNextTo = 1; @@ -241,6 +247,12 @@ struct AtomicAttributeStatusStruct { status statusCode = 1; } +struct PowerThresholdStruct { + optional int64s powerThreshold = 0; + optional int64s apparentPowerThreshold = 1; + nullable PowerThresholdSourceEnum powerThresholdSource = 2; +} + /** Attributes and commands for putting a device into Identification mode (e.g. flashing a light). */ cluster Identify = 3 { revision 4; diff --git a/examples/chef/devices/rootnode_temperaturesensor_Qy1zkNW7c3.matter b/examples/chef/devices/rootnode_temperaturesensor_Qy1zkNW7c3.matter index f45c4f8260dfeb..8e584c4c2528a2 100644 --- a/examples/chef/devices/rootnode_temperaturesensor_Qy1zkNW7c3.matter +++ b/examples/chef/devices/rootnode_temperaturesensor_Qy1zkNW7c3.matter @@ -196,6 +196,12 @@ enum PositionTag : enum8 { kColumn = 6; } +enum PowerThresholdSourceEnum : enum8 { + kContract = 0; + kRegulator = 1; + kEquipment = 2; +} + enum RelativePositionTag : enum8 { kUnder = 0; kNextTo = 1; @@ -241,6 +247,12 @@ struct AtomicAttributeStatusStruct { status statusCode = 1; } +struct PowerThresholdStruct { + optional int64s powerThreshold = 0; + optional int64s apparentPowerThreshold = 1; + nullable PowerThresholdSourceEnum powerThresholdSource = 2; +} + /** Attributes and commands for putting a device into Identification mode (e.g. flashing a light). */ cluster Identify = 3 { revision 4; diff --git a/examples/chef/devices/rootnode_thermostat_bm3fb8dhYi.matter b/examples/chef/devices/rootnode_thermostat_bm3fb8dhYi.matter index 4a01e4a4171e8a..2fd6a7d3edd3d1 100644 --- a/examples/chef/devices/rootnode_thermostat_bm3fb8dhYi.matter +++ b/examples/chef/devices/rootnode_thermostat_bm3fb8dhYi.matter @@ -196,6 +196,12 @@ enum PositionTag : enum8 { kColumn = 6; } +enum PowerThresholdSourceEnum : enum8 { + kContract = 0; + kRegulator = 1; + kEquipment = 2; +} + enum RelativePositionTag : enum8 { kUnder = 0; kNextTo = 1; @@ -241,6 +247,12 @@ struct AtomicAttributeStatusStruct { status statusCode = 1; } +struct PowerThresholdStruct { + optional int64s powerThreshold = 0; + optional int64s apparentPowerThreshold = 1; + nullable PowerThresholdSourceEnum powerThresholdSource = 2; +} + /** Attributes and commands for putting a device into Identification mode (e.g. flashing a light). */ cluster Identify = 3 { revision 4; diff --git a/examples/chef/devices/rootnode_waterfreezedetector_dd94a13a16.matter b/examples/chef/devices/rootnode_waterfreezedetector_dd94a13a16.matter index b10c3021db3be3..5104c178a21541 100644 --- a/examples/chef/devices/rootnode_waterfreezedetector_dd94a13a16.matter +++ b/examples/chef/devices/rootnode_waterfreezedetector_dd94a13a16.matter @@ -196,6 +196,12 @@ enum PositionTag : enum8 { kColumn = 6; } +enum PowerThresholdSourceEnum : enum8 { + kContract = 0; + kRegulator = 1; + kEquipment = 2; +} + enum RelativePositionTag : enum8 { kUnder = 0; kNextTo = 1; @@ -241,6 +247,12 @@ struct AtomicAttributeStatusStruct { status statusCode = 1; } +struct PowerThresholdStruct { + optional int64s powerThreshold = 0; + optional int64s apparentPowerThreshold = 1; + nullable PowerThresholdSourceEnum powerThresholdSource = 2; +} + /** Attributes and commands for putting a device into Identification mode (e.g. flashing a light). */ cluster Identify = 3 { revision 4; diff --git a/examples/chef/devices/rootnode_waterleakdetector_0b067acfa3.matter b/examples/chef/devices/rootnode_waterleakdetector_0b067acfa3.matter index 2a05a812acea06..623daf834012e5 100644 --- a/examples/chef/devices/rootnode_waterleakdetector_0b067acfa3.matter +++ b/examples/chef/devices/rootnode_waterleakdetector_0b067acfa3.matter @@ -196,6 +196,12 @@ enum PositionTag : enum8 { kColumn = 6; } +enum PowerThresholdSourceEnum : enum8 { + kContract = 0; + kRegulator = 1; + kEquipment = 2; +} + enum RelativePositionTag : enum8 { kUnder = 0; kNextTo = 1; @@ -241,6 +247,12 @@ struct AtomicAttributeStatusStruct { status statusCode = 1; } +struct PowerThresholdStruct { + optional int64s powerThreshold = 0; + optional int64s apparentPowerThreshold = 1; + nullable PowerThresholdSourceEnum powerThresholdSource = 2; +} + /** Attributes and commands for putting a device into Identification mode (e.g. flashing a light). */ cluster Identify = 3 { revision 4; diff --git a/examples/chef/devices/rootnode_watervalve_6bb39f1f67.matter b/examples/chef/devices/rootnode_watervalve_6bb39f1f67.matter index a25e889db896a5..1a52d4e93dd780 100644 --- a/examples/chef/devices/rootnode_watervalve_6bb39f1f67.matter +++ b/examples/chef/devices/rootnode_watervalve_6bb39f1f67.matter @@ -196,6 +196,12 @@ enum PositionTag : enum8 { kColumn = 6; } +enum PowerThresholdSourceEnum : enum8 { + kContract = 0; + kRegulator = 1; + kEquipment = 2; +} + enum RelativePositionTag : enum8 { kUnder = 0; kNextTo = 1; @@ -241,6 +247,12 @@ struct AtomicAttributeStatusStruct { status statusCode = 1; } +struct PowerThresholdStruct { + optional int64s powerThreshold = 0; + optional int64s apparentPowerThreshold = 1; + nullable PowerThresholdSourceEnum powerThresholdSource = 2; +} + /** Attributes and commands for putting a device into Identification mode (e.g. flashing a light). */ cluster Identify = 3 { revision 4; diff --git a/examples/chef/devices/rootnode_windowcovering_RLCxaGi9Yx.matter b/examples/chef/devices/rootnode_windowcovering_RLCxaGi9Yx.matter index d6d2bf8ef1c89b..aade899c5ee260 100644 --- a/examples/chef/devices/rootnode_windowcovering_RLCxaGi9Yx.matter +++ b/examples/chef/devices/rootnode_windowcovering_RLCxaGi9Yx.matter @@ -196,6 +196,12 @@ enum PositionTag : enum8 { kColumn = 6; } +enum PowerThresholdSourceEnum : enum8 { + kContract = 0; + kRegulator = 1; + kEquipment = 2; +} + enum RelativePositionTag : enum8 { kUnder = 0; kNextTo = 1; @@ -241,6 +247,12 @@ struct AtomicAttributeStatusStruct { status statusCode = 1; } +struct PowerThresholdStruct { + optional int64s powerThreshold = 0; + optional int64s apparentPowerThreshold = 1; + nullable PowerThresholdSourceEnum powerThresholdSource = 2; +} + /** Attributes and commands for putting a device into Identification mode (e.g. flashing a light). */ cluster Identify = 3 { revision 4; diff --git a/examples/closure-app/closure-common/closure-app.matter b/examples/closure-app/closure-common/closure-app.matter index a8726098cf00a5..3c70ef997f5675 100644 --- a/examples/closure-app/closure-common/closure-app.matter +++ b/examples/closure-app/closure-common/closure-app.matter @@ -196,6 +196,12 @@ enum PositionTag : enum8 { kColumn = 6; } +enum PowerThresholdSourceEnum : enum8 { + kContract = 0; + kRegulator = 1; + kEquipment = 2; +} + enum RelativePositionTag : enum8 { kUnder = 0; kNextTo = 1; @@ -241,6 +247,12 @@ struct AtomicAttributeStatusStruct { status statusCode = 1; } +struct PowerThresholdStruct { + optional int64s powerThreshold = 0; + optional int64s apparentPowerThreshold = 1; + nullable PowerThresholdSourceEnum powerThresholdSource = 2; +} + /** Attributes and commands for putting a device into Identification mode (e.g. flashing a light). */ cluster Identify = 3 { revision 4; diff --git a/examples/contact-sensor-app/bouffalolab/data_model/contact-sensor-app.matter b/examples/contact-sensor-app/bouffalolab/data_model/contact-sensor-app.matter index f48224fa5822aa..f2e35efb47bc58 100644 --- a/examples/contact-sensor-app/bouffalolab/data_model/contact-sensor-app.matter +++ b/examples/contact-sensor-app/bouffalolab/data_model/contact-sensor-app.matter @@ -196,6 +196,12 @@ enum PositionTag : enum8 { kColumn = 6; } +enum PowerThresholdSourceEnum : enum8 { + kContract = 0; + kRegulator = 1; + kEquipment = 2; +} + enum RelativePositionTag : enum8 { kUnder = 0; kNextTo = 1; @@ -241,6 +247,12 @@ struct AtomicAttributeStatusStruct { status statusCode = 1; } +struct PowerThresholdStruct { + optional int64s powerThreshold = 0; + optional int64s apparentPowerThreshold = 1; + nullable PowerThresholdSourceEnum powerThresholdSource = 2; +} + /** Attributes and commands for putting a device into Identification mode (e.g. flashing a light). */ cluster Identify = 3 { revision 4; diff --git a/examples/contact-sensor-app/contact-sensor-common/contact-sensor-app.matter b/examples/contact-sensor-app/contact-sensor-common/contact-sensor-app.matter index 3762d9898fb4ce..5aefdcb13486f6 100644 --- a/examples/contact-sensor-app/contact-sensor-common/contact-sensor-app.matter +++ b/examples/contact-sensor-app/contact-sensor-common/contact-sensor-app.matter @@ -196,6 +196,12 @@ enum PositionTag : enum8 { kColumn = 6; } +enum PowerThresholdSourceEnum : enum8 { + kContract = 0; + kRegulator = 1; + kEquipment = 2; +} + enum RelativePositionTag : enum8 { kUnder = 0; kNextTo = 1; @@ -241,6 +247,12 @@ struct AtomicAttributeStatusStruct { status statusCode = 1; } +struct PowerThresholdStruct { + optional int64s powerThreshold = 0; + optional int64s apparentPowerThreshold = 1; + nullable PowerThresholdSourceEnum powerThresholdSource = 2; +} + /** Attributes and commands for putting a device into Identification mode (e.g. flashing a light). */ cluster Identify = 3 { revision 4; diff --git a/examples/contact-sensor-app/nxp/zap-lit/contact-sensor-app.matter b/examples/contact-sensor-app/nxp/zap-lit/contact-sensor-app.matter index 6bfb6ea59bae6a..e8eb289c7392c7 100644 --- a/examples/contact-sensor-app/nxp/zap-lit/contact-sensor-app.matter +++ b/examples/contact-sensor-app/nxp/zap-lit/contact-sensor-app.matter @@ -196,6 +196,12 @@ enum PositionTag : enum8 { kColumn = 6; } +enum PowerThresholdSourceEnum : enum8 { + kContract = 0; + kRegulator = 1; + kEquipment = 2; +} + enum RelativePositionTag : enum8 { kUnder = 0; kNextTo = 1; @@ -241,6 +247,12 @@ struct AtomicAttributeStatusStruct { status statusCode = 1; } +struct PowerThresholdStruct { + optional int64s powerThreshold = 0; + optional int64s apparentPowerThreshold = 1; + nullable PowerThresholdSourceEnum powerThresholdSource = 2; +} + /** Attributes and commands for putting a device into Identification mode (e.g. flashing a light). */ cluster Identify = 3 { revision 4; diff --git a/examples/contact-sensor-app/nxp/zap-sit/contact-sensor-app.matter b/examples/contact-sensor-app/nxp/zap-sit/contact-sensor-app.matter index efc59d7c9aaf08..00533810baa168 100644 --- a/examples/contact-sensor-app/nxp/zap-sit/contact-sensor-app.matter +++ b/examples/contact-sensor-app/nxp/zap-sit/contact-sensor-app.matter @@ -196,6 +196,12 @@ enum PositionTag : enum8 { kColumn = 6; } +enum PowerThresholdSourceEnum : enum8 { + kContract = 0; + kRegulator = 1; + kEquipment = 2; +} + enum RelativePositionTag : enum8 { kUnder = 0; kNextTo = 1; @@ -241,6 +247,12 @@ struct AtomicAttributeStatusStruct { status statusCode = 1; } +struct PowerThresholdStruct { + optional int64s powerThreshold = 0; + optional int64s apparentPowerThreshold = 1; + nullable PowerThresholdSourceEnum powerThresholdSource = 2; +} + /** Attributes and commands for putting a device into Identification mode (e.g. flashing a light). */ cluster Identify = 3 { revision 4; diff --git a/examples/dishwasher-app/dishwasher-common/dishwasher-app.matter b/examples/dishwasher-app/dishwasher-common/dishwasher-app.matter index 2b8e28d51c0bab..8791cf52f05566 100644 --- a/examples/dishwasher-app/dishwasher-common/dishwasher-app.matter +++ b/examples/dishwasher-app/dishwasher-common/dishwasher-app.matter @@ -196,6 +196,12 @@ enum PositionTag : enum8 { kColumn = 6; } +enum PowerThresholdSourceEnum : enum8 { + kContract = 0; + kRegulator = 1; + kEquipment = 2; +} + enum RelativePositionTag : enum8 { kUnder = 0; kNextTo = 1; @@ -241,6 +247,12 @@ struct AtomicAttributeStatusStruct { status statusCode = 1; } +struct PowerThresholdStruct { + optional int64s powerThreshold = 0; + optional int64s apparentPowerThreshold = 1; + nullable PowerThresholdSourceEnum powerThresholdSource = 2; +} + /** Attributes and commands for putting a device into Identification mode (e.g. flashing a light). */ cluster Identify = 3 { revision 4; diff --git a/examples/dishwasher-app/silabs/data_model/dishwasher-thread-app.matter b/examples/dishwasher-app/silabs/data_model/dishwasher-thread-app.matter index 7f3f76b3d3441b..d89b3eaffc1677 100644 --- a/examples/dishwasher-app/silabs/data_model/dishwasher-thread-app.matter +++ b/examples/dishwasher-app/silabs/data_model/dishwasher-thread-app.matter @@ -196,6 +196,12 @@ enum PositionTag : enum8 { kColumn = 6; } +enum PowerThresholdSourceEnum : enum8 { + kContract = 0; + kRegulator = 1; + kEquipment = 2; +} + enum RelativePositionTag : enum8 { kUnder = 0; kNextTo = 1; @@ -241,6 +247,12 @@ struct AtomicAttributeStatusStruct { status statusCode = 1; } +struct PowerThresholdStruct { + optional int64s powerThreshold = 0; + optional int64s apparentPowerThreshold = 1; + nullable PowerThresholdSourceEnum powerThresholdSource = 2; +} + /** Attributes and commands for putting a device into Identification mode (e.g. flashing a light). */ cluster Identify = 3 { revision 4; diff --git a/examples/dishwasher-app/silabs/data_model/dishwasher-wifi-app.matter b/examples/dishwasher-app/silabs/data_model/dishwasher-wifi-app.matter index 3c3e11a8cdaa89..75ece5fe3037e6 100644 --- a/examples/dishwasher-app/silabs/data_model/dishwasher-wifi-app.matter +++ b/examples/dishwasher-app/silabs/data_model/dishwasher-wifi-app.matter @@ -196,6 +196,12 @@ enum PositionTag : enum8 { kColumn = 6; } +enum PowerThresholdSourceEnum : enum8 { + kContract = 0; + kRegulator = 1; + kEquipment = 2; +} + enum RelativePositionTag : enum8 { kUnder = 0; kNextTo = 1; @@ -241,6 +247,12 @@ struct AtomicAttributeStatusStruct { status statusCode = 1; } +struct PowerThresholdStruct { + optional int64s powerThreshold = 0; + optional int64s apparentPowerThreshold = 1; + nullable PowerThresholdSourceEnum powerThresholdSource = 2; +} + /** Attributes and commands for putting a device into Identification mode (e.g. flashing a light). */ cluster Identify = 3 { revision 4; 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 0576b6cfa6965e..281ef4452ffa92 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 @@ -196,6 +196,12 @@ enum PositionTag : enum8 { kColumn = 6; } +enum PowerThresholdSourceEnum : enum8 { + kContract = 0; + kRegulator = 1; + kEquipment = 2; +} + enum RelativePositionTag : enum8 { kUnder = 0; kNextTo = 1; @@ -241,6 +247,12 @@ struct AtomicAttributeStatusStruct { status statusCode = 1; } +struct PowerThresholdStruct { + optional int64s powerThreshold = 0; + optional int64s apparentPowerThreshold = 1; + nullable PowerThresholdSourceEnum powerThresholdSource = 2; +} + /** Attributes and commands for putting a device into Identification mode (e.g. flashing a light). */ cluster Identify = 3 { revision 4; diff --git a/examples/fabric-bridge-app/fabric-bridge-common/fabric-bridge-app.matter b/examples/fabric-bridge-app/fabric-bridge-common/fabric-bridge-app.matter index 70fa0d59a6d942..5b5199beb25480 100644 --- a/examples/fabric-bridge-app/fabric-bridge-common/fabric-bridge-app.matter +++ b/examples/fabric-bridge-app/fabric-bridge-common/fabric-bridge-app.matter @@ -196,6 +196,12 @@ enum PositionTag : enum8 { kColumn = 6; } +enum PowerThresholdSourceEnum : enum8 { + kContract = 0; + kRegulator = 1; + kEquipment = 2; +} + enum RelativePositionTag : enum8 { kUnder = 0; kNextTo = 1; @@ -241,6 +247,12 @@ struct AtomicAttributeStatusStruct { status statusCode = 1; } +struct PowerThresholdStruct { + optional int64s powerThreshold = 0; + optional int64s apparentPowerThreshold = 1; + nullable PowerThresholdSourceEnum powerThresholdSource = 2; +} + /** Attributes and commands for putting a device into Identification mode (e.g. flashing a light). */ cluster Identify = 3 { revision 4; diff --git a/examples/fabric-sync/bridge/fabric-bridge.matter b/examples/fabric-sync/bridge/fabric-bridge.matter index 70fa0d59a6d942..5b5199beb25480 100644 --- a/examples/fabric-sync/bridge/fabric-bridge.matter +++ b/examples/fabric-sync/bridge/fabric-bridge.matter @@ -196,6 +196,12 @@ enum PositionTag : enum8 { kColumn = 6; } +enum PowerThresholdSourceEnum : enum8 { + kContract = 0; + kRegulator = 1; + kEquipment = 2; +} + enum RelativePositionTag : enum8 { kUnder = 0; kNextTo = 1; @@ -241,6 +247,12 @@ struct AtomicAttributeStatusStruct { status statusCode = 1; } +struct PowerThresholdStruct { + optional int64s powerThreshold = 0; + optional int64s apparentPowerThreshold = 1; + nullable PowerThresholdSourceEnum powerThresholdSource = 2; +} + /** Attributes and commands for putting a device into Identification mode (e.g. flashing a light). */ cluster Identify = 3 { revision 4; diff --git a/examples/laundry-washer-app/nxp/zap/laundry-washer-app.matter b/examples/laundry-washer-app/nxp/zap/laundry-washer-app.matter index 714f60e1ab57c8..aea8516e129d2f 100644 --- a/examples/laundry-washer-app/nxp/zap/laundry-washer-app.matter +++ b/examples/laundry-washer-app/nxp/zap/laundry-washer-app.matter @@ -196,6 +196,12 @@ enum PositionTag : enum8 { kColumn = 6; } +enum PowerThresholdSourceEnum : enum8 { + kContract = 0; + kRegulator = 1; + kEquipment = 2; +} + enum RelativePositionTag : enum8 { kUnder = 0; kNextTo = 1; @@ -241,6 +247,12 @@ struct AtomicAttributeStatusStruct { status statusCode = 1; } +struct PowerThresholdStruct { + optional int64s powerThreshold = 0; + optional int64s apparentPowerThreshold = 1; + nullable PowerThresholdSourceEnum powerThresholdSource = 2; +} + /** Attributes and commands for putting a device into Identification mode (e.g. flashing a light). */ cluster Identify = 3 { revision 4; diff --git a/examples/light-switch-app/light-switch-common/icd-lit-light-switch-app.matter b/examples/light-switch-app/light-switch-common/icd-lit-light-switch-app.matter index 7b2016cd5e6d8c..c005e698b77fcb 100644 --- a/examples/light-switch-app/light-switch-common/icd-lit-light-switch-app.matter +++ b/examples/light-switch-app/light-switch-common/icd-lit-light-switch-app.matter @@ -196,6 +196,12 @@ enum PositionTag : enum8 { kColumn = 6; } +enum PowerThresholdSourceEnum : enum8 { + kContract = 0; + kRegulator = 1; + kEquipment = 2; +} + enum RelativePositionTag : enum8 { kUnder = 0; kNextTo = 1; @@ -241,6 +247,12 @@ struct AtomicAttributeStatusStruct { status statusCode = 1; } +struct PowerThresholdStruct { + optional int64s powerThreshold = 0; + optional int64s apparentPowerThreshold = 1; + nullable PowerThresholdSourceEnum powerThresholdSource = 2; +} + /** Attributes and commands for putting a device into Identification mode (e.g. flashing a light). */ cluster Identify = 3 { revision 4; diff --git a/examples/light-switch-app/light-switch-common/light-switch-app.matter b/examples/light-switch-app/light-switch-common/light-switch-app.matter index 5c16ba9067c7cf..fc81fff3a24788 100644 --- a/examples/light-switch-app/light-switch-common/light-switch-app.matter +++ b/examples/light-switch-app/light-switch-common/light-switch-app.matter @@ -196,6 +196,12 @@ enum PositionTag : enum8 { kColumn = 6; } +enum PowerThresholdSourceEnum : enum8 { + kContract = 0; + kRegulator = 1; + kEquipment = 2; +} + enum RelativePositionTag : enum8 { kUnder = 0; kNextTo = 1; @@ -241,6 +247,12 @@ struct AtomicAttributeStatusStruct { status statusCode = 1; } +struct PowerThresholdStruct { + optional int64s powerThreshold = 0; + optional int64s apparentPowerThreshold = 1; + nullable PowerThresholdSourceEnum powerThresholdSource = 2; +} + /** Attributes and commands for putting a device into Identification mode (e.g. flashing a light). */ cluster Identify = 3 { revision 4; diff --git a/examples/light-switch-app/qpg/zap/switch.matter b/examples/light-switch-app/qpg/zap/switch.matter index 9619592c72726e..7fe3c69f53b9c8 100644 --- a/examples/light-switch-app/qpg/zap/switch.matter +++ b/examples/light-switch-app/qpg/zap/switch.matter @@ -196,6 +196,12 @@ enum PositionTag : enum8 { kColumn = 6; } +enum PowerThresholdSourceEnum : enum8 { + kContract = 0; + kRegulator = 1; + kEquipment = 2; +} + enum RelativePositionTag : enum8 { kUnder = 0; kNextTo = 1; @@ -241,6 +247,12 @@ struct AtomicAttributeStatusStruct { status statusCode = 1; } +struct PowerThresholdStruct { + optional int64s powerThreshold = 0; + optional int64s apparentPowerThreshold = 1; + nullable PowerThresholdSourceEnum powerThresholdSource = 2; +} + /** Attributes and commands for putting a device into Identification mode (e.g. flashing a light). */ cluster Identify = 3 { revision 4; diff --git a/examples/lighting-app-data-mode-no-unique-id/lighting-common/lighting-app.matter b/examples/lighting-app-data-mode-no-unique-id/lighting-common/lighting-app.matter index 10315204f3983c..2c5604c66d5c54 100644 --- a/examples/lighting-app-data-mode-no-unique-id/lighting-common/lighting-app.matter +++ b/examples/lighting-app-data-mode-no-unique-id/lighting-common/lighting-app.matter @@ -196,6 +196,12 @@ enum PositionTag : enum8 { kColumn = 6; } +enum PowerThresholdSourceEnum : enum8 { + kContract = 0; + kRegulator = 1; + kEquipment = 2; +} + enum RelativePositionTag : enum8 { kUnder = 0; kNextTo = 1; @@ -241,6 +247,12 @@ struct AtomicAttributeStatusStruct { status statusCode = 1; } +struct PowerThresholdStruct { + optional int64s powerThreshold = 0; + optional int64s apparentPowerThreshold = 1; + nullable PowerThresholdSourceEnum powerThresholdSource = 2; +} + /** Attributes and commands for putting a device into Identification mode (e.g. flashing a light). */ cluster Identify = 3 { revision 4; diff --git a/examples/lighting-app/bouffalolab/data_model/lighting-app-ethernet.matter b/examples/lighting-app/bouffalolab/data_model/lighting-app-ethernet.matter index d5a5df0e868a5f..079e9e48657d79 100644 --- a/examples/lighting-app/bouffalolab/data_model/lighting-app-ethernet.matter +++ b/examples/lighting-app/bouffalolab/data_model/lighting-app-ethernet.matter @@ -196,6 +196,12 @@ enum PositionTag : enum8 { kColumn = 6; } +enum PowerThresholdSourceEnum : enum8 { + kContract = 0; + kRegulator = 1; + kEquipment = 2; +} + enum RelativePositionTag : enum8 { kUnder = 0; kNextTo = 1; @@ -241,6 +247,12 @@ struct AtomicAttributeStatusStruct { status statusCode = 1; } +struct PowerThresholdStruct { + optional int64s powerThreshold = 0; + optional int64s apparentPowerThreshold = 1; + nullable PowerThresholdSourceEnum powerThresholdSource = 2; +} + /** Attributes and commands for putting a device into Identification mode (e.g. flashing a light). */ cluster Identify = 3 { revision 4; diff --git a/examples/lighting-app/bouffalolab/data_model/lighting-app-thread.matter b/examples/lighting-app/bouffalolab/data_model/lighting-app-thread.matter index b89fcabf2b10a0..1ede04fdcc7569 100644 --- a/examples/lighting-app/bouffalolab/data_model/lighting-app-thread.matter +++ b/examples/lighting-app/bouffalolab/data_model/lighting-app-thread.matter @@ -196,6 +196,12 @@ enum PositionTag : enum8 { kColumn = 6; } +enum PowerThresholdSourceEnum : enum8 { + kContract = 0; + kRegulator = 1; + kEquipment = 2; +} + enum RelativePositionTag : enum8 { kUnder = 0; kNextTo = 1; @@ -241,6 +247,12 @@ struct AtomicAttributeStatusStruct { status statusCode = 1; } +struct PowerThresholdStruct { + optional int64s powerThreshold = 0; + optional int64s apparentPowerThreshold = 1; + nullable PowerThresholdSourceEnum powerThresholdSource = 2; +} + /** Attributes and commands for putting a device into Identification mode (e.g. flashing a light). */ cluster Identify = 3 { revision 4; diff --git a/examples/lighting-app/bouffalolab/data_model/lighting-app-wifi.matter b/examples/lighting-app/bouffalolab/data_model/lighting-app-wifi.matter index 05938f30759c57..0f2d72204a0397 100644 --- a/examples/lighting-app/bouffalolab/data_model/lighting-app-wifi.matter +++ b/examples/lighting-app/bouffalolab/data_model/lighting-app-wifi.matter @@ -196,6 +196,12 @@ enum PositionTag : enum8 { kColumn = 6; } +enum PowerThresholdSourceEnum : enum8 { + kContract = 0; + kRegulator = 1; + kEquipment = 2; +} + enum RelativePositionTag : enum8 { kUnder = 0; kNextTo = 1; @@ -241,6 +247,12 @@ struct AtomicAttributeStatusStruct { status statusCode = 1; } +struct PowerThresholdStruct { + optional int64s powerThreshold = 0; + optional int64s apparentPowerThreshold = 1; + nullable PowerThresholdSourceEnum powerThresholdSource = 2; +} + /** Attributes and commands for putting a device into Identification mode (e.g. flashing a light). */ cluster Identify = 3 { revision 4; diff --git a/examples/lighting-app/lighting-common/lighting-app.matter b/examples/lighting-app/lighting-common/lighting-app.matter index 96f50439028222..88f326d3a30c93 100644 --- a/examples/lighting-app/lighting-common/lighting-app.matter +++ b/examples/lighting-app/lighting-common/lighting-app.matter @@ -196,6 +196,12 @@ enum PositionTag : enum8 { kColumn = 6; } +enum PowerThresholdSourceEnum : enum8 { + kContract = 0; + kRegulator = 1; + kEquipment = 2; +} + enum RelativePositionTag : enum8 { kUnder = 0; kNextTo = 1; @@ -241,6 +247,12 @@ struct AtomicAttributeStatusStruct { status statusCode = 1; } +struct PowerThresholdStruct { + optional int64s powerThreshold = 0; + optional int64s apparentPowerThreshold = 1; + nullable PowerThresholdSourceEnum powerThresholdSource = 2; +} + /** Attributes and commands for putting a device into Identification mode (e.g. flashing a light). */ cluster Identify = 3 { revision 4; diff --git a/examples/lighting-app/nxp/zap/lighting-on-off.matter b/examples/lighting-app/nxp/zap/lighting-on-off.matter index 74d342e4a407f1..6d3091d87952cb 100644 --- a/examples/lighting-app/nxp/zap/lighting-on-off.matter +++ b/examples/lighting-app/nxp/zap/lighting-on-off.matter @@ -196,6 +196,12 @@ enum PositionTag : enum8 { kColumn = 6; } +enum PowerThresholdSourceEnum : enum8 { + kContract = 0; + kRegulator = 1; + kEquipment = 2; +} + enum RelativePositionTag : enum8 { kUnder = 0; kNextTo = 1; @@ -241,6 +247,12 @@ struct AtomicAttributeStatusStruct { status statusCode = 1; } +struct PowerThresholdStruct { + optional int64s powerThreshold = 0; + optional int64s apparentPowerThreshold = 1; + nullable PowerThresholdSourceEnum powerThresholdSource = 2; +} + /** Attributes and commands for putting a device into Identification mode (e.g. flashing a light). */ cluster Identify = 3 { revision 4; diff --git a/examples/lighting-app/qpg/zap/light.matter b/examples/lighting-app/qpg/zap/light.matter index 126b4c1ab4c5c8..c19c4417a0e76a 100644 --- a/examples/lighting-app/qpg/zap/light.matter +++ b/examples/lighting-app/qpg/zap/light.matter @@ -196,6 +196,12 @@ enum PositionTag : enum8 { kColumn = 6; } +enum PowerThresholdSourceEnum : enum8 { + kContract = 0; + kRegulator = 1; + kEquipment = 2; +} + enum RelativePositionTag : enum8 { kUnder = 0; kNextTo = 1; @@ -241,6 +247,12 @@ struct AtomicAttributeStatusStruct { status statusCode = 1; } +struct PowerThresholdStruct { + optional int64s powerThreshold = 0; + optional int64s apparentPowerThreshold = 1; + nullable PowerThresholdSourceEnum powerThresholdSource = 2; +} + /** Attributes and commands for putting a device into Identification mode (e.g. flashing a light). */ cluster Identify = 3 { revision 4; diff --git a/examples/lighting-app/silabs/data_model/lighting-thread-app.matter b/examples/lighting-app/silabs/data_model/lighting-thread-app.matter index 6f4f29166c9857..d03cdbb7d4c0a5 100644 --- a/examples/lighting-app/silabs/data_model/lighting-thread-app.matter +++ b/examples/lighting-app/silabs/data_model/lighting-thread-app.matter @@ -196,6 +196,12 @@ enum PositionTag : enum8 { kColumn = 6; } +enum PowerThresholdSourceEnum : enum8 { + kContract = 0; + kRegulator = 1; + kEquipment = 2; +} + enum RelativePositionTag : enum8 { kUnder = 0; kNextTo = 1; @@ -241,6 +247,12 @@ struct AtomicAttributeStatusStruct { status statusCode = 1; } +struct PowerThresholdStruct { + optional int64s powerThreshold = 0; + optional int64s apparentPowerThreshold = 1; + nullable PowerThresholdSourceEnum powerThresholdSource = 2; +} + /** Attributes and commands for putting a device into Identification mode (e.g. flashing a light). */ cluster Identify = 3 { revision 4; diff --git a/examples/lighting-app/silabs/data_model/lighting-wifi-app.matter b/examples/lighting-app/silabs/data_model/lighting-wifi-app.matter index dc6ecd865b31ce..2669c29fb51cee 100644 --- a/examples/lighting-app/silabs/data_model/lighting-wifi-app.matter +++ b/examples/lighting-app/silabs/data_model/lighting-wifi-app.matter @@ -196,6 +196,12 @@ enum PositionTag : enum8 { kColumn = 6; } +enum PowerThresholdSourceEnum : enum8 { + kContract = 0; + kRegulator = 1; + kEquipment = 2; +} + enum RelativePositionTag : enum8 { kUnder = 0; kNextTo = 1; @@ -241,6 +247,12 @@ struct AtomicAttributeStatusStruct { status statusCode = 1; } +struct PowerThresholdStruct { + optional int64s powerThreshold = 0; + optional int64s apparentPowerThreshold = 1; + nullable PowerThresholdSourceEnum powerThresholdSource = 2; +} + /** Attributes and commands for putting a device into Identification mode (e.g. flashing a light). */ cluster Identify = 3 { revision 4; diff --git a/examples/lit-icd-app/lit-icd-common/lit-icd-server-app.matter b/examples/lit-icd-app/lit-icd-common/lit-icd-server-app.matter index 6801ff2bbc4a1d..dd0224c8bc3c4f 100644 --- a/examples/lit-icd-app/lit-icd-common/lit-icd-server-app.matter +++ b/examples/lit-icd-app/lit-icd-common/lit-icd-server-app.matter @@ -196,6 +196,12 @@ enum PositionTag : enum8 { kColumn = 6; } +enum PowerThresholdSourceEnum : enum8 { + kContract = 0; + kRegulator = 1; + kEquipment = 2; +} + enum RelativePositionTag : enum8 { kUnder = 0; kNextTo = 1; @@ -241,6 +247,12 @@ struct AtomicAttributeStatusStruct { status statusCode = 1; } +struct PowerThresholdStruct { + optional int64s powerThreshold = 0; + optional int64s apparentPowerThreshold = 1; + nullable PowerThresholdSourceEnum powerThresholdSource = 2; +} + /** Attributes and commands for putting a device into Identification mode (e.g. flashing a light). */ cluster Identify = 3 { revision 4; diff --git a/examples/lock-app/lock-common/lock-app.matter b/examples/lock-app/lock-common/lock-app.matter index be36c3c5a4ac02..23189412bfce03 100644 --- a/examples/lock-app/lock-common/lock-app.matter +++ b/examples/lock-app/lock-common/lock-app.matter @@ -196,6 +196,12 @@ enum PositionTag : enum8 { kColumn = 6; } +enum PowerThresholdSourceEnum : enum8 { + kContract = 0; + kRegulator = 1; + kEquipment = 2; +} + enum RelativePositionTag : enum8 { kUnder = 0; kNextTo = 1; @@ -241,6 +247,12 @@ struct AtomicAttributeStatusStruct { status statusCode = 1; } +struct PowerThresholdStruct { + optional int64s powerThreshold = 0; + optional int64s apparentPowerThreshold = 1; + nullable PowerThresholdSourceEnum powerThresholdSource = 2; +} + /** Attributes and commands for putting a device into Identification mode (e.g. flashing a light). */ cluster Identify = 3 { revision 4; diff --git a/examples/lock-app/nxp/zap/lock-app.matter b/examples/lock-app/nxp/zap/lock-app.matter index 4a8d44e788b0ed..8b58e82aa9dce4 100644 --- a/examples/lock-app/nxp/zap/lock-app.matter +++ b/examples/lock-app/nxp/zap/lock-app.matter @@ -196,6 +196,12 @@ enum PositionTag : enum8 { kColumn = 6; } +enum PowerThresholdSourceEnum : enum8 { + kContract = 0; + kRegulator = 1; + kEquipment = 2; +} + enum RelativePositionTag : enum8 { kUnder = 0; kNextTo = 1; @@ -241,6 +247,12 @@ struct AtomicAttributeStatusStruct { status statusCode = 1; } +struct PowerThresholdStruct { + optional int64s powerThreshold = 0; + optional int64s apparentPowerThreshold = 1; + nullable PowerThresholdSourceEnum powerThresholdSource = 2; +} + /** Attributes and commands for putting a device into Identification mode (e.g. flashing a light). */ cluster Identify = 3 { revision 4; diff --git a/examples/lock-app/qpg/zap/lock.matter b/examples/lock-app/qpg/zap/lock.matter index 24c7fc62618e81..9790928f070d66 100644 --- a/examples/lock-app/qpg/zap/lock.matter +++ b/examples/lock-app/qpg/zap/lock.matter @@ -196,6 +196,12 @@ enum PositionTag : enum8 { kColumn = 6; } +enum PowerThresholdSourceEnum : enum8 { + kContract = 0; + kRegulator = 1; + kEquipment = 2; +} + enum RelativePositionTag : enum8 { kUnder = 0; kNextTo = 1; @@ -241,6 +247,12 @@ struct AtomicAttributeStatusStruct { status statusCode = 1; } +struct PowerThresholdStruct { + optional int64s powerThreshold = 0; + optional int64s apparentPowerThreshold = 1; + nullable PowerThresholdSourceEnum powerThresholdSource = 2; +} + /** Attributes and commands for putting a device into Identification mode (e.g. flashing a light). */ cluster Identify = 3 { revision 4; diff --git a/examples/lock-app/silabs/data_model/lock-app.matter b/examples/lock-app/silabs/data_model/lock-app.matter index 6e0281d6f5aaf3..39420d10b6ef61 100644 --- a/examples/lock-app/silabs/data_model/lock-app.matter +++ b/examples/lock-app/silabs/data_model/lock-app.matter @@ -196,6 +196,12 @@ enum PositionTag : enum8 { kColumn = 6; } +enum PowerThresholdSourceEnum : enum8 { + kContract = 0; + kRegulator = 1; + kEquipment = 2; +} + enum RelativePositionTag : enum8 { kUnder = 0; kNextTo = 1; @@ -241,6 +247,12 @@ struct AtomicAttributeStatusStruct { status statusCode = 1; } +struct PowerThresholdStruct { + optional int64s powerThreshold = 0; + optional int64s apparentPowerThreshold = 1; + nullable PowerThresholdSourceEnum powerThresholdSource = 2; +} + /** Attributes and commands for putting a device into Identification mode (e.g. flashing a light). */ cluster Identify = 3 { revision 4; diff --git a/examples/log-source-app/log-source-common/log-source-app.matter b/examples/log-source-app/log-source-common/log-source-app.matter index f94453a63572a1..a6192b5cba4a1c 100644 --- a/examples/log-source-app/log-source-common/log-source-app.matter +++ b/examples/log-source-app/log-source-common/log-source-app.matter @@ -196,6 +196,12 @@ enum PositionTag : enum8 { kColumn = 6; } +enum PowerThresholdSourceEnum : enum8 { + kContract = 0; + kRegulator = 1; + kEquipment = 2; +} + enum RelativePositionTag : enum8 { kUnder = 0; kNextTo = 1; @@ -241,6 +247,12 @@ struct AtomicAttributeStatusStruct { status statusCode = 1; } +struct PowerThresholdStruct { + optional int64s powerThreshold = 0; + optional int64s apparentPowerThreshold = 1; + nullable PowerThresholdSourceEnum powerThresholdSource = 2; +} + /** The Access Control Cluster exposes a data model view of a Node's Access Control List (ACL), which codifies the rules used to manage and enforce Access Control for the Node's endpoints and their associated diff --git a/examples/microwave-oven-app/microwave-oven-common/microwave-oven-app.matter b/examples/microwave-oven-app/microwave-oven-common/microwave-oven-app.matter index fe26c9611a033e..3dc91c5e05523a 100644 --- a/examples/microwave-oven-app/microwave-oven-common/microwave-oven-app.matter +++ b/examples/microwave-oven-app/microwave-oven-common/microwave-oven-app.matter @@ -196,6 +196,12 @@ enum PositionTag : enum8 { kColumn = 6; } +enum PowerThresholdSourceEnum : enum8 { + kContract = 0; + kRegulator = 1; + kEquipment = 2; +} + enum RelativePositionTag : enum8 { kUnder = 0; kNextTo = 1; @@ -241,6 +247,12 @@ struct AtomicAttributeStatusStruct { status statusCode = 1; } +struct PowerThresholdStruct { + optional int64s powerThreshold = 0; + optional int64s apparentPowerThreshold = 1; + nullable PowerThresholdSourceEnum powerThresholdSource = 2; +} + /** Attributes and commands for putting a device into Identification mode (e.g. flashing a light). */ cluster Identify = 3 { revision 4; 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 372b37842e774d..4e2e42db6c6103 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 @@ -196,6 +196,12 @@ enum PositionTag : enum8 { kColumn = 6; } +enum PowerThresholdSourceEnum : enum8 { + kContract = 0; + kRegulator = 1; + kEquipment = 2; +} + enum RelativePositionTag : enum8 { kUnder = 0; kNextTo = 1; @@ -241,6 +247,12 @@ struct AtomicAttributeStatusStruct { status statusCode = 1; } +struct PowerThresholdStruct { + optional int64s powerThreshold = 0; + optional int64s apparentPowerThreshold = 1; + nullable PowerThresholdSourceEnum powerThresholdSource = 2; +} + /** The Descriptor Cluster is meant to replace the support from the Zigbee Device Object (ZDO) for describing a node, its endpoints and clusters. */ cluster Descriptor = 29 { revision 2; diff --git a/examples/ota-provider-app/ota-provider-common/ota-provider-app.matter b/examples/ota-provider-app/ota-provider-common/ota-provider-app.matter index 7525a1023b32e9..8f3dbe0efd570d 100644 --- a/examples/ota-provider-app/ota-provider-common/ota-provider-app.matter +++ b/examples/ota-provider-app/ota-provider-common/ota-provider-app.matter @@ -196,6 +196,12 @@ enum PositionTag : enum8 { kColumn = 6; } +enum PowerThresholdSourceEnum : enum8 { + kContract = 0; + kRegulator = 1; + kEquipment = 2; +} + enum RelativePositionTag : enum8 { kUnder = 0; kNextTo = 1; @@ -241,6 +247,12 @@ struct AtomicAttributeStatusStruct { status statusCode = 1; } +struct PowerThresholdStruct { + optional int64s powerThreshold = 0; + optional int64s apparentPowerThreshold = 1; + nullable PowerThresholdSourceEnum powerThresholdSource = 2; +} + /** The Descriptor Cluster is meant to replace the support from the Zigbee Device Object (ZDO) for describing a node, its endpoints and clusters. */ cluster Descriptor = 29 { revision 2; diff --git a/examples/ota-requestor-app/ota-requestor-common/ota-requestor-app.matter b/examples/ota-requestor-app/ota-requestor-common/ota-requestor-app.matter index 71b07c00a6402a..1502089caffa04 100644 --- a/examples/ota-requestor-app/ota-requestor-common/ota-requestor-app.matter +++ b/examples/ota-requestor-app/ota-requestor-common/ota-requestor-app.matter @@ -196,6 +196,12 @@ enum PositionTag : enum8 { kColumn = 6; } +enum PowerThresholdSourceEnum : enum8 { + kContract = 0; + kRegulator = 1; + kEquipment = 2; +} + enum RelativePositionTag : enum8 { kUnder = 0; kNextTo = 1; @@ -241,6 +247,12 @@ struct AtomicAttributeStatusStruct { status statusCode = 1; } +struct PowerThresholdStruct { + optional int64s powerThreshold = 0; + optional int64s apparentPowerThreshold = 1; + nullable PowerThresholdSourceEnum powerThresholdSource = 2; +} + /** Attributes and commands for putting a device into Identification mode (e.g. flashing a light). */ cluster Identify = 3 { revision 4; diff --git a/examples/placeholder/linux/apps/app1/config.matter b/examples/placeholder/linux/apps/app1/config.matter index 397ee7ea703dfa..15130095ed0ef6 100644 --- a/examples/placeholder/linux/apps/app1/config.matter +++ b/examples/placeholder/linux/apps/app1/config.matter @@ -196,6 +196,12 @@ enum PositionTag : enum8 { kColumn = 6; } +enum PowerThresholdSourceEnum : enum8 { + kContract = 0; + kRegulator = 1; + kEquipment = 2; +} + enum RelativePositionTag : enum8 { kUnder = 0; kNextTo = 1; @@ -241,6 +247,12 @@ struct AtomicAttributeStatusStruct { status statusCode = 1; } +struct PowerThresholdStruct { + optional int64s powerThreshold = 0; + optional int64s apparentPowerThreshold = 1; + nullable PowerThresholdSourceEnum powerThresholdSource = 2; +} + /** Attributes and commands for putting a device into Identification mode (e.g. flashing a light). */ cluster Identify = 3 { revision 4; diff --git a/examples/placeholder/linux/apps/app2/config.matter b/examples/placeholder/linux/apps/app2/config.matter index 8a873f04cdfce6..0e0100d76e2cc3 100644 --- a/examples/placeholder/linux/apps/app2/config.matter +++ b/examples/placeholder/linux/apps/app2/config.matter @@ -196,6 +196,12 @@ enum PositionTag : enum8 { kColumn = 6; } +enum PowerThresholdSourceEnum : enum8 { + kContract = 0; + kRegulator = 1; + kEquipment = 2; +} + enum RelativePositionTag : enum8 { kUnder = 0; kNextTo = 1; @@ -241,6 +247,12 @@ struct AtomicAttributeStatusStruct { status statusCode = 1; } +struct PowerThresholdStruct { + optional int64s powerThreshold = 0; + optional int64s apparentPowerThreshold = 1; + nullable PowerThresholdSourceEnum powerThresholdSource = 2; +} + /** Attributes and commands for putting a device into Identification mode (e.g. flashing a light). */ cluster Identify = 3 { revision 4; diff --git a/examples/pump-app/pump-common/pump-app.matter b/examples/pump-app/pump-common/pump-app.matter index a01ff7786c9c56..e631ab6d89f1ae 100644 --- a/examples/pump-app/pump-common/pump-app.matter +++ b/examples/pump-app/pump-common/pump-app.matter @@ -196,6 +196,12 @@ enum PositionTag : enum8 { kColumn = 6; } +enum PowerThresholdSourceEnum : enum8 { + kContract = 0; + kRegulator = 1; + kEquipment = 2; +} + enum RelativePositionTag : enum8 { kUnder = 0; kNextTo = 1; @@ -241,6 +247,12 @@ struct AtomicAttributeStatusStruct { status statusCode = 1; } +struct PowerThresholdStruct { + optional int64s powerThreshold = 0; + optional int64s apparentPowerThreshold = 1; + nullable PowerThresholdSourceEnum powerThresholdSource = 2; +} + /** Attributes and commands for putting a device into Identification mode (e.g. flashing a light). */ cluster Identify = 3 { revision 4; diff --git a/examples/pump-app/silabs/data_model/pump-thread-app.matter b/examples/pump-app/silabs/data_model/pump-thread-app.matter index 59894821e5096c..72ef2d6709f685 100644 --- a/examples/pump-app/silabs/data_model/pump-thread-app.matter +++ b/examples/pump-app/silabs/data_model/pump-thread-app.matter @@ -196,6 +196,12 @@ enum PositionTag : enum8 { kColumn = 6; } +enum PowerThresholdSourceEnum : enum8 { + kContract = 0; + kRegulator = 1; + kEquipment = 2; +} + enum RelativePositionTag : enum8 { kUnder = 0; kNextTo = 1; @@ -241,6 +247,12 @@ struct AtomicAttributeStatusStruct { status statusCode = 1; } +struct PowerThresholdStruct { + optional int64s powerThreshold = 0; + optional int64s apparentPowerThreshold = 1; + nullable PowerThresholdSourceEnum powerThresholdSource = 2; +} + /** Attributes and commands for putting a device into Identification mode (e.g. flashing a light). */ cluster Identify = 3 { revision 4; diff --git a/examples/pump-app/silabs/data_model/pump-wifi-app.matter b/examples/pump-app/silabs/data_model/pump-wifi-app.matter index 59894821e5096c..72ef2d6709f685 100644 --- a/examples/pump-app/silabs/data_model/pump-wifi-app.matter +++ b/examples/pump-app/silabs/data_model/pump-wifi-app.matter @@ -196,6 +196,12 @@ enum PositionTag : enum8 { kColumn = 6; } +enum PowerThresholdSourceEnum : enum8 { + kContract = 0; + kRegulator = 1; + kEquipment = 2; +} + enum RelativePositionTag : enum8 { kUnder = 0; kNextTo = 1; @@ -241,6 +247,12 @@ struct AtomicAttributeStatusStruct { status statusCode = 1; } +struct PowerThresholdStruct { + optional int64s powerThreshold = 0; + optional int64s apparentPowerThreshold = 1; + nullable PowerThresholdSourceEnum powerThresholdSource = 2; +} + /** Attributes and commands for putting a device into Identification mode (e.g. flashing a light). */ cluster Identify = 3 { revision 4; diff --git a/examples/pump-controller-app/pump-controller-common/pump-controller-app.matter b/examples/pump-controller-app/pump-controller-common/pump-controller-app.matter index 0749708198d225..5bb5654c1b895b 100644 --- a/examples/pump-controller-app/pump-controller-common/pump-controller-app.matter +++ b/examples/pump-controller-app/pump-controller-common/pump-controller-app.matter @@ -196,6 +196,12 @@ enum PositionTag : enum8 { kColumn = 6; } +enum PowerThresholdSourceEnum : enum8 { + kContract = 0; + kRegulator = 1; + kEquipment = 2; +} + enum RelativePositionTag : enum8 { kUnder = 0; kNextTo = 1; @@ -241,6 +247,12 @@ struct AtomicAttributeStatusStruct { status statusCode = 1; } +struct PowerThresholdStruct { + optional int64s powerThreshold = 0; + optional int64s apparentPowerThreshold = 1; + nullable PowerThresholdSourceEnum powerThresholdSource = 2; +} + /** Attributes and commands for putting a device into Identification mode (e.g. flashing a light). */ cluster Identify = 3 { revision 4; diff --git a/examples/refrigerator-app/refrigerator-common/refrigerator-app.matter b/examples/refrigerator-app/refrigerator-common/refrigerator-app.matter index d39e61808ee832..280389ce8bcb96 100644 --- a/examples/refrigerator-app/refrigerator-common/refrigerator-app.matter +++ b/examples/refrigerator-app/refrigerator-common/refrigerator-app.matter @@ -196,6 +196,12 @@ enum PositionTag : enum8 { kColumn = 6; } +enum PowerThresholdSourceEnum : enum8 { + kContract = 0; + kRegulator = 1; + kEquipment = 2; +} + enum RelativePositionTag : enum8 { kUnder = 0; kNextTo = 1; @@ -241,6 +247,12 @@ struct AtomicAttributeStatusStruct { status statusCode = 1; } +struct PowerThresholdStruct { + optional int64s powerThreshold = 0; + optional int64s apparentPowerThreshold = 1; + nullable PowerThresholdSourceEnum powerThresholdSource = 2; +} + /** The Descriptor Cluster is meant to replace the support from the Zigbee Device Object (ZDO) for describing a node, its endpoints and clusters. */ cluster Descriptor = 29 { revision 2; diff --git a/examples/refrigerator-app/silabs/data_model/refrigerator-thread-app.matter b/examples/refrigerator-app/silabs/data_model/refrigerator-thread-app.matter index f9dcc360151767..84dac7c566de2a 100644 --- a/examples/refrigerator-app/silabs/data_model/refrigerator-thread-app.matter +++ b/examples/refrigerator-app/silabs/data_model/refrigerator-thread-app.matter @@ -196,6 +196,12 @@ enum PositionTag : enum8 { kColumn = 6; } +enum PowerThresholdSourceEnum : enum8 { + kContract = 0; + kRegulator = 1; + kEquipment = 2; +} + enum RelativePositionTag : enum8 { kUnder = 0; kNextTo = 1; @@ -241,6 +247,12 @@ struct AtomicAttributeStatusStruct { status statusCode = 1; } +struct PowerThresholdStruct { + optional int64s powerThreshold = 0; + optional int64s apparentPowerThreshold = 1; + nullable PowerThresholdSourceEnum powerThresholdSource = 2; +} + /** Attributes and commands for putting a device into Identification mode (e.g. flashing a light). */ cluster Identify = 3 { revision 4; diff --git a/examples/refrigerator-app/silabs/data_model/refrigerator-wifi-app.matter b/examples/refrigerator-app/silabs/data_model/refrigerator-wifi-app.matter index 50bd62e49664be..81c4cfa36d28b6 100644 --- a/examples/refrigerator-app/silabs/data_model/refrigerator-wifi-app.matter +++ b/examples/refrigerator-app/silabs/data_model/refrigerator-wifi-app.matter @@ -196,6 +196,12 @@ enum PositionTag : enum8 { kColumn = 6; } +enum PowerThresholdSourceEnum : enum8 { + kContract = 0; + kRegulator = 1; + kEquipment = 2; +} + enum RelativePositionTag : enum8 { kUnder = 0; kNextTo = 1; @@ -241,6 +247,12 @@ struct AtomicAttributeStatusStruct { status statusCode = 1; } +struct PowerThresholdStruct { + optional int64s powerThreshold = 0; + optional int64s apparentPowerThreshold = 1; + nullable PowerThresholdSourceEnum powerThresholdSource = 2; +} + /** Attributes and commands for putting a device into Identification mode (e.g. flashing a light). */ cluster Identify = 3 { revision 4; diff --git a/examples/rvc-app/rvc-common/rvc-app.matter b/examples/rvc-app/rvc-common/rvc-app.matter index 0ce5a1ff3e890b..b776ee40d48879 100644 --- a/examples/rvc-app/rvc-common/rvc-app.matter +++ b/examples/rvc-app/rvc-common/rvc-app.matter @@ -196,6 +196,12 @@ enum PositionTag : enum8 { kColumn = 6; } +enum PowerThresholdSourceEnum : enum8 { + kContract = 0; + kRegulator = 1; + kEquipment = 2; +} + enum RelativePositionTag : enum8 { kUnder = 0; kNextTo = 1; @@ -241,6 +247,12 @@ struct AtomicAttributeStatusStruct { status statusCode = 1; } +struct PowerThresholdStruct { + optional int64s powerThreshold = 0; + optional int64s apparentPowerThreshold = 1; + nullable PowerThresholdSourceEnum powerThresholdSource = 2; +} + /** Attributes and commands for putting a device into Identification mode (e.g. flashing a light). */ cluster Identify = 3 { revision 4; diff --git a/examples/smoke-co-alarm-app/smoke-co-alarm-common/smoke-co-alarm-app.matter b/examples/smoke-co-alarm-app/smoke-co-alarm-common/smoke-co-alarm-app.matter index 48996f43493e0e..08267301f9f0ff 100644 --- a/examples/smoke-co-alarm-app/smoke-co-alarm-common/smoke-co-alarm-app.matter +++ b/examples/smoke-co-alarm-app/smoke-co-alarm-common/smoke-co-alarm-app.matter @@ -196,6 +196,12 @@ enum PositionTag : enum8 { kColumn = 6; } +enum PowerThresholdSourceEnum : enum8 { + kContract = 0; + kRegulator = 1; + kEquipment = 2; +} + enum RelativePositionTag : enum8 { kUnder = 0; kNextTo = 1; @@ -241,6 +247,12 @@ struct AtomicAttributeStatusStruct { status statusCode = 1; } +struct PowerThresholdStruct { + optional int64s powerThreshold = 0; + optional int64s apparentPowerThreshold = 1; + nullable PowerThresholdSourceEnum powerThresholdSource = 2; +} + /** Attributes and commands for putting a device into Identification mode (e.g. flashing a light). */ cluster Identify = 3 { revision 4; diff --git a/examples/temperature-measurement-app/temperature-measurement-common/temperature-measurement.matter b/examples/temperature-measurement-app/temperature-measurement-common/temperature-measurement.matter index 68db11fb600da7..5da0e182a366a3 100644 --- a/examples/temperature-measurement-app/temperature-measurement-common/temperature-measurement.matter +++ b/examples/temperature-measurement-app/temperature-measurement-common/temperature-measurement.matter @@ -196,6 +196,12 @@ enum PositionTag : enum8 { kColumn = 6; } +enum PowerThresholdSourceEnum : enum8 { + kContract = 0; + kRegulator = 1; + kEquipment = 2; +} + enum RelativePositionTag : enum8 { kUnder = 0; kNextTo = 1; @@ -241,6 +247,12 @@ struct AtomicAttributeStatusStruct { status statusCode = 1; } +struct PowerThresholdStruct { + optional int64s powerThreshold = 0; + optional int64s apparentPowerThreshold = 1; + nullable PowerThresholdSourceEnum powerThresholdSource = 2; +} + /** The Descriptor Cluster is meant to replace the support from the Zigbee Device Object (ZDO) for describing a node, its endpoints and clusters. */ cluster Descriptor = 29 { revision 2; diff --git a/examples/terms-and-conditions-app/terms-and-conditions-common/terms-and-conditions-app.matter b/examples/terms-and-conditions-app/terms-and-conditions-common/terms-and-conditions-app.matter index 841f4b129d4470..d3183ffb8c36a3 100644 --- a/examples/terms-and-conditions-app/terms-and-conditions-common/terms-and-conditions-app.matter +++ b/examples/terms-and-conditions-app/terms-and-conditions-common/terms-and-conditions-app.matter @@ -196,6 +196,12 @@ enum PositionTag : enum8 { kColumn = 6; } +enum PowerThresholdSourceEnum : enum8 { + kContract = 0; + kRegulator = 1; + kEquipment = 2; +} + enum RelativePositionTag : enum8 { kUnder = 0; kNextTo = 1; @@ -241,6 +247,12 @@ struct AtomicAttributeStatusStruct { status statusCode = 1; } +struct PowerThresholdStruct { + optional int64s powerThreshold = 0; + optional int64s apparentPowerThreshold = 1; + nullable PowerThresholdSourceEnum powerThresholdSource = 2; +} + /** Attributes and commands for putting a device into Identification mode (e.g. flashing a light). */ cluster Identify = 3 { revision 4; diff --git a/examples/thermostat/nxp/zap/thermostat_matter_br.matter b/examples/thermostat/nxp/zap/thermostat_matter_br.matter index 49f6f1bb4e74f0..276bdf270f6182 100644 --- a/examples/thermostat/nxp/zap/thermostat_matter_br.matter +++ b/examples/thermostat/nxp/zap/thermostat_matter_br.matter @@ -196,6 +196,12 @@ enum PositionTag : enum8 { kColumn = 6; } +enum PowerThresholdSourceEnum : enum8 { + kContract = 0; + kRegulator = 1; + kEquipment = 2; +} + enum RelativePositionTag : enum8 { kUnder = 0; kNextTo = 1; @@ -241,6 +247,12 @@ struct AtomicAttributeStatusStruct { status statusCode = 1; } +struct PowerThresholdStruct { + optional int64s powerThreshold = 0; + optional int64s apparentPowerThreshold = 1; + nullable PowerThresholdSourceEnum powerThresholdSource = 2; +} + /** Attributes and commands for putting a device into Identification mode (e.g. flashing a light). */ cluster Identify = 3 { revision 4; diff --git a/examples/thermostat/nxp/zap/thermostat_matter_thread.matter b/examples/thermostat/nxp/zap/thermostat_matter_thread.matter index 8f74a3ba573b05..b6af25e8512773 100644 --- a/examples/thermostat/nxp/zap/thermostat_matter_thread.matter +++ b/examples/thermostat/nxp/zap/thermostat_matter_thread.matter @@ -196,6 +196,12 @@ enum PositionTag : enum8 { kColumn = 6; } +enum PowerThresholdSourceEnum : enum8 { + kContract = 0; + kRegulator = 1; + kEquipment = 2; +} + enum RelativePositionTag : enum8 { kUnder = 0; kNextTo = 1; @@ -241,6 +247,12 @@ struct AtomicAttributeStatusStruct { status statusCode = 1; } +struct PowerThresholdStruct { + optional int64s powerThreshold = 0; + optional int64s apparentPowerThreshold = 1; + nullable PowerThresholdSourceEnum powerThresholdSource = 2; +} + /** Attributes and commands for putting a device into Identification mode (e.g. flashing a light). */ cluster Identify = 3 { revision 4; diff --git a/examples/thermostat/nxp/zap/thermostat_matter_wifi.matter b/examples/thermostat/nxp/zap/thermostat_matter_wifi.matter index 6230c430f8989e..7a940e2917facf 100644 --- a/examples/thermostat/nxp/zap/thermostat_matter_wifi.matter +++ b/examples/thermostat/nxp/zap/thermostat_matter_wifi.matter @@ -196,6 +196,12 @@ enum PositionTag : enum8 { kColumn = 6; } +enum PowerThresholdSourceEnum : enum8 { + kContract = 0; + kRegulator = 1; + kEquipment = 2; +} + enum RelativePositionTag : enum8 { kUnder = 0; kNextTo = 1; @@ -241,6 +247,12 @@ struct AtomicAttributeStatusStruct { status statusCode = 1; } +struct PowerThresholdStruct { + optional int64s powerThreshold = 0; + optional int64s apparentPowerThreshold = 1; + nullable PowerThresholdSourceEnum powerThresholdSource = 2; +} + /** Attributes and commands for putting a device into Identification mode (e.g. flashing a light). */ cluster Identify = 3 { revision 4; diff --git a/examples/thermostat/qpg/zap/thermostaticRadiatorValve.matter b/examples/thermostat/qpg/zap/thermostaticRadiatorValve.matter index 1c18b43f391b8b..3d809e10b78386 100644 --- a/examples/thermostat/qpg/zap/thermostaticRadiatorValve.matter +++ b/examples/thermostat/qpg/zap/thermostaticRadiatorValve.matter @@ -196,6 +196,12 @@ enum PositionTag : enum8 { kColumn = 6; } +enum PowerThresholdSourceEnum : enum8 { + kContract = 0; + kRegulator = 1; + kEquipment = 2; +} + enum RelativePositionTag : enum8 { kUnder = 0; kNextTo = 1; @@ -241,6 +247,12 @@ struct AtomicAttributeStatusStruct { status statusCode = 1; } +struct PowerThresholdStruct { + optional int64s powerThreshold = 0; + optional int64s apparentPowerThreshold = 1; + nullable PowerThresholdSourceEnum powerThresholdSource = 2; +} + /** Attributes and commands for putting a device into Identification mode (e.g. flashing a light). */ cluster Identify = 3 { revision 4; diff --git a/examples/thermostat/thermostat-common/thermostat.matter b/examples/thermostat/thermostat-common/thermostat.matter index 92599858019d17..7d09ada914eb86 100644 --- a/examples/thermostat/thermostat-common/thermostat.matter +++ b/examples/thermostat/thermostat-common/thermostat.matter @@ -196,6 +196,12 @@ enum PositionTag : enum8 { kColumn = 6; } +enum PowerThresholdSourceEnum : enum8 { + kContract = 0; + kRegulator = 1; + kEquipment = 2; +} + enum RelativePositionTag : enum8 { kUnder = 0; kNextTo = 1; @@ -241,6 +247,12 @@ struct AtomicAttributeStatusStruct { status statusCode = 1; } +struct PowerThresholdStruct { + optional int64s powerThreshold = 0; + optional int64s apparentPowerThreshold = 1; + nullable PowerThresholdSourceEnum powerThresholdSource = 2; +} + /** Attributes and commands for putting a device into Identification mode (e.g. flashing a light). */ cluster Identify = 3 { revision 4; diff --git a/examples/thread-br-app/thread-br-common/thread-br-app.matter b/examples/thread-br-app/thread-br-common/thread-br-app.matter index 035c36d52b2dab..ba5ab9f25813f0 100644 --- a/examples/thread-br-app/thread-br-common/thread-br-app.matter +++ b/examples/thread-br-app/thread-br-common/thread-br-app.matter @@ -196,6 +196,12 @@ enum PositionTag : enum8 { kColumn = 6; } +enum PowerThresholdSourceEnum : enum8 { + kContract = 0; + kRegulator = 1; + kEquipment = 2; +} + enum RelativePositionTag : enum8 { kUnder = 0; kNextTo = 1; @@ -241,6 +247,12 @@ struct AtomicAttributeStatusStruct { status statusCode = 1; } +struct PowerThresholdStruct { + optional int64s powerThreshold = 0; + optional int64s apparentPowerThreshold = 1; + nullable PowerThresholdSourceEnum powerThresholdSource = 2; +} + /** The Descriptor Cluster is meant to replace the support from the Zigbee Device Object (ZDO) for describing a node, its endpoints and clusters. */ cluster Descriptor = 29 { revision 2; diff --git a/examples/tv-app/tv-common/tv-app.matter b/examples/tv-app/tv-common/tv-app.matter index eaccc1dd6f185b..3fe487868c6465 100644 --- a/examples/tv-app/tv-common/tv-app.matter +++ b/examples/tv-app/tv-common/tv-app.matter @@ -196,6 +196,12 @@ enum PositionTag : enum8 { kColumn = 6; } +enum PowerThresholdSourceEnum : enum8 { + kContract = 0; + kRegulator = 1; + kEquipment = 2; +} + enum RelativePositionTag : enum8 { kUnder = 0; kNextTo = 1; @@ -241,6 +247,12 @@ struct AtomicAttributeStatusStruct { status statusCode = 1; } +struct PowerThresholdStruct { + optional int64s powerThreshold = 0; + optional int64s apparentPowerThreshold = 1; + nullable PowerThresholdSourceEnum powerThresholdSource = 2; +} + /** Attributes and commands for switching devices between 'On' and 'Off' states. */ cluster OnOff = 6 { revision 6; diff --git a/examples/tv-casting-app/tv-casting-common/tv-casting-app.matter b/examples/tv-casting-app/tv-casting-common/tv-casting-app.matter index 9ad6cd0273f8fb..a4ee3ff867c68d 100644 --- a/examples/tv-casting-app/tv-casting-common/tv-casting-app.matter +++ b/examples/tv-casting-app/tv-casting-common/tv-casting-app.matter @@ -196,6 +196,12 @@ enum PositionTag : enum8 { kColumn = 6; } +enum PowerThresholdSourceEnum : enum8 { + kContract = 0; + kRegulator = 1; + kEquipment = 2; +} + enum RelativePositionTag : enum8 { kUnder = 0; kNextTo = 1; @@ -241,6 +247,12 @@ struct AtomicAttributeStatusStruct { status statusCode = 1; } +struct PowerThresholdStruct { + optional int64s powerThreshold = 0; + optional int64s apparentPowerThreshold = 1; + nullable PowerThresholdSourceEnum powerThresholdSource = 2; +} + /** Attributes and commands for putting a device into Identification mode (e.g. flashing a light). */ cluster Identify = 3 { revision 4; diff --git a/examples/virtual-device-app/virtual-device-common/virtual-device-app.matter b/examples/virtual-device-app/virtual-device-common/virtual-device-app.matter index 9f4f1c98d69473..4c0ef31fcce3c8 100644 --- a/examples/virtual-device-app/virtual-device-common/virtual-device-app.matter +++ b/examples/virtual-device-app/virtual-device-common/virtual-device-app.matter @@ -196,6 +196,12 @@ enum PositionTag : enum8 { kColumn = 6; } +enum PowerThresholdSourceEnum : enum8 { + kContract = 0; + kRegulator = 1; + kEquipment = 2; +} + enum RelativePositionTag : enum8 { kUnder = 0; kNextTo = 1; @@ -241,6 +247,12 @@ struct AtomicAttributeStatusStruct { status statusCode = 1; } +struct PowerThresholdStruct { + optional int64s powerThreshold = 0; + optional int64s apparentPowerThreshold = 1; + nullable PowerThresholdSourceEnum powerThresholdSource = 2; +} + /** Attributes and commands for putting a device into Identification mode (e.g. flashing a light). */ cluster Identify = 3 { revision 4; diff --git a/examples/water-leak-detector-app/water-leak-detector-common/water-leak-detector-app.matter b/examples/water-leak-detector-app/water-leak-detector-common/water-leak-detector-app.matter index e36fe727167004..d9614d49aa5cad 100644 --- a/examples/water-leak-detector-app/water-leak-detector-common/water-leak-detector-app.matter +++ b/examples/water-leak-detector-app/water-leak-detector-common/water-leak-detector-app.matter @@ -196,6 +196,12 @@ enum PositionTag : enum8 { kColumn = 6; } +enum PowerThresholdSourceEnum : enum8 { + kContract = 0; + kRegulator = 1; + kEquipment = 2; +} + enum RelativePositionTag : enum8 { kUnder = 0; kNextTo = 1; @@ -241,6 +247,12 @@ struct AtomicAttributeStatusStruct { status statusCode = 1; } +struct PowerThresholdStruct { + optional int64s powerThreshold = 0; + optional int64s apparentPowerThreshold = 1; + nullable PowerThresholdSourceEnum powerThresholdSource = 2; +} + /** Attributes and commands for putting a device into Identification mode (e.g. flashing a light). */ cluster Identify = 3 { revision 4; diff --git a/examples/window-app/common/window-app.matter b/examples/window-app/common/window-app.matter index 74da57387d723c..31d5a2f77d30de 100644 --- a/examples/window-app/common/window-app.matter +++ b/examples/window-app/common/window-app.matter @@ -196,6 +196,12 @@ enum PositionTag : enum8 { kColumn = 6; } +enum PowerThresholdSourceEnum : enum8 { + kContract = 0; + kRegulator = 1; + kEquipment = 2; +} + enum RelativePositionTag : enum8 { kUnder = 0; kNextTo = 1; @@ -241,6 +247,12 @@ struct AtomicAttributeStatusStruct { status statusCode = 1; } +struct PowerThresholdStruct { + optional int64s powerThreshold = 0; + optional int64s apparentPowerThreshold = 1; + nullable PowerThresholdSourceEnum powerThresholdSource = 2; +} + /** Attributes and commands for putting a device into Identification mode (e.g. flashing a light). */ cluster Identify = 3 { revision 4; diff --git a/src/app/zap-templates/zcl/data-model/chip/meter-identification-cluster.xml b/src/app/zap-templates/zcl/data-model/chip/meter-identification-cluster.xml index e732cf5e73bc8f..622851da9f9177 100644 --- a/src/app/zap-templates/zcl/data-model/chip/meter-identification-cluster.xml +++ b/src/app/zap-templates/zcl/data-model/chip/meter-identification-cluster.xml @@ -30,14 +30,12 @@ Git: </enum> <enum name="PowerThresholdSourceEnum" type="enum8"> - <cluster code="0x0B06"/> <item name="Contract" value="0x00"/> <item name="Regulator" value="0x01"/> <item name="Equipment" value="0x02"/> </enum> <struct name="PowerThresholdStruct" apiMaturity="provisional"> - <cluster code="0x0B06"/> <item fieldId="0" name="PowerThreshold" type="int64s" optional="true"/> <item fieldId="1" name="ApparentPowerThreshold" type="int64s" optional="true"/> <item fieldId="2" name="PowerThresholdSource" type="PowerThresholdSourceEnum" isNullable="true" min="0x00" max="0x02"/> diff --git a/src/controller/data_model/controller-clusters.matter b/src/controller/data_model/controller-clusters.matter index 772cd95b90b5ca..643a9bd87ace93 100644 --- a/src/controller/data_model/controller-clusters.matter +++ b/src/controller/data_model/controller-clusters.matter @@ -196,6 +196,12 @@ enum PositionTag : enum8 { kColumn = 6; } +enum PowerThresholdSourceEnum : enum8 { + kContract = 0; + kRegulator = 1; + kEquipment = 2; +} + enum RelativePositionTag : enum8 { kUnder = 0; kNextTo = 1; @@ -241,6 +247,12 @@ struct AtomicAttributeStatusStruct { status statusCode = 1; } +struct PowerThresholdStruct { + optional int64s powerThreshold = 0; + optional int64s apparentPowerThreshold = 1; + nullable PowerThresholdSourceEnum powerThresholdSource = 2; +} + /** Attributes and commands for putting a device into Identification mode (e.g. flashing a light). */ cluster Identify = 3 { revision 4; @@ -10761,22 +10773,10 @@ provisional cluster MeterIdentification = 2822 { kGeneric = 2; } - enum PowerThresholdSourceEnum : enum8 { - kContract = 0; - kRegulator = 1; - kEquipment = 2; - } - bitmap Feature : bitmap32 { kPowerThreshold = 0x1; } - struct PowerThresholdStruct { - optional int64s powerThreshold = 0; - optional int64s apparentPowerThreshold = 1; - nullable PowerThresholdSourceEnum powerThresholdSource = 2; - } - readonly attribute nullable MeterTypeEnum meterType = 0; readonly attribute nullable char_string<64> pointOfDelivery = 1; readonly attribute nullable char_string<64> meterSerialNumber = 2; diff --git a/src/controller/python/chip/clusters/Objects.py b/src/controller/python/chip/clusters/Objects.py index 7a7bd28b098345..d31774e7bafe2c 100644 --- a/src/controller/python/chip/clusters/Objects.py +++ b/src/controller/python/chip/clusters/Objects.py @@ -393,6 +393,16 @@ class PositionTag(MatterIntEnum): # enum value. This specific value should never be transmitted. kUnknownEnumValue = 7 + class PowerThresholdSourceEnum(MatterIntEnum): + kContract = 0x00 + kRegulator = 0x01 + kEquipment = 0x02 + # All received enum values that are not listed above will be mapped + # to kUnknownEnumValue. This is a helper enum value that should only + # be used by code to process how it handles receiving an unknown + # enum value. This specific value should never be transmitted. + kUnknownEnumValue = 3 + class RelativePositionTag(MatterIntEnum): kUnder = 0x00 kNextTo = 0x01 @@ -477,6 +487,21 @@ def descriptor(cls) -> ClusterObjectDescriptor: attributeID: 'uint' = 0 statusCode: 'uint' = 0 + @dataclass + class PowerThresholdStruct(ClusterObject): + @ChipUtility.classproperty + def descriptor(cls) -> ClusterObjectDescriptor: + return ClusterObjectDescriptor( + Fields=[ + ClusterObjectFieldDescriptor(Label="powerThreshold", Tag=0, Type=typing.Optional[int]), + ClusterObjectFieldDescriptor(Label="apparentPowerThreshold", Tag=1, Type=typing.Optional[int]), + ClusterObjectFieldDescriptor(Label="powerThresholdSource", Tag=2, Type=typing.Union[Nullable, Globals.Enums.PowerThresholdSourceEnum]), + ]) + + powerThreshold: 'typing.Optional[int]' = None + apparentPowerThreshold: 'typing.Optional[int]' = None + powerThresholdSource: 'typing.Union[Nullable, Globals.Enums.PowerThresholdSourceEnum]' = NullValue + @dataclass @@ -49704,7 +49729,7 @@ def descriptor(cls) -> ClusterObjectDescriptor: ClusterObjectFieldDescriptor(Label="pointOfDelivery", Tag=0x00000001, Type=typing.Union[Nullable, str]), ClusterObjectFieldDescriptor(Label="meterSerialNumber", Tag=0x00000002, Type=typing.Union[Nullable, str]), ClusterObjectFieldDescriptor(Label="protocolVersion", Tag=0x00000003, Type=typing.Union[None, Nullable, str]), - ClusterObjectFieldDescriptor(Label="powerThreshold", Tag=0x00000004, Type=typing.Union[None, Nullable, MeterIdentification.Structs.PowerThresholdStruct]), + ClusterObjectFieldDescriptor(Label="powerThreshold", Tag=0x00000004, Type=typing.Union[None, Nullable, Globals.Structs.PowerThresholdStruct]), ClusterObjectFieldDescriptor(Label="generatedCommandList", Tag=0x0000FFF8, Type=typing.List[uint]), ClusterObjectFieldDescriptor(Label="acceptedCommandList", Tag=0x0000FFF9, Type=typing.List[uint]), ClusterObjectFieldDescriptor(Label="attributeList", Tag=0x0000FFFB, Type=typing.List[uint]), @@ -49716,7 +49741,7 @@ def descriptor(cls) -> ClusterObjectDescriptor: pointOfDelivery: typing.Union[Nullable, str] = NullValue meterSerialNumber: typing.Union[Nullable, str] = NullValue protocolVersion: typing.Union[None, Nullable, str] = None - powerThreshold: typing.Union[None, Nullable, MeterIdentification.Structs.PowerThresholdStruct] = None + powerThreshold: typing.Union[None, Nullable, Globals.Structs.PowerThresholdStruct] = None generatedCommandList: typing.List[uint] = field(default_factory=lambda: []) acceptedCommandList: typing.List[uint] = field(default_factory=lambda: []) attributeList: typing.List[uint] = field(default_factory=lambda: []) @@ -49734,36 +49759,10 @@ class MeterTypeEnum(MatterIntEnum): # enum value. This specific value should never be transmitted. kUnknownEnumValue = 3 - class PowerThresholdSourceEnum(MatterIntEnum): - kContract = 0x00 - kRegulator = 0x01 - kEquipment = 0x02 - # All received enum values that are not listed above will be mapped - # to kUnknownEnumValue. This is a helper enum value that should only - # be used by code to process how it handles receiving an unknown - # enum value. This specific value should never be transmitted. - kUnknownEnumValue = 3 - class Bitmaps: class Feature(IntFlag): kPowerThreshold = 0x1 - class Structs: - @dataclass - class PowerThresholdStruct(ClusterObject): - @ChipUtility.classproperty - def descriptor(cls) -> ClusterObjectDescriptor: - return ClusterObjectDescriptor( - Fields=[ - ClusterObjectFieldDescriptor(Label="powerThreshold", Tag=0, Type=typing.Optional[int]), - ClusterObjectFieldDescriptor(Label="apparentPowerThreshold", Tag=1, Type=typing.Optional[int]), - ClusterObjectFieldDescriptor(Label="powerThresholdSource", Tag=2, Type=typing.Union[Nullable, MeterIdentification.Enums.PowerThresholdSourceEnum]), - ]) - - powerThreshold: 'typing.Optional[int]' = None - apparentPowerThreshold: 'typing.Optional[int]' = None - powerThresholdSource: 'typing.Union[Nullable, MeterIdentification.Enums.PowerThresholdSourceEnum]' = NullValue - class Attributes: @dataclass class MeterType(ClusterAttributeDescriptor): @@ -49841,9 +49840,9 @@ def attribute_id(cls) -> int: @ChipUtility.classproperty def attribute_type(cls) -> ClusterObjectFieldDescriptor: - return ClusterObjectFieldDescriptor(Type=typing.Union[None, Nullable, MeterIdentification.Structs.PowerThresholdStruct]) + return ClusterObjectFieldDescriptor(Type=typing.Union[None, Nullable, Globals.Structs.PowerThresholdStruct]) - value: typing.Union[None, Nullable, MeterIdentification.Structs.PowerThresholdStruct] = None + value: typing.Union[None, Nullable, Globals.Structs.PowerThresholdStruct] = None @dataclass class GeneratedCommandList(ClusterAttributeDescriptor): diff --git a/src/darwin/Framework/CHIP/zap-generated/MTRAttributeTLVValueDecoder.mm b/src/darwin/Framework/CHIP/zap-generated/MTRAttributeTLVValueDecoder.mm index c6052b76b5e2c4..5e87e663580425 100644 --- a/src/darwin/Framework/CHIP/zap-generated/MTRAttributeTLVValueDecoder.mm +++ b/src/darwin/Framework/CHIP/zap-generated/MTRAttributeTLVValueDecoder.mm @@ -18566,11 +18566,11 @@ static id _Nullable DecodeAttributeValueForMeterIdentificationCluster(AttributeI if (*aError != CHIP_NO_ERROR) { return nil; } - MTRMeterIdentificationClusterPowerThresholdStruct * _Nullable value; + MTRDataTypePowerThresholdStruct * _Nullable value; if (cppValue.IsNull()) { value = nil; } else { - value = [MTRMeterIdentificationClusterPowerThresholdStruct new]; + value = [MTRDataTypePowerThresholdStruct new]; if (cppValue.Value().powerThreshold.HasValue()) { value.powerThreshold = [NSNumber numberWithLongLong:cppValue.Value().powerThreshold.Value()]; } else { diff --git a/src/darwin/Framework/CHIP/zap-generated/MTRBaseClusters.h b/src/darwin/Framework/CHIP/zap-generated/MTRBaseClusters.h index 9558ede5324bce..8beb87ad904000 100644 --- a/src/darwin/Framework/CHIP/zap-generated/MTRBaseClusters.h +++ b/src/darwin/Framework/CHIP/zap-generated/MTRBaseClusters.h @@ -15551,11 +15551,11 @@ MTR_PROVISIONALLY_AVAILABLE reportHandler:(void (^)(NSString * _Nullable value, NSError * _Nullable error))reportHandler MTR_PROVISIONALLY_AVAILABLE; + (void)readAttributeProtocolVersionWithClusterStateCache:(MTRClusterStateCacheContainer *)clusterStateCacheContainer endpoint:(NSNumber *)endpoint queue:(dispatch_queue_t)queue completion:(void (^)(NSString * _Nullable value, NSError * _Nullable error))completion MTR_PROVISIONALLY_AVAILABLE; -- (void)readAttributePowerThresholdWithCompletion:(void (^)(MTRMeterIdentificationClusterPowerThresholdStruct * _Nullable value, NSError * _Nullable error))completion MTR_PROVISIONALLY_AVAILABLE; +- (void)readAttributePowerThresholdWithCompletion:(void (^)(MTRDataTypePowerThresholdStruct * _Nullable value, NSError * _Nullable error))completion MTR_PROVISIONALLY_AVAILABLE; - (void)subscribeAttributePowerThresholdWithParams:(MTRSubscribeParams *)params subscriptionEstablished:(MTRSubscriptionEstablishedHandler _Nullable)subscriptionEstablished - reportHandler:(void (^)(MTRMeterIdentificationClusterPowerThresholdStruct * _Nullable value, NSError * _Nullable error))reportHandler MTR_PROVISIONALLY_AVAILABLE; -+ (void)readAttributePowerThresholdWithClusterStateCache:(MTRClusterStateCacheContainer *)clusterStateCacheContainer endpoint:(NSNumber *)endpoint queue:(dispatch_queue_t)queue completion:(void (^)(MTRMeterIdentificationClusterPowerThresholdStruct * _Nullable value, NSError * _Nullable error))completion MTR_PROVISIONALLY_AVAILABLE; + reportHandler:(void (^)(MTRDataTypePowerThresholdStruct * _Nullable value, NSError * _Nullable error))reportHandler MTR_PROVISIONALLY_AVAILABLE; ++ (void)readAttributePowerThresholdWithClusterStateCache:(MTRClusterStateCacheContainer *)clusterStateCacheContainer endpoint:(NSNumber *)endpoint queue:(dispatch_queue_t)queue completion:(void (^)(MTRDataTypePowerThresholdStruct * _Nullable value, NSError * _Nullable error))completion MTR_PROVISIONALLY_AVAILABLE; - (void)readAttributeGeneratedCommandListWithCompletion:(void (^)(NSArray * _Nullable value, NSError * _Nullable error))completion MTR_PROVISIONALLY_AVAILABLE; - (void)subscribeAttributeGeneratedCommandListWithParams:(MTRSubscribeParams *)params @@ -16870,6 +16870,12 @@ typedef NS_ENUM(uint8_t, MTRDataTypePositionTag) { MTRDataTypePositionTagColumn MTR_AVAILABLE(ios(18.4), macos(15.4), watchos(11.4), tvos(18.4)) = 0x06, } MTR_AVAILABLE(ios(18.4), macos(15.4), watchos(11.4), tvos(18.4)); +typedef NS_ENUM(uint8_t, MTRDataTypePowerThresholdSourceEnum) { + MTRDataTypePowerThresholdSourceEnumContract MTR_PROVISIONALLY_AVAILABLE = 0x00, + MTRDataTypePowerThresholdSourceEnumRegulator MTR_PROVISIONALLY_AVAILABLE = 0x01, + MTRDataTypePowerThresholdSourceEnumEquipment MTR_PROVISIONALLY_AVAILABLE = 0x02, +} MTR_PROVISIONALLY_AVAILABLE; + typedef NS_ENUM(uint8_t, MTRDataTypeRelativePositionTag) { MTRDataTypeRelativePositionTagUnder MTR_AVAILABLE(ios(18.4), macos(15.4), watchos(11.4), tvos(18.4)) = 0x00, MTRDataTypeRelativePositionTagNextTo MTR_AVAILABLE(ios(18.4), macos(15.4), watchos(11.4), tvos(18.4)) = 0x01, @@ -20986,12 +20992,6 @@ typedef NS_ENUM(uint8_t, MTRMeterIdentificationMeterType) { MTRMeterIdentificationMeterTypeGeneric MTR_PROVISIONALLY_AVAILABLE = 0x02, } MTR_PROVISIONALLY_AVAILABLE; -typedef NS_ENUM(uint8_t, MTRMeterIdentificationPowerThresholdSource) { - MTRMeterIdentificationPowerThresholdSourceContract MTR_PROVISIONALLY_AVAILABLE = 0x00, - MTRMeterIdentificationPowerThresholdSourceRegulator MTR_PROVISIONALLY_AVAILABLE = 0x01, - MTRMeterIdentificationPowerThresholdSourceEquipment MTR_PROVISIONALLY_AVAILABLE = 0x02, -} MTR_PROVISIONALLY_AVAILABLE; - typedef NS_OPTIONS(uint32_t, MTRMeterIdentificationFeature) { MTRMeterIdentificationFeaturePowerThreshold MTR_PROVISIONALLY_AVAILABLE = 0x1, } MTR_PROVISIONALLY_AVAILABLE; diff --git a/src/darwin/Framework/CHIP/zap-generated/MTRBaseClusters.mm b/src/darwin/Framework/CHIP/zap-generated/MTRBaseClusters.mm index 075be79034c5c1..0cf05b825bcfdd 100644 --- a/src/darwin/Framework/CHIP/zap-generated/MTRBaseClusters.mm +++ b/src/darwin/Framework/CHIP/zap-generated/MTRBaseClusters.mm @@ -104372,7 +104372,7 @@ + (void)readAttributeProtocolVersionWithClusterStateCache:(MTRClusterStateCacheC completion:completion]; } -- (void)readAttributePowerThresholdWithCompletion:(void (^)(MTRMeterIdentificationClusterPowerThresholdStruct * _Nullable value, NSError * _Nullable error))completion +- (void)readAttributePowerThresholdWithCompletion:(void (^)(MTRDataTypePowerThresholdStruct * _Nullable value, NSError * _Nullable error))completion { using TypeInfo = MeterIdentification::Attributes::PowerThreshold::TypeInfo; [self.device _readKnownAttributeWithEndpointID:self.endpointID @@ -104385,7 +104385,7 @@ - (void)readAttributePowerThresholdWithCompletion:(void (^)(MTRMeterIdentificati - (void)subscribeAttributePowerThresholdWithParams:(MTRSubscribeParams * _Nonnull)params subscriptionEstablished:(MTRSubscriptionEstablishedHandler _Nullable)subscriptionEstablished - reportHandler:(void (^)(MTRMeterIdentificationClusterPowerThresholdStruct * _Nullable value, NSError * _Nullable error))reportHandler + reportHandler:(void (^)(MTRDataTypePowerThresholdStruct * _Nullable value, NSError * _Nullable error))reportHandler { using TypeInfo = MeterIdentification::Attributes::PowerThreshold::TypeInfo; [self.device _subscribeToKnownAttributeWithEndpointID:self.endpointID @@ -104397,7 +104397,7 @@ - (void)subscribeAttributePowerThresholdWithParams:(MTRSubscribeParams * _Nonnul subscriptionEstablished:subscriptionEstablished]; } -+ (void)readAttributePowerThresholdWithClusterStateCache:(MTRClusterStateCacheContainer *)clusterStateCacheContainer endpoint:(NSNumber *)endpoint queue:(dispatch_queue_t)queue completion:(void (^)(MTRMeterIdentificationClusterPowerThresholdStruct * _Nullable value, NSError * _Nullable error))completion ++ (void)readAttributePowerThresholdWithClusterStateCache:(MTRClusterStateCacheContainer *)clusterStateCacheContainer endpoint:(NSNumber *)endpoint queue:(dispatch_queue_t)queue completion:(void (^)(MTRDataTypePowerThresholdStruct * _Nullable value, NSError * _Nullable error))completion { using TypeInfo = MeterIdentification::Attributes::PowerThreshold::TypeInfo; [clusterStateCacheContainer diff --git a/src/darwin/Framework/CHIP/zap-generated/MTRStructsObjc.h b/src/darwin/Framework/CHIP/zap-generated/MTRStructsObjc.h index 37f771e918f8af..43fd2aed4ca876 100644 --- a/src/darwin/Framework/CHIP/zap-generated/MTRStructsObjc.h +++ b/src/darwin/Framework/CHIP/zap-generated/MTRStructsObjc.h @@ -39,6 +39,13 @@ MTR_AVAILABLE(ios(18.4), macos(15.4), watchos(11.4), tvos(18.4)) @property (nonatomic, copy) NSNumber * _Nonnull statusCode MTR_AVAILABLE(ios(18.4), macos(15.4), watchos(11.4), tvos(18.4)); @end +MTR_PROVISIONALLY_AVAILABLE +@interface MTRDataTypePowerThresholdStruct : NSObject <NSCopying> +@property (nonatomic, copy) NSNumber * _Nullable powerThreshold MTR_PROVISIONALLY_AVAILABLE; +@property (nonatomic, copy) NSNumber * _Nullable apparentPowerThreshold MTR_PROVISIONALLY_AVAILABLE; +@property (nonatomic, copy) NSNumber * _Nullable powerThresholdSource MTR_PROVISIONALLY_AVAILABLE; +@end + MTR_AVAILABLE(ios(16.2), macos(13.1), watchos(9.2), tvos(16.2)) @interface MTRDescriptorClusterDeviceTypeStruct : NSObject <NSCopying> @property (nonatomic, copy) NSNumber * _Nonnull deviceType MTR_AVAILABLE(ios(16.4), macos(13.3), watchos(9.4), tvos(16.4)); @@ -2463,13 +2470,6 @@ MTR_PROVISIONALLY_AVAILABLE @property (nonatomic, copy) NSNumber * _Nonnull status MTR_PROVISIONALLY_AVAILABLE; @end -MTR_PROVISIONALLY_AVAILABLE -@interface MTRMeterIdentificationClusterPowerThresholdStruct : NSObject <NSCopying> -@property (nonatomic, copy) NSNumber * _Nullable powerThreshold MTR_PROVISIONALLY_AVAILABLE; -@property (nonatomic, copy) NSNumber * _Nullable apparentPowerThreshold MTR_PROVISIONALLY_AVAILABLE; -@property (nonatomic, copy) NSNumber * _Nullable powerThresholdSource MTR_PROVISIONALLY_AVAILABLE; -@end - MTR_AVAILABLE(ios(16.4), macos(13.3), watchos(9.4), tvos(16.4)) @interface MTRUnitTestingClusterSimpleStruct : NSObject <NSCopying> @property (nonatomic, copy) NSNumber * _Nonnull a MTR_AVAILABLE(ios(16.4), macos(13.3), watchos(9.4), tvos(16.4)); diff --git a/src/darwin/Framework/CHIP/zap-generated/MTRStructsObjc.mm b/src/darwin/Framework/CHIP/zap-generated/MTRStructsObjc.mm index 9bde226458b4d6..6c10a7fb93a808 100644 --- a/src/darwin/Framework/CHIP/zap-generated/MTRStructsObjc.mm +++ b/src/darwin/Framework/CHIP/zap-generated/MTRStructsObjc.mm @@ -115,6 +115,39 @@ - (NSString *)description @end +@implementation MTRDataTypePowerThresholdStruct +- (instancetype)init +{ + if (self = [super init]) { + + _powerThreshold = nil; + + _apparentPowerThreshold = nil; + + _powerThresholdSource = nil; + } + return self; +} + +- (id)copyWithZone:(NSZone * _Nullable)zone +{ + auto other = [[MTRDataTypePowerThresholdStruct alloc] init]; + + other.powerThreshold = self.powerThreshold; + other.apparentPowerThreshold = self.apparentPowerThreshold; + other.powerThresholdSource = self.powerThresholdSource; + + return other; +} + +- (NSString *)description +{ + NSString * descriptionString = [NSString stringWithFormat:@"<%@: powerThreshold:%@; apparentPowerThreshold:%@; powerThresholdSource:%@; >", NSStringFromClass([self class]), _powerThreshold, _apparentPowerThreshold, _powerThresholdSource]; + return descriptionString; +} + +@end + @implementation MTRDescriptorClusterDeviceTypeStruct - (instancetype)init { @@ -10310,39 +10343,6 @@ - (NSString *)description @end -@implementation MTRMeterIdentificationClusterPowerThresholdStruct -- (instancetype)init -{ - if (self = [super init]) { - - _powerThreshold = nil; - - _apparentPowerThreshold = nil; - - _powerThresholdSource = nil; - } - return self; -} - -- (id)copyWithZone:(NSZone * _Nullable)zone -{ - auto other = [[MTRMeterIdentificationClusterPowerThresholdStruct alloc] init]; - - other.powerThreshold = self.powerThreshold; - other.apparentPowerThreshold = self.apparentPowerThreshold; - other.powerThresholdSource = self.powerThresholdSource; - - return other; -} - -- (NSString *)description -{ - NSString * descriptionString = [NSString stringWithFormat:@"<%@: powerThreshold:%@; apparentPowerThreshold:%@; powerThresholdSource:%@; >", NSStringFromClass([self class]), _powerThreshold, _apparentPowerThreshold, _powerThresholdSource]; - return descriptionString; -} - -@end - @implementation MTRUnitTestingClusterSimpleStruct - (instancetype)init { diff --git a/zzz_generated/app-common/app-common/zap-generated/cluster-enums-check.h b/zzz_generated/app-common/app-common/zap-generated/cluster-enums-check.h index 709e9f0a02f937..f3efb273552c23 100644 --- a/zzz_generated/app-common/app-common/zap-generated/cluster-enums-check.h +++ b/zzz_generated/app-common/app-common/zap-generated/cluster-enums-check.h @@ -355,6 +355,20 @@ static auto __attribute__((unused)) EnsureKnownEnumValue(Globals::PositionTag va } } +static auto __attribute__((unused)) EnsureKnownEnumValue(Globals::PowerThresholdSourceEnum val) +{ + using EnumType = Globals::PowerThresholdSourceEnum; + switch (val) + { + case EnumType::kContract: + case EnumType::kRegulator: + case EnumType::kEquipment: + return val; + default: + return EnumType::kUnknownEnumValue; + } +} + static auto __attribute__((unused)) EnsureKnownEnumValue(detail::ProductIdentifierTypeEnum val) { using EnumType = detail::ProductIdentifierTypeEnum; @@ -3954,19 +3968,6 @@ static auto __attribute__((unused)) EnsureKnownEnumValue(MeterIdentification::Me return EnumType::kUnknownEnumValue; } } -static auto __attribute__((unused)) EnsureKnownEnumValue(MeterIdentification::PowerThresholdSourceEnum val) -{ - using EnumType = MeterIdentification::PowerThresholdSourceEnum; - switch (val) - { - case EnumType::kContract: - case EnumType::kRegulator: - case EnumType::kEquipment: - return val; - default: - return EnumType::kUnknownEnumValue; - } -} static auto __attribute__((unused)) EnsureKnownEnumValue(UnitTesting::SimpleEnum val) { diff --git a/zzz_generated/app-common/app-common/zap-generated/cluster-enums.h b/zzz_generated/app-common/app-common/zap-generated/cluster-enums.h index 0fb8ae8c1f8b00..3a7c438130c374 100644 --- a/zzz_generated/app-common/app-common/zap-generated/cluster-enums.h +++ b/zzz_generated/app-common/app-common/zap-generated/cluster-enums.h @@ -418,6 +418,19 @@ enum class PositionTag : uint8_t kUnknownEnumValue = 7, }; +// Enum for PowerThresholdSourceEnum +enum class PowerThresholdSourceEnum : uint8_t +{ + kContract = 0x00, + kRegulator = 0x01, + kEquipment = 0x02, + // All received enum values that are not listed above will be mapped + // to kUnknownEnumValue. This is a helper enum value that should only + // be used by code to process how it handles receiving and unknown + // enum value. This specific should never be transmitted. + kUnknownEnumValue = 3, +}; + // Enum for RelativePositionTag enum class RelativePositionTag : uint8_t { @@ -5952,19 +5965,6 @@ enum class MeterTypeEnum : uint8_t kUnknownEnumValue = 3, }; -// Enum for PowerThresholdSourceEnum -enum class PowerThresholdSourceEnum : uint8_t -{ - kContract = 0x00, - kRegulator = 0x01, - kEquipment = 0x02, - // All received enum values that are not listed above will be mapped - // to kUnknownEnumValue. This is a helper enum value that should only - // be used by code to process how it handles receiving and unknown - // enum value. This specific should never be transmitted. - kUnknownEnumValue = 3, -}; - // Bitmap for Feature enum class Feature : uint32_t { 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 7a0319a9752c3a..f437c3d99cc246 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 @@ -827,6 +827,52 @@ CHIP_ERROR DecodableType::Decode(TLV::TLVReader & reader) } // namespace AtomicAttributeStatusStruct +namespace PowerThresholdStruct { +CHIP_ERROR Type::Encode(TLV::TLVWriter & aWriter, TLV::Tag aTag) const +{ + DataModel::WrappedStructEncoder encoder{ aWriter, aTag }; + encoder.Encode(to_underlying(Fields::kPowerThreshold), powerThreshold); + encoder.Encode(to_underlying(Fields::kApparentPowerThreshold), apparentPowerThreshold); + encoder.Encode(to_underlying(Fields::kPowerThresholdSource), powerThresholdSource); + return encoder.Finalize(); +} + +CHIP_ERROR DecodableType::Decode(TLV::TLVReader & reader) +{ + detail::StructDecodeIterator __iterator(reader); + while (true) + { + auto __element = __iterator.Next(); + if (std::holds_alternative<CHIP_ERROR>(__element)) + { + return std::get<CHIP_ERROR>(__element); + } + + CHIP_ERROR err = CHIP_NO_ERROR; + const uint8_t __context_tag = std::get<uint8_t>(__element); + + if (__context_tag == to_underlying(Fields::kPowerThreshold)) + { + err = DataModel::Decode(reader, powerThreshold); + } + else if (__context_tag == to_underlying(Fields::kApparentPowerThreshold)) + { + err = DataModel::Decode(reader, apparentPowerThreshold); + } + else if (__context_tag == to_underlying(Fields::kPowerThresholdSource)) + { + err = DataModel::Decode(reader, powerThresholdSource); + } + else + { + } + + ReturnErrorOnFailure(err); + } +} + +} // namespace PowerThresholdStruct + } // namespace Structs } // namespace Globals @@ -33902,54 +33948,6 @@ namespace Events {} // namespace Events } // namespace TlsClientManagement namespace MeterIdentification { -namespace Structs { - -namespace PowerThresholdStruct { -CHIP_ERROR Type::Encode(TLV::TLVWriter & aWriter, TLV::Tag aTag) const -{ - DataModel::WrappedStructEncoder encoder{ aWriter, aTag }; - encoder.Encode(to_underlying(Fields::kPowerThreshold), powerThreshold); - encoder.Encode(to_underlying(Fields::kApparentPowerThreshold), apparentPowerThreshold); - encoder.Encode(to_underlying(Fields::kPowerThresholdSource), powerThresholdSource); - return encoder.Finalize(); -} - -CHIP_ERROR DecodableType::Decode(TLV::TLVReader & reader) -{ - detail::StructDecodeIterator __iterator(reader); - while (true) - { - auto __element = __iterator.Next(); - if (std::holds_alternative<CHIP_ERROR>(__element)) - { - return std::get<CHIP_ERROR>(__element); - } - - CHIP_ERROR err = CHIP_NO_ERROR; - const uint8_t __context_tag = std::get<uint8_t>(__element); - - if (__context_tag == to_underlying(Fields::kPowerThreshold)) - { - err = DataModel::Decode(reader, powerThreshold); - } - else if (__context_tag == to_underlying(Fields::kApparentPowerThreshold)) - { - err = DataModel::Decode(reader, apparentPowerThreshold); - } - else if (__context_tag == to_underlying(Fields::kPowerThresholdSource)) - { - err = DataModel::Decode(reader, powerThresholdSource); - } - else - { - } - - ReturnErrorOnFailure(err); - } -} - -} // namespace PowerThresholdStruct -} // namespace Structs namespace Commands {} // namespace Commands 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 2d213fcf4162b0..096ef2497abad2 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 @@ -478,6 +478,32 @@ using DecodableType = Type; } // namespace AtomicAttributeStatusStruct +namespace PowerThresholdStruct { +enum class Fields : uint8_t +{ + kPowerThreshold = 0, + kApparentPowerThreshold = 1, + kPowerThresholdSource = 2, +}; + +struct Type +{ +public: + Optional<int64_t> powerThreshold; + Optional<int64_t> apparentPowerThreshold; + DataModel::Nullable<Globals::PowerThresholdSourceEnum> powerThresholdSource; + + CHIP_ERROR Decode(TLV::TLVReader & reader); + + static constexpr bool kIsFabricScoped = false; + + CHIP_ERROR Encode(TLV::TLVWriter & aWriter, TLV::Tag aTag) const; +}; + +using DecodableType = Type; + +} // namespace PowerThresholdStruct + } // namespace Structs namespace Attributes { @@ -46546,33 +46572,6 @@ struct TypeInfo } // namespace Attributes } // namespace TlsClientManagement namespace MeterIdentification { -namespace Structs { -namespace PowerThresholdStruct { -enum class Fields : uint8_t -{ - kPowerThreshold = 0, - kApparentPowerThreshold = 1, - kPowerThresholdSource = 2, -}; - -struct Type -{ -public: - Optional<int64_t> powerThreshold; - Optional<int64_t> apparentPowerThreshold; - DataModel::Nullable<PowerThresholdSourceEnum> powerThresholdSource; - - CHIP_ERROR Decode(TLV::TLVReader & reader); - - static constexpr bool kIsFabricScoped = false; - - CHIP_ERROR Encode(TLV::TLVWriter & aWriter, TLV::Tag aTag) const; -}; - -using DecodableType = Type; - -} // namespace PowerThresholdStruct -} // namespace Structs namespace Attributes { @@ -46630,11 +46629,11 @@ struct TypeInfo namespace PowerThreshold { struct TypeInfo { - using Type = chip::app::DataModel::Nullable<chip::app::Clusters::MeterIdentification::Structs::PowerThresholdStruct::Type>; + using Type = chip::app::DataModel::Nullable<chip::app::Clusters::Globals::Structs::PowerThresholdStruct::Type>; using DecodableType = - chip::app::DataModel::Nullable<chip::app::Clusters::MeterIdentification::Structs::PowerThresholdStruct::DecodableType>; - using DecodableArgType = const chip::app::DataModel::Nullable< - chip::app::Clusters::MeterIdentification::Structs::PowerThresholdStruct::DecodableType> &; + chip::app::DataModel::Nullable<chip::app::Clusters::Globals::Structs::PowerThresholdStruct::DecodableType>; + using DecodableArgType = + const chip::app::DataModel::Nullable<chip::app::Clusters::Globals::Structs::PowerThresholdStruct::DecodableType> &; static constexpr ClusterId GetClusterId() { return Clusters::MeterIdentification::Id; } static constexpr AttributeId GetAttributeId() { return Attributes::PowerThreshold::Id; } diff --git a/zzz_generated/chip-tool/zap-generated/cluster/Commands.h b/zzz_generated/chip-tool/zap-generated/cluster/Commands.h index 12b8c68c270fdb..46c1c4b63068fe 100644 --- a/zzz_generated/chip-tool/zap-generated/cluster/Commands.h +++ b/zzz_generated/chip-tool/zap-generated/cluster/Commands.h @@ -29187,7 +29187,7 @@ void registerClusterMeterIdentification(Commands & commands, CredentialIssuerCom make_unique<WriteAttribute<chip::app::DataModel::Nullable<chip::CharSpan>>>( Id, "protocol-version", Attributes::ProtocolVersion::Id, WriteCommandType::kForceWrite, credsIssuerConfig), // make_unique<WriteAttributeAsComplex< - chip::app::DataModel::Nullable<chip::app::Clusters::MeterIdentification::Structs::PowerThresholdStruct::Type>>>( + chip::app::DataModel::Nullable<chip::app::Clusters::Globals::Structs::PowerThresholdStruct::Type>>>( Id, "power-threshold", Attributes::PowerThreshold::Id, WriteCommandType::kForceWrite, credsIssuerConfig), // make_unique<WriteAttributeAsComplex<chip::app::DataModel::List<const chip::CommandId>>>( Id, "generated-command-list", Attributes::GeneratedCommandList::Id, WriteCommandType::kForceWrite, diff --git a/zzz_generated/chip-tool/zap-generated/cluster/ComplexArgumentParser.cpp b/zzz_generated/chip-tool/zap-generated/cluster/ComplexArgumentParser.cpp index 16e02bf2c191c4..df7fad83178bf4 100644 --- a/zzz_generated/chip-tool/zap-generated/cluster/ComplexArgumentParser.cpp +++ b/zzz_generated/chip-tool/zap-generated/cluster/ComplexArgumentParser.cpp @@ -540,6 +540,49 @@ void ComplexArgumentParser::Finalize(chip::app::Clusters::detail::Structs::Opera ComplexArgumentParser::Finalize(request.operationalStateLabel); } +CHIP_ERROR ComplexArgumentParser::Setup(const char * label, + chip::app::Clusters::Globals::Structs::PowerThresholdStruct::Type & request, + Json::Value & value) +{ + VerifyOrReturnError(value.isObject(), CHIP_ERROR_INVALID_ARGUMENT); + + // Copy to track which members we already processed. + Json::Value valueCopy(value); + + ReturnErrorOnFailure(ComplexArgumentParser::EnsureMemberExist("PowerThresholdStruct.powerThresholdSource", + "powerThresholdSource", value.isMember("powerThresholdSource"))); + + char labelWithMember[kMaxLabelLength]; + if (value.isMember("powerThreshold")) + { + snprintf(labelWithMember, sizeof(labelWithMember), "%s.%s", label, "powerThreshold"); + ReturnErrorOnFailure(ComplexArgumentParser::Setup(labelWithMember, request.powerThreshold, value["powerThreshold"])); + } + valueCopy.removeMember("powerThreshold"); + + if (value.isMember("apparentPowerThreshold")) + { + snprintf(labelWithMember, sizeof(labelWithMember), "%s.%s", label, "apparentPowerThreshold"); + ReturnErrorOnFailure( + ComplexArgumentParser::Setup(labelWithMember, request.apparentPowerThreshold, value["apparentPowerThreshold"])); + } + valueCopy.removeMember("apparentPowerThreshold"); + + snprintf(labelWithMember, sizeof(labelWithMember), "%s.%s", label, "powerThresholdSource"); + ReturnErrorOnFailure( + ComplexArgumentParser::Setup(labelWithMember, request.powerThresholdSource, value["powerThresholdSource"])); + valueCopy.removeMember("powerThresholdSource"); + + return ComplexArgumentParser::EnsureNoMembersRemaining(label, valueCopy); +} + +void ComplexArgumentParser::Finalize(chip::app::Clusters::Globals::Structs::PowerThresholdStruct::Type & request) +{ + ComplexArgumentParser::Finalize(request.powerThreshold); + ComplexArgumentParser::Finalize(request.apparentPowerThreshold); + ComplexArgumentParser::Finalize(request.powerThresholdSource); +} + CHIP_ERROR ComplexArgumentParser::Setup(const char * label, chip::app::Clusters::detail::Structs::ViewportStruct::Type & request, Json::Value & value) { @@ -7343,49 +7386,6 @@ void ComplexArgumentParser::Finalize(chip::app::Clusters::TlsClientManagement::S ComplexArgumentParser::Finalize(request.status); } -CHIP_ERROR ComplexArgumentParser::Setup(const char * label, - chip::app::Clusters::MeterIdentification::Structs::PowerThresholdStruct::Type & request, - Json::Value & value) -{ - VerifyOrReturnError(value.isObject(), CHIP_ERROR_INVALID_ARGUMENT); - - // Copy to track which members we already processed. - Json::Value valueCopy(value); - - ReturnErrorOnFailure(ComplexArgumentParser::EnsureMemberExist("PowerThresholdStruct.powerThresholdSource", - "powerThresholdSource", value.isMember("powerThresholdSource"))); - - char labelWithMember[kMaxLabelLength]; - if (value.isMember("powerThreshold")) - { - snprintf(labelWithMember, sizeof(labelWithMember), "%s.%s", label, "powerThreshold"); - ReturnErrorOnFailure(ComplexArgumentParser::Setup(labelWithMember, request.powerThreshold, value["powerThreshold"])); - } - valueCopy.removeMember("powerThreshold"); - - if (value.isMember("apparentPowerThreshold")) - { - snprintf(labelWithMember, sizeof(labelWithMember), "%s.%s", label, "apparentPowerThreshold"); - ReturnErrorOnFailure( - ComplexArgumentParser::Setup(labelWithMember, request.apparentPowerThreshold, value["apparentPowerThreshold"])); - } - valueCopy.removeMember("apparentPowerThreshold"); - - snprintf(labelWithMember, sizeof(labelWithMember), "%s.%s", label, "powerThresholdSource"); - ReturnErrorOnFailure( - ComplexArgumentParser::Setup(labelWithMember, request.powerThresholdSource, value["powerThresholdSource"])); - valueCopy.removeMember("powerThresholdSource"); - - return ComplexArgumentParser::EnsureNoMembersRemaining(label, valueCopy); -} - -void ComplexArgumentParser::Finalize(chip::app::Clusters::MeterIdentification::Structs::PowerThresholdStruct::Type & request) -{ - ComplexArgumentParser::Finalize(request.powerThreshold); - ComplexArgumentParser::Finalize(request.apparentPowerThreshold); - ComplexArgumentParser::Finalize(request.powerThresholdSource); -} - CHIP_ERROR ComplexArgumentParser::Setup(const char * label, chip::app::Clusters::UnitTesting::Structs::SimpleStruct::Type & request, Json::Value & value) { diff --git a/zzz_generated/chip-tool/zap-generated/cluster/ComplexArgumentParser.h b/zzz_generated/chip-tool/zap-generated/cluster/ComplexArgumentParser.h index f84e2b61f653b5..99b56444f65f34 100644 --- a/zzz_generated/chip-tool/zap-generated/cluster/ComplexArgumentParser.h +++ b/zzz_generated/chip-tool/zap-generated/cluster/ComplexArgumentParser.h @@ -86,6 +86,11 @@ static CHIP_ERROR Setup(const char * label, chip::app::Clusters::detail::Structs static void Finalize(chip::app::Clusters::detail::Structs::OperationalStateStruct::Type & request); +static CHIP_ERROR Setup(const char * label, chip::app::Clusters::Globals::Structs::PowerThresholdStruct::Type & request, + Json::Value & value); + +static void Finalize(chip::app::Clusters::Globals::Structs::PowerThresholdStruct::Type & request); + static CHIP_ERROR Setup(const char * label, chip::app::Clusters::detail::Structs::ViewportStruct::Type & request, Json::Value & value); @@ -845,11 +850,6 @@ static CHIP_ERROR Setup(const char * label, chip::app::Clusters::TlsClientManage static void Finalize(chip::app::Clusters::TlsClientManagement::Structs::TLSEndpointStruct::Type & request); -static CHIP_ERROR Setup(const char * label, chip::app::Clusters::MeterIdentification::Structs::PowerThresholdStruct::Type & request, - Json::Value & value); - -static void Finalize(chip::app::Clusters::MeterIdentification::Structs::PowerThresholdStruct::Type & request); - static CHIP_ERROR Setup(const char * label, chip::app::Clusters::UnitTesting::Structs::SimpleStruct::Type & request, Json::Value & value); diff --git a/zzz_generated/chip-tool/zap-generated/cluster/logging/DataModelLogger.cpp b/zzz_generated/chip-tool/zap-generated/cluster/logging/DataModelLogger.cpp index 4ded16d2f4e07d..e72ea4fad376ea 100644 --- a/zzz_generated/chip-tool/zap-generated/cluster/logging/DataModelLogger.cpp +++ b/zzz_generated/chip-tool/zap-generated/cluster/logging/DataModelLogger.cpp @@ -465,6 +465,39 @@ CHIP_ERROR DataModelLogger::LogValue(const char * label, size_t indent, return CHIP_NO_ERROR; } +CHIP_ERROR DataModelLogger::LogValue(const char * label, size_t indent, + const chip::app::Clusters::Globals::Structs::PowerThresholdStruct::DecodableType & value) +{ + DataModelLogger::LogString(label, indent, "{"); + { + CHIP_ERROR err = LogValue("PowerThreshold", indent + 1, value.powerThreshold); + if (err != CHIP_NO_ERROR) + { + DataModelLogger::LogString(indent + 1, "Struct truncated due to invalid value for 'PowerThreshold'"); + return err; + } + } + { + CHIP_ERROR err = LogValue("ApparentPowerThreshold", indent + 1, value.apparentPowerThreshold); + if (err != CHIP_NO_ERROR) + { + DataModelLogger::LogString(indent + 1, "Struct truncated due to invalid value for 'ApparentPowerThreshold'"); + return err; + } + } + { + CHIP_ERROR err = LogValue("PowerThresholdSource", indent + 1, value.powerThresholdSource); + if (err != CHIP_NO_ERROR) + { + DataModelLogger::LogString(indent + 1, "Struct truncated due to invalid value for 'PowerThresholdSource'"); + return err; + } + } + DataModelLogger::LogString(indent, "}"); + + return CHIP_NO_ERROR; +} + CHIP_ERROR DataModelLogger::LogValue(const char * label, size_t indent, const chip::app::Clusters::detail::Structs::ViewportStruct::DecodableType & value) { @@ -6497,40 +6530,6 @@ DataModelLogger::LogValue(const char * label, size_t indent, return CHIP_NO_ERROR; } -CHIP_ERROR -DataModelLogger::LogValue(const char * label, size_t indent, - const chip::app::Clusters::MeterIdentification::Structs::PowerThresholdStruct::DecodableType & value) -{ - DataModelLogger::LogString(label, indent, "{"); - { - CHIP_ERROR err = LogValue("PowerThreshold", indent + 1, value.powerThreshold); - if (err != CHIP_NO_ERROR) - { - DataModelLogger::LogString(indent + 1, "Struct truncated due to invalid value for 'PowerThreshold'"); - return err; - } - } - { - CHIP_ERROR err = LogValue("ApparentPowerThreshold", indent + 1, value.apparentPowerThreshold); - if (err != CHIP_NO_ERROR) - { - DataModelLogger::LogString(indent + 1, "Struct truncated due to invalid value for 'ApparentPowerThreshold'"); - return err; - } - } - { - CHIP_ERROR err = LogValue("PowerThresholdSource", indent + 1, value.powerThresholdSource); - if (err != CHIP_NO_ERROR) - { - DataModelLogger::LogString(indent + 1, "Struct truncated due to invalid value for 'PowerThresholdSource'"); - return err; - } - } - DataModelLogger::LogString(indent, "}"); - - return CHIP_NO_ERROR; -} - CHIP_ERROR DataModelLogger::LogValue(const char * label, size_t indent, const chip::app::Clusters::UnitTesting::Structs::SimpleStruct::DecodableType & value) { @@ -19836,8 +19835,7 @@ CHIP_ERROR DataModelLogger::LogAttribute(const chip::app::ConcreteDataAttributeP return DataModelLogger::LogValue("ProtocolVersion", 1, value); } case MeterIdentification::Attributes::PowerThreshold::Id: { - chip::app::DataModel::Nullable<chip::app::Clusters::MeterIdentification::Structs::PowerThresholdStruct::DecodableType> - value; + chip::app::DataModel::Nullable<chip::app::Clusters::Globals::Structs::PowerThresholdStruct::DecodableType> value; ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); return DataModelLogger::LogValue("PowerThreshold", 1, value); } diff --git a/zzz_generated/chip-tool/zap-generated/cluster/logging/DataModelLogger.h b/zzz_generated/chip-tool/zap-generated/cluster/logging/DataModelLogger.h index 68daafa4ad710f..5d779e0b210261 100644 --- a/zzz_generated/chip-tool/zap-generated/cluster/logging/DataModelLogger.h +++ b/zzz_generated/chip-tool/zap-generated/cluster/logging/DataModelLogger.h @@ -59,6 +59,9 @@ static CHIP_ERROR LogValue(const char * label, size_t indent, static CHIP_ERROR LogValue(const char * label, size_t indent, const chip::app::Clusters::detail::Structs::OperationalStateStruct::DecodableType & value); +static CHIP_ERROR LogValue(const char * label, size_t indent, + const chip::app::Clusters::Globals::Structs::PowerThresholdStruct::DecodableType & value); + static CHIP_ERROR LogValue(const char * label, size_t indent, const chip::app::Clusters::detail::Structs::ViewportStruct::DecodableType & value); @@ -520,9 +523,6 @@ LogValue(const char * label, size_t indent, static CHIP_ERROR LogValue(const char * label, size_t indent, const chip::app::Clusters::TlsClientManagement::Structs::TLSEndpointStruct::DecodableType & value); -static CHIP_ERROR LogValue(const char * label, size_t indent, - const chip::app::Clusters::MeterIdentification::Structs::PowerThresholdStruct::DecodableType & value); - static CHIP_ERROR LogValue(const char * label, size_t indent, const chip::app::Clusters::UnitTesting::Structs::SimpleStruct::DecodableType & value); diff --git a/zzz_generated/darwin-framework-tool/zap-generated/cluster/Commands.h b/zzz_generated/darwin-framework-tool/zap-generated/cluster/Commands.h index b5172ae189dc1a..4574f0572811c0 100644 --- a/zzz_generated/darwin-framework-tool/zap-generated/cluster/Commands.h +++ b/zzz_generated/darwin-framework-tool/zap-generated/cluster/Commands.h @@ -164762,7 +164762,7 @@ class ReadMeterIdentificationPowerThreshold : public ReadAttribute { dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL_WITH_AUTORELEASE_POOL); __auto_type * cluster = [[MTRBaseClusterMeterIdentification alloc] initWithDevice:device endpointID:@(endpointId) queue:callbackQueue]; - [cluster readAttributePowerThresholdWithCompletion:^(MTRMeterIdentificationClusterPowerThresholdStruct * _Nullable value, NSError * _Nullable error) { + [cluster readAttributePowerThresholdWithCompletion:^(MTRDataTypePowerThresholdStruct * _Nullable value, NSError * _Nullable error) { NSLog(@"MeterIdentification.PowerThreshold response %@", [value description]); if (error == nil) { RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); @@ -164807,7 +164807,7 @@ class SubscribeAttributeMeterIdentificationPowerThreshold : public SubscribeAttr } [cluster subscribeAttributePowerThresholdWithParams:params subscriptionEstablished:^() { mSubscriptionEstablished = YES; } - reportHandler:^(MTRMeterIdentificationClusterPowerThresholdStruct * _Nullable value, NSError * _Nullable error) { + reportHandler:^(MTRDataTypePowerThresholdStruct * _Nullable value, NSError * _Nullable error) { NSLog(@"MeterIdentification.PowerThreshold response %@", [value description]); if (error == nil) { RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value);