Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

zap generated files for Meter Identification cluster #37952

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .github/workflows/tests.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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 \
Expand Down
1 change: 1 addition & 0 deletions docs/ids_and_codes/zap_clusters.md
Original file line number Diff line number Diff line change
Expand Up @@ -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 |
1 change: 1 addition & 0 deletions scripts/rules.matterlint
Original file line number Diff line number Diff line change
Expand Up @@ -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";
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down Expand Up @@ -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)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down Expand Up @@ -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)
Expand Down
Original file line number Diff line number Diff line change
@@ -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"/>
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This does not match the spec. In the spec this is not a cluster-specific type.

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This does not match the spec. In the spec this is not a cluster-specific type.

Fixed.

<item name="Contract" value="0x00"/>
<item name="Regulator" value="0x01"/>
<item name="Equipment" value="0x02"/>
</enum>

<struct name="PowerThresholdStruct" apiMaturity="provisional">
<cluster code="0x0B06"/>
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Does not match the spec.

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Does not match the spec.

Fixed.

<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>
2 changes: 2 additions & 0 deletions src/app/zap-templates/zcl/zcl-with-test-extensions.json
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down Expand Up @@ -679,6 +680,7 @@
"FeatureMap",
"ClusterRevision"
],
"Meter Identification": ["PowerThreshold"],
"Water Heater Mode": ["SupportedModes", "CurrentMode", "FeatureMap"],
"Wi-Fi Network Management": ["SSID", "PassphraseSurrogate"],
"Thread Network Directory": [
Expand Down
2 changes: 2 additions & 0 deletions src/app/zap-templates/zcl/zcl.json
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down Expand Up @@ -673,6 +674,7 @@
"FeatureMap",
"ClusterRevision"
],
"Meter Identification": ["PowerThreshold"],
"Water Heater Mode": ["SupportedModes", "CurrentMode", "FeatureMap"],
"Wi-Fi Network Management": ["SSID", "PassphraseSurrogate"],
"Thread Network Directory": [
Expand Down
2 changes: 2 additions & 0 deletions src/app/zap_cluster_list.json
Original file line number Diff line number Diff line change
Expand Up @@ -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": [],
Expand Down Expand Up @@ -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"],
Expand Down
39 changes: 39 additions & 0 deletions src/controller/data_model/controller-clusters.matter
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
Loading
Loading