Skip to content

Commit 4133307

Browse files
ericzijian1994hare-siterwellrestyled-commitsbzbarsky-apple
authored andcommitted
Add smoke-co-alarm-cluster.xml (#26506)
* Add smoke-co-alarm-cluster.xml * Update smoke-co-alarm-cluster.xml * Fix copyright information * Add a bitmap definition that defines the feature map * List the min/max values of SensitivityLevel * Add XML to the various lists of cluster files Generating all possible code using zap tool * Manually updated files: 1. src/app/zap-templates/zcl/data-model/all.xml 2. src/app/zap-templates/zcl/zcl-with-test-extensions.json 3. src/app/zap-templates/zcl/zcl.json * Update smoke-co-alarm-cluster.xml Update Copyright Date * Update smoke-co-alarm-cluster.xml * Remove featureBit * Remove ExpiryDate temporarily * Update controller-clusters.zap * Add Smoke CO Alarm cluster * Regenerating all possible code using zap tool * Update zap_cluster_list.json * Add SMOKE_CO_ALARM_CLUSTER * Regenerating all possible code using zap tool * Regenerating all possible code using zap tool * Update src/controller/data_model/BUILD.gn * Update smoke-co-alarm-cluster.xml * Add FeatureMap * Regenerating all possible code using zap tool * Restyled by whitespace * Restyled by google-java-format * Update src/app/zap-templates/zcl/data-model/chip/smoke-co-alarm-cluster.xml Co-authored-by: Boris Zbarsky <[email protected]> * Update src/app/zap-templates/zcl/data-model/chip/smoke-co-alarm-cluster.xml Co-authored-by: Boris Zbarsky <[email protected]> * Regenerating all possible code using zap tool * Regenerating all possible code using zap tool * Update replacable-monitoring-cluster.xml * Update src/controller/data_model/BUILD.gn --------- Co-authored-by: Hare <[email protected]> Co-authored-by: Restyled.io <[email protected]> Co-authored-by: Boris Zbarsky <[email protected]>
1 parent 8038b0c commit 4133307

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

56 files changed

+10594
-79
lines changed

src/app/zap-templates/zcl/data-model/all.xml

+1
Original file line numberDiff line numberDiff line change
@@ -56,6 +56,7 @@
5656
<xi:include href="chip/relative-humidity-measurement-cluster.xml" />
5757
<xi:include href="chip/replacable-monitoring-cluster.xml.xml" />
5858
<xi:include href="chip/scene.xml" />
59+
<xi:include href="chip/smoke-co-alarm-cluster.xml" />
5960
<xi:include href="chip/software-diagnostics-cluster.xml" />
6061
<xi:include href="chip/switch-cluster.xml" />
6162
<xi:include href="chip/target-navigator-cluster.xml" />

src/app/zap-templates/zcl/data-model/chip/replacable-monitoring-cluster.xml

+2-2
Original file line numberDiff line numberDiff line change
@@ -84,7 +84,7 @@ limitations under the License.
8484
<domain>Measurement &amp; Sensing</domain>
8585
<description>Attributes and commands for monitoring electrostatic filters in a device</description>
8686
<code>0x0074</code>
87-
<define>ELECTROSTATIC_FILTER_MONITORING</define>
87+
<define>ELECTROSTATIC_FILTER_MONITORING_CLUSTER</define>
8888
<client tick="false" init="false">true</client>
8989
<server tick="false" init="false">true</server>
9090

@@ -147,7 +147,7 @@ limitations under the License.
147147
<domain>Measurement &amp; Sensing</domain>
148148
<description>Attributes and commands for monitoring zeolite filters in a device</description>
149149
<code>0x0077</code>
150-
<define>ZEOLITE_FILTER_MONITORING</define>
150+
<define>ZEOLITE_FILTER_MONITORING_CLUSTER</define>
151151
<client tick="false" init="false">true</client>
152152
<server tick="false" init="false">true</server>
153153

Original file line numberDiff line numberDiff line change
@@ -0,0 +1,153 @@
1+
<?xml version="1.0"?>
2+
<!--
3+
Copyright (c) 2023 Project CHIP Authors
4+
5+
Licensed under the Apache License, Version 2.0 (the "License");
6+
you may not use this file except in compliance with the License.
7+
You may obtain a copy of the License at
8+
9+
http://www.apache.org/licenses/LICENSE-2.0
10+
11+
Unless required by applicable law or agreed to in writing, software
12+
distributed under the License is distributed on an "AS IS" BASIS,
13+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14+
See the License for the specific language governing permissions and
15+
limitations under the License.
16+
-->
17+
<configurator>
18+
<domain name="CHIP" />
19+
20+
<cluster>
21+
<domain>Closures</domain>
22+
<name>Smoke CO Alarm</name>
23+
<code>0x005C</code>
24+
<define>SMOKE_CO_ALARM_CLUSTER</define>
25+
<description>This cluster provides an interface for observing and managing the state of smoke and CO alarms.</description>
26+
27+
<!-- Abbreviations used in descriptions -->
28+
<tag name="SMOKE" description="Smoke Alarm" />
29+
<tag name="CO" description="CO Alarm" />
30+
31+
<client tick="false" init="false">true</client>
32+
<server tick="false" init="false">true</server>
33+
34+
<!-- Current cluster version -->
35+
<globalAttribute side="either" code="0xFFFD" value="1" />
36+
<!-- Cluster feature map -->
37+
<globalAttribute side="server" code="0xFFFC" type="SmokeCOFeature" value="1" />
38+
39+
<!-- Attributes -->
40+
<attribute side="server" code="0x0000" define="EXPRESSED_STATE" type="ExpressedStateEnum" writable="false" optional="false">ExpressedState</attribute>
41+
<attribute side="server" code="0x0001" define="SMOKE_STATE" type="AlarmStateEnum" writable="false" optional="true">SmokeState</attribute>
42+
<attribute side="server" code="0x0002" define="CO_STATE" type="AlarmStateEnum" writable="false" optional="true">COState</attribute>
43+
<attribute side="server" code="0x0003" define="BATTERY_ALERT" type="AlarmStateEnum" writable="false" optional="false">BatteryAlert</attribute>
44+
<attribute side="server" code="0x0004" define="DEVICE_MUTED" type="MuteStateEnum" writable="false" optional="true">DeviceMuted</attribute>
45+
<attribute side="server" code="0x0005" define="TEST_IN_PROGRESS" type="boolean" writable="false" optional="false">TestInProgress</attribute>
46+
<attribute side="server" code="0x0006" define="HARDWARE_FAULTALERT" type="boolean" writable="false" optional="false">HardwareFaultAlert</attribute>
47+
<attribute side="server" code="0x0007" define="END_OF_SERVICEALERT" type="EndOfServiceEnum" writable="false" optional="false">EndOfServiceAlert</attribute>
48+
<attribute side="server" code="0x0008" define="INTERCONNECT_SMOKE_ALARM" type="AlarmStateEnum" writable="false" optional="true">InterconnectSmokeAlarm</attribute>
49+
<attribute side="server" code="0x0009" define="INTERCONNECT_CO_ALARM" type="AlarmStateEnum" writable="false" optional="true">InterconnectCOAlarm</attribute>
50+
<attribute side="server" code="0x000A" define="CONTAMINATION_STATE" type="ContaminationStateEnum" writable="false" optional="true">ContaminationState</attribute>
51+
<attribute side="server" code="0x000B" define="SENSITIVITY_LEVEL" type="SensitivityEnum" min="0" max="2" writable="true" optional="true">SensitivityLevel</attribute>
52+
<!-- TODO: Date type encoding not defined -->
53+
<!-- <attribute side="server" code="0x000C" define="EXPIRY_DATE" type="Date" writable="false" optional="true">ExpiryDate</attribute> -->
54+
55+
<!-- Commands -->
56+
<command source="client" code="0x00" name="SelfTestRequest" optional="true">
57+
<description>This command SHALL initiate a device self-test.</description>
58+
</command>
59+
60+
<!-- Events -->
61+
<event side="server" code="0x00" name="SmokeAlarm" priority="info" optional="true">
62+
<description>This event SHALL be generated when SmokeState attribute changes to either Warning or Critical state.</description>
63+
</event>
64+
<event side="server" code="0x01" name="COAlarm" priority="info" optional="true">
65+
<description>This event SHALL be generated when COState attribute changes to either Warning or Critical state.</description>
66+
</event>
67+
<event side="server" code="0x02" name="LowBattery" priority="info" optional="false">
68+
<description>This event SHALL be generated when BatteryAlert attribute changes to either Warning or Critical state.</description>
69+
</event>
70+
<event side="server" code="0x03" name="HardwareFault" priority="info" optional="false">
71+
<description>This event SHALL be generated when the device detects a hardware fault that leads to setting HardwareFaultAlert to True.</description>
72+
</event>
73+
<event side="server" code="0x04" name="EndOfService" priority="info" optional="false">
74+
<description>This event SHALL be generated when the EndOfServiceAlert is set to True.</description>
75+
</event>
76+
<event side="server" code="0x05" name="SelfTestComplete" priority="info" optional="false">
77+
<description>This event SHALL be generated when the SelfTest completes, and the attribute TestInProgress changes to False.</description>
78+
</event>
79+
<event side="server" code="0x06" name="AlarmMuted" priority="info" optional="true">
80+
<description>This event SHALL be generated when the DeviceMuted attribute changes to True.</description>
81+
</event>
82+
<event side="server" code="0x07" name="MuteEnded" priority="info" optional="true">
83+
<description>This event SHALL be generated when DeviceMuted attribute changes to False.</description>
84+
</event>
85+
<event side="server" code="0x08" name="InterconnectSmokeAlarm" priority="info" optional="true">
86+
<description>This event SHALL be generated when the device hosting the cluster receives a remote smoke alarm.</description>
87+
</event>
88+
<event side="server" code="0x09" name="InterconnectCOAlarm" priority="info" optional="true">
89+
<description>This event SHALL be generated when the device hosting the cluster receives a remote CO alarm.</description>
90+
</event>
91+
<event side="server" code="0x0A" name="AllClear" priority="info" optional="false">
92+
<description>This event SHALL be generated when ExpressedState attribute returns to Normal state.</description>
93+
</event>
94+
</cluster>
95+
96+
<!-- Cluster data types -->
97+
<enum name="AlarmStateEnum" type="ENUM8">
98+
<cluster code="0x005C" />
99+
<item value="0" name="Unknown" />
100+
<item value="1" name="Normal" />
101+
<item value="2" name="Warning" />
102+
<item value="3" name="Critical" />
103+
</enum>
104+
105+
<enum name="SensitivityEnum" type="ENUM8">
106+
<cluster code="0x005C" />
107+
<item value="0" name="High" />
108+
<item value="1" name="Standard" />
109+
<item value="2" name="Low" />
110+
</enum>
111+
112+
<enum name="ExpressedStateEnum" type="ENUM8">
113+
<cluster code="0x005C" />
114+
<item value="0" name="Normal" />
115+
<item value="1" name="SmokeAlarm" />
116+
<item value="2" name="COAlarm" />
117+
<item value="3" name="BatteryAlert" />
118+
<item value="4" name="Testing" />
119+
<item value="5" name="HardwareFault" />
120+
<item value="6" name="EndOfService" />
121+
<item value="7" name="InterconnectSmoke" />
122+
<item value="8" name="InterconnectCO" />
123+
</enum>
124+
125+
<enum name="MuteStateEnum" type="ENUM8">
126+
<cluster code="0x005C" />
127+
<item value="0" name="Unknown" />
128+
<item value="1" name="NotMuted" />
129+
<item value="2" name="Muted" />
130+
</enum>
131+
132+
<enum name="EndOfServiceEnum" type="ENUM8">
133+
<cluster code="0x005C" />
134+
<item value="0" name="Unknown" />
135+
<item value="1" name="Expired" />
136+
<item value="2" name="Normal" />
137+
</enum>
138+
139+
<enum name="ContaminationStateEnum" type="ENUM8">
140+
<cluster code="0x005C" />
141+
<item value="0" name="Unknown" />
142+
<item value="1" name="Normal" />
143+
<item value="2" name="Low" />
144+
<item value="3" name="Warning" />
145+
<item value="4" name="Critical" />
146+
</enum>
147+
148+
<bitmap name="SmokeCOAlarmFeature" type="BITMAP32">
149+
<cluster code="0x005C" />
150+
<field name="Smoke Alarm" mask="0x01" />
151+
<field name="CO alarm" mask="0x02" />
152+
</bitmap>
153+
</configurator>

src/app/zap-templates/zcl/zcl-with-test-extensions.json

+1
Original file line numberDiff line numberDiff line change
@@ -74,6 +74,7 @@
7474
"relative-humidity-measurement-cluster.xml",
7575
"replacable-monitoring-cluster.xml",
7676
"scene.xml",
77+
"smoke-co-alarm-cluster.xml",
7778
"software-diagnostics-cluster.xml",
7879
"switch-cluster.xml",
7980
"target-navigator-cluster.xml",

src/app/zap-templates/zcl/zcl.json

+1
Original file line numberDiff line numberDiff line change
@@ -72,6 +72,7 @@
7272
"relative-humidity-measurement-cluster.xml",
7373
"replacable-monitoring-cluster.xml",
7474
"scene.xml",
75+
"smoke-co-alarm-cluster.xml",
7576
"software-diagnostics-cluster.xml",
7677
"switch-cluster.xml",
7778
"target-navigator-cluster.xml",

src/app/zap_cluster_list.json

+2
Original file line numberDiff line numberDiff line change
@@ -76,6 +76,7 @@
7676
"PWM_CLUSTER": [],
7777
"RELATIVE_HUMIDITY_MEASUREMENT_CLUSTER": [],
7878
"SCENES_CLUSTER": [],
79+
"SMOKE_CO_ALARM_CLUSTER": [],
7980
"SOFTWARE_DIAGNOSTICS_CLUSTER": [],
8081
"SWITCH_CLUSTER": [],
8182
"TARGET_NAVIGATOR_CLUSTER": [],
@@ -177,6 +178,7 @@
177178
"PWM_CLUSTER": [],
178179
"RELATIVE_HUMIDITY_MEASUREMENT_CLUSTER": [],
179180
"SCENES_CLUSTER": ["scenes"],
181+
"SMOKE_CO_ALARM_CLUSTER": [],
180182
"SOFTWARE_DIAGNOSTICS_CLUSTER": ["software-diagnostics-server"],
181183
"SWITCH_CLUSTER": ["switch-server"],
182184
"TARGET_NAVIGATOR_CLUSTER": ["target-navigator-server"],

src/controller/data_model/BUILD.gn

+2
Original file line numberDiff line numberDiff line change
@@ -176,6 +176,8 @@ if (current_os == "android" || build_java_matter_controller) {
176176
"jni/RelativeHumidityMeasurementClient-ReadImpl.cpp",
177177
"jni/ScenesClient-InvokeSubscribeImpl.cpp",
178178
"jni/ScenesClient-ReadImpl.cpp",
179+
"jni/SmokeCoAlarmClient-ReadImpl.cpp",
180+
"jni/SmokeCoAlarmClient-InvokeSubscribeImpl.cpp",
179181
"jni/SoftwareDiagnosticsClient-InvokeSubscribeImpl.cpp",
180182
"jni/SoftwareDiagnosticsClient-ReadImpl.cpp",
181183
"jni/SwitchClient-InvokeSubscribeImpl.cpp",

src/controller/data_model/controller-clusters.matter

+108
Original file line numberDiff line numberDiff line change
@@ -2800,6 +2800,114 @@ client cluster AirQuality = 91 {
28002800
readonly attribute int16u clusterRevision = 65533;
28012801
}
28022802

2803+
/** This cluster provides an interface for observing and managing the state of smoke and CO alarms. */
2804+
client cluster SmokeCoAlarm = 92 {
2805+
enum AlarmStateEnum : ENUM8 {
2806+
kUnknown = 0;
2807+
kNormal = 1;
2808+
kWarning = 2;
2809+
kCritical = 3;
2810+
}
2811+
2812+
enum ContaminationStateEnum : ENUM8 {
2813+
kUnknown = 0;
2814+
kNormal = 1;
2815+
kLow = 2;
2816+
kWarning = 3;
2817+
kCritical = 4;
2818+
}
2819+
2820+
enum EndOfServiceEnum : ENUM8 {
2821+
kUnknown = 0;
2822+
kExpired = 1;
2823+
kNormal = 2;
2824+
}
2825+
2826+
enum ExpressedStateEnum : ENUM8 {
2827+
kNormal = 0;
2828+
kSmokeAlarm = 1;
2829+
kCOAlarm = 2;
2830+
kBatteryAlert = 3;
2831+
kTesting = 4;
2832+
kHardwareFault = 5;
2833+
kEndOfService = 6;
2834+
kInterconnectSmoke = 7;
2835+
kInterconnectCO = 8;
2836+
}
2837+
2838+
enum MuteStateEnum : ENUM8 {
2839+
kUnknown = 0;
2840+
kNotMuted = 1;
2841+
kMuted = 2;
2842+
}
2843+
2844+
enum SensitivityEnum : ENUM8 {
2845+
kHigh = 0;
2846+
kStandard = 1;
2847+
kLow = 2;
2848+
}
2849+
2850+
bitmap SmokeCOAlarmFeature : BITMAP32 {
2851+
kSmokeAlarm = 0x1;
2852+
kCoAlarm = 0x2;
2853+
}
2854+
2855+
info event SmokeAlarm = 0 {
2856+
}
2857+
2858+
info event COAlarm = 1 {
2859+
}
2860+
2861+
info event LowBattery = 2 {
2862+
}
2863+
2864+
info event HardwareFault = 3 {
2865+
}
2866+
2867+
info event EndOfService = 4 {
2868+
}
2869+
2870+
info event SelfTestComplete = 5 {
2871+
}
2872+
2873+
info event AlarmMuted = 6 {
2874+
}
2875+
2876+
info event MuteEnded = 7 {
2877+
}
2878+
2879+
info event InterconnectSmokeAlarm = 8 {
2880+
}
2881+
2882+
info event InterconnectCOAlarm = 9 {
2883+
}
2884+
2885+
info event AllClear = 10 {
2886+
}
2887+
2888+
readonly attribute ExpressedStateEnum expressedState = 0;
2889+
readonly attribute optional AlarmStateEnum smokeState = 1;
2890+
readonly attribute optional AlarmStateEnum COState = 2;
2891+
readonly attribute AlarmStateEnum batteryAlert = 3;
2892+
readonly attribute optional MuteStateEnum deviceMuted = 4;
2893+
readonly attribute boolean testInProgress = 5;
2894+
readonly attribute boolean hardwareFaultAlert = 6;
2895+
readonly attribute EndOfServiceEnum endOfServiceAlert = 7;
2896+
readonly attribute optional AlarmStateEnum interconnectSmokeAlarm = 8;
2897+
readonly attribute optional AlarmStateEnum interconnectCOAlarm = 9;
2898+
readonly attribute optional ContaminationStateEnum contaminationState = 10;
2899+
attribute optional SensitivityEnum sensitivityLevel = 11;
2900+
readonly attribute command_id generatedCommandList[] = 65528;
2901+
readonly attribute command_id acceptedCommandList[] = 65529;
2902+
readonly attribute event_id eventList[] = 65530;
2903+
readonly attribute attrib_id attributeList[] = 65531;
2904+
readonly attribute bitmap32 featureMap = 65532;
2905+
readonly attribute int16u clusterRevision = 65533;
2906+
2907+
/** This command SHALL initiate a device self-test. */
2908+
command SelfTestRequest(): DefaultSuccess = 0;
2909+
}
2910+
28032911
/** Attributes and commands for monitoring HEPA filters in a device */
28042912
client cluster HepaFilterMonitoring = 113 {
28052913
enum ChangeIndicationEnum : ENUM8 {

0 commit comments

Comments
 (0)