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

Add smoke-co-alarm-cluster.xml #26506

Merged
merged 24 commits into from
May 18, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
24 commits
Select commit Hold shift + click to select a range
296a585
Add smoke-co-alarm-cluster.xml
hare-siterwell May 11, 2023
62704a7
Update smoke-co-alarm-cluster.xml
hare-siterwell May 12, 2023
3653d9d
Add XML to the various lists of cluster files
hare-siterwell May 12, 2023
343d472
Update smoke-co-alarm-cluster.xml
hare-siterwell May 12, 2023
958559e
Update smoke-co-alarm-cluster.xml
hare-siterwell May 14, 2023
b79d251
Update controller-clusters.zap
hare-siterwell May 14, 2023
581520b
Regenerating all possible code using zap tool
hare-siterwell May 14, 2023
ea99331
Update zap_cluster_list.json
hare-siterwell May 14, 2023
8177589
Regenerating all possible code using zap tool
hare-siterwell May 14, 2023
ec46252
Merge branch 'master' into smco_cluster
hare-siterwell May 14, 2023
8e1392e
Regenerating all possible code using zap tool
hare-siterwell May 14, 2023
ff3d491
Update src/controller/data_model/BUILD.gn
hare-siterwell May 14, 2023
8babc8f
Update smoke-co-alarm-cluster.xml
hare-siterwell May 15, 2023
37252b1
Restyled by whitespace
restyled-commits May 15, 2023
d52f72f
Restyled by google-java-format
restyled-commits May 15, 2023
41ec95e
Update src/app/zap-templates/zcl/data-model/chip/smoke-co-alarm-clust…
ericzijian1994 May 16, 2023
0420ef5
Update src/app/zap-templates/zcl/data-model/chip/smoke-co-alarm-clust…
ericzijian1994 May 16, 2023
03d35a2
Merge branch 'master' into smco_cluster
hare-siterwell May 17, 2023
e2c7add
Regenerating all possible code using zap tool
hare-siterwell May 17, 2023
384b18e
Merge branch 'master' into smco_cluster
ericzijian1994 May 17, 2023
f0ebdd3
Regenerating all possible code using zap tool
hare-siterwell May 17, 2023
b37d4fd
Update replacable-monitoring-cluster.xml
hare-siterwell May 17, 2023
3d17673
Update src/controller/data_model/BUILD.gn
hare-siterwell May 17, 2023
966eec1
Merge branch 'master' into pr-26506
bzbarsky-apple May 18, 2023
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 src/app/zap-templates/zcl/data-model/all.xml
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,7 @@
<xi:include href="chip/relative-humidity-measurement-cluster.xml" />
<xi:include href="chip/replacable-monitoring-cluster.xml.xml" />
<xi:include href="chip/scene.xml" />
<xi:include href="chip/smoke-co-alarm-cluster.xml" />
<xi:include href="chip/software-diagnostics-cluster.xml" />
<xi:include href="chip/switch-cluster.xml" />
<xi:include href="chip/target-navigator-cluster.xml" />
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,7 @@ limitations under the License.
<domain>Measurement &amp; Sensing</domain>
<description>Attributes and commands for monitoring electrostatic filters in a device</description>
<code>0x0074</code>
<define>ELECTROSTATIC_FILTER_MONITORING</define>
<define>ELECTROSTATIC_FILTER_MONITORING_CLUSTER</define>
<client tick="false" init="false">true</client>
<server tick="false" init="false">true</server>

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

Expand Down
153 changes: 153 additions & 0 deletions src/app/zap-templates/zcl/data-model/chip/smoke-co-alarm-cluster.xml
ericzijian1994 marked this conversation as resolved.
Show resolved Hide resolved
Original file line number Diff line number Diff line change
@@ -0,0 +1,153 @@
<?xml version="1.0"?>
<!--
Copyright (c) 2023 Project CHIP Authors

Licensed under the Apache License, Version 2.0 (the "License");
ericzijian1994 marked this conversation as resolved.
Show resolved Hide resolved
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
ericzijian1994 marked this conversation as resolved.
Show resolved Hide resolved

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.
-->
<configurator>
<domain name="CHIP" />

<cluster>
<domain>Closures</domain>
<name>Smoke CO Alarm</name>
<code>0x005C</code>
<define>SMOKE_CO_ALARM_CLUSTER</define>
<description>This cluster provides an interface for observing and managing the state of smoke and CO alarms.</description>

<!-- Abbreviations used in descriptions -->
<tag name="SMOKE" description="Smoke Alarm" />
<tag name="CO" description="CO Alarm" />
bzbarsky-apple marked this conversation as resolved.
Show resolved Hide resolved

<client tick="false" init="false">true</client>
<server tick="false" init="false">true</server>

<!-- Current cluster version -->
<globalAttribute side="either" code="0xFFFD" value="1" />
<!-- Cluster feature map -->
<globalAttribute side="server" code="0xFFFC" type="SmokeCOFeature" value="1" />

<!-- Attributes -->
<attribute side="server" code="0x0000" define="EXPRESSED_STATE" type="ExpressedStateEnum" writable="false" optional="false">ExpressedState</attribute>
<attribute side="server" code="0x0001" define="SMOKE_STATE" type="AlarmStateEnum" writable="false" optional="true">SmokeState</attribute>
<attribute side="server" code="0x0002" define="CO_STATE" type="AlarmStateEnum" writable="false" optional="true">COState</attribute>
<attribute side="server" code="0x0003" define="BATTERY_ALERT" type="AlarmStateEnum" writable="false" optional="false">BatteryAlert</attribute>
<attribute side="server" code="0x0004" define="DEVICE_MUTED" type="MuteStateEnum" writable="false" optional="true">DeviceMuted</attribute>
<attribute side="server" code="0x0005" define="TEST_IN_PROGRESS" type="boolean" writable="false" optional="false">TestInProgress</attribute>
<attribute side="server" code="0x0006" define="HARDWARE_FAULTALERT" type="boolean" writable="false" optional="false">HardwareFaultAlert</attribute>
<attribute side="server" code="0x0007" define="END_OF_SERVICEALERT" type="EndOfServiceEnum" writable="false" optional="false">EndOfServiceAlert</attribute>
bzbarsky-apple marked this conversation as resolved.
Show resolved Hide resolved
<attribute side="server" code="0x0008" define="INTERCONNECT_SMOKE_ALARM" type="AlarmStateEnum" writable="false" optional="true">InterconnectSmokeAlarm</attribute>
<attribute side="server" code="0x0009" define="INTERCONNECT_CO_ALARM" type="AlarmStateEnum" writable="false" optional="true">InterconnectCOAlarm</attribute>
<attribute side="server" code="0x000A" define="CONTAMINATION_STATE" type="ContaminationStateEnum" writable="false" optional="true">ContaminationState</attribute>
<attribute side="server" code="0x000B" define="SENSITIVITY_LEVEL" type="SensitivityEnum" min="0" max="2" writable="true" optional="true">SensitivityLevel</attribute>
<!-- TODO: Date type encoding not defined -->
ericzijian1994 marked this conversation as resolved.
Show resolved Hide resolved
<!-- <attribute side="server" code="0x000C" define="EXPIRY_DATE" type="Date" writable="false" optional="true">ExpiryDate</attribute> -->

<!-- Commands -->
<command source="client" code="0x00" name="SelfTestRequest" optional="true">
<description>This command SHALL initiate a device self-test.</description>
</command>

<!-- Events -->
<event side="server" code="0x00" name="SmokeAlarm" priority="info" optional="true">
<description>This event SHALL be generated when SmokeState attribute changes to either Warning or Critical state.</description>
</event>
<event side="server" code="0x01" name="COAlarm" priority="info" optional="true">
<description>This event SHALL be generated when COState attribute changes to either Warning or Critical state.</description>
</event>
<event side="server" code="0x02" name="LowBattery" priority="info" optional="false">
<description>This event SHALL be generated when BatteryAlert attribute changes to either Warning or Critical state.</description>
</event>
<event side="server" code="0x03" name="HardwareFault" priority="info" optional="false">
<description>This event SHALL be generated when the device detects a hardware fault that leads to setting HardwareFaultAlert to True.</description>
</event>
<event side="server" code="0x04" name="EndOfService" priority="info" optional="false">
<description>This event SHALL be generated when the EndOfServiceAlert is set to True.</description>
</event>
<event side="server" code="0x05" name="SelfTestComplete" priority="info" optional="false">
<description>This event SHALL be generated when the SelfTest completes, and the attribute TestInProgress changes to False.</description>
</event>
<event side="server" code="0x06" name="AlarmMuted" priority="info" optional="true">
<description>This event SHALL be generated when the DeviceMuted attribute changes to True.</description>
</event>
<event side="server" code="0x07" name="MuteEnded" priority="info" optional="true">
<description>This event SHALL be generated when DeviceMuted attribute changes to False.</description>
</event>
<event side="server" code="0x08" name="InterconnectSmokeAlarm" priority="info" optional="true">
<description>This event SHALL be generated when the device hosting the cluster receives a remote smoke alarm.</description>
</event>
<event side="server" code="0x09" name="InterconnectCOAlarm" priority="info" optional="true">
<description>This event SHALL be generated when the device hosting the cluster receives a remote CO alarm.</description>
</event>
<event side="server" code="0x0A" name="AllClear" priority="info" optional="false">
<description>This event SHALL be generated when ExpressedState attribute returns to Normal state.</description>
</event>
</cluster>

<!-- Cluster data types -->
<enum name="AlarmStateEnum" type="ENUM8">
<cluster code="0x005C" />
<item value="0" name="Unknown" />
<item value="1" name="Normal" />
<item value="2" name="Warning" />
<item value="3" name="Critical" />
</enum>

<enum name="SensitivityEnum" type="ENUM8">
<cluster code="0x005C" />
<item value="0" name="High" />
<item value="1" name="Standard" />
<item value="2" name="Low" />
</enum>

<enum name="ExpressedStateEnum" type="ENUM8">
<cluster code="0x005C" />
<item value="0" name="Normal" />
<item value="1" name="SmokeAlarm" />
<item value="2" name="COAlarm" />
<item value="3" name="BatteryAlert" />
<item value="4" name="Testing" />
<item value="5" name="HardwareFault" />
<item value="6" name="EndOfService" />
<item value="7" name="InterconnectSmoke" />
<item value="8" name="InterconnectCO" />
</enum>

<enum name="MuteStateEnum" type="ENUM8">
<cluster code="0x005C" />
<item value="0" name="Unknown" />
<item value="1" name="NotMuted" />
<item value="2" name="Muted" />
</enum>

<enum name="EndOfServiceEnum" type="ENUM8">
<cluster code="0x005C" />
<item value="0" name="Unknown" />
<item value="1" name="Expired" />
<item value="2" name="Normal" />
</enum>

<enum name="ContaminationStateEnum" type="ENUM8">
<cluster code="0x005C" />
<item value="0" name="Unknown" />
<item value="1" name="Normal" />
<item value="2" name="Low" />
<item value="3" name="Warning" />
<item value="4" name="Critical" />
</enum>

<bitmap name="SmokeCOAlarmFeature" type="BITMAP32">
<cluster code="0x005C" />
<field name="Smoke Alarm" mask="0x01" />
<field name="CO alarm" mask="0x02" />
</bitmap>
</configurator>
1 change: 1 addition & 0 deletions src/app/zap-templates/zcl/zcl-with-test-extensions.json
Original file line number Diff line number Diff line change
Expand Up @@ -74,6 +74,7 @@
"relative-humidity-measurement-cluster.xml",
"replacable-monitoring-cluster.xml",
"scene.xml",
"smoke-co-alarm-cluster.xml",
"software-diagnostics-cluster.xml",
"switch-cluster.xml",
"target-navigator-cluster.xml",
Expand Down
1 change: 1 addition & 0 deletions src/app/zap-templates/zcl/zcl.json
Original file line number Diff line number Diff line change
Expand Up @@ -72,6 +72,7 @@
"relative-humidity-measurement-cluster.xml",
"replacable-monitoring-cluster.xml",
"scene.xml",
"smoke-co-alarm-cluster.xml",
"software-diagnostics-cluster.xml",
"switch-cluster.xml",
"target-navigator-cluster.xml",
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 @@ -76,6 +76,7 @@
"PWM_CLUSTER": [],
"RELATIVE_HUMIDITY_MEASUREMENT_CLUSTER": [],
"SCENES_CLUSTER": [],
"SMOKE_CO_ALARM_CLUSTER": [],
"SOFTWARE_DIAGNOSTICS_CLUSTER": [],
"SWITCH_CLUSTER": [],
"TARGET_NAVIGATOR_CLUSTER": [],
Expand Down Expand Up @@ -177,6 +178,7 @@
"PWM_CLUSTER": [],
"RELATIVE_HUMIDITY_MEASUREMENT_CLUSTER": [],
"SCENES_CLUSTER": ["scenes"],
"SMOKE_CO_ALARM_CLUSTER": [],
"SOFTWARE_DIAGNOSTICS_CLUSTER": ["software-diagnostics-server"],
"SWITCH_CLUSTER": ["switch-server"],
"TARGET_NAVIGATOR_CLUSTER": ["target-navigator-server"],
Expand Down
2 changes: 2 additions & 0 deletions src/controller/data_model/BUILD.gn
Original file line number Diff line number Diff line change
Expand Up @@ -176,6 +176,8 @@ if (current_os == "android" || build_java_matter_controller) {
"jni/RelativeHumidityMeasurementClient-ReadImpl.cpp",
"jni/ScenesClient-InvokeSubscribeImpl.cpp",
"jni/ScenesClient-ReadImpl.cpp",
"jni/SmokeCoAlarmClient-ReadImpl.cpp",
"jni/SmokeCoAlarmClient-InvokeSubscribeImpl.cpp",
"jni/SoftwareDiagnosticsClient-InvokeSubscribeImpl.cpp",
"jni/SoftwareDiagnosticsClient-ReadImpl.cpp",
"jni/SwitchClient-InvokeSubscribeImpl.cpp",
Expand Down
108 changes: 108 additions & 0 deletions src/controller/data_model/controller-clusters.matter
Original file line number Diff line number Diff line change
Expand Up @@ -2800,6 +2800,114 @@ client cluster AirQuality = 91 {
readonly attribute int16u clusterRevision = 65533;
}

/** This cluster provides an interface for observing and managing the state of smoke and CO alarms. */
client cluster SmokeCoAlarm = 92 {
enum AlarmStateEnum : ENUM8 {
kUnknown = 0;
kNormal = 1;
kWarning = 2;
kCritical = 3;
}

enum ContaminationStateEnum : ENUM8 {
kUnknown = 0;
kNormal = 1;
kLow = 2;
kWarning = 3;
kCritical = 4;
}

enum EndOfServiceEnum : ENUM8 {
kUnknown = 0;
kExpired = 1;
kNormal = 2;
}

enum ExpressedStateEnum : ENUM8 {
kNormal = 0;
kSmokeAlarm = 1;
kCOAlarm = 2;
kBatteryAlert = 3;
kTesting = 4;
kHardwareFault = 5;
kEndOfService = 6;
kInterconnectSmoke = 7;
kInterconnectCO = 8;
}

enum MuteStateEnum : ENUM8 {
kUnknown = 0;
kNotMuted = 1;
kMuted = 2;
}

enum SensitivityEnum : ENUM8 {
kHigh = 0;
kStandard = 1;
kLow = 2;
}

bitmap SmokeCOAlarmFeature : BITMAP32 {
kSmokeAlarm = 0x1;
kCoAlarm = 0x2;
}

info event SmokeAlarm = 0 {
}

info event COAlarm = 1 {
}

info event LowBattery = 2 {
}

info event HardwareFault = 3 {
}

info event EndOfService = 4 {
}

info event SelfTestComplete = 5 {
}

info event AlarmMuted = 6 {
}

info event MuteEnded = 7 {
}

info event InterconnectSmokeAlarm = 8 {
}

info event InterconnectCOAlarm = 9 {
}

info event AllClear = 10 {
}

readonly attribute ExpressedStateEnum expressedState = 0;
readonly attribute optional AlarmStateEnum smokeState = 1;
readonly attribute optional AlarmStateEnum COState = 2;
readonly attribute AlarmStateEnum batteryAlert = 3;
readonly attribute optional MuteStateEnum deviceMuted = 4;
readonly attribute boolean testInProgress = 5;
readonly attribute boolean hardwareFaultAlert = 6;
readonly attribute EndOfServiceEnum endOfServiceAlert = 7;
readonly attribute optional AlarmStateEnum interconnectSmokeAlarm = 8;
readonly attribute optional AlarmStateEnum interconnectCOAlarm = 9;
readonly attribute optional ContaminationStateEnum contaminationState = 10;
attribute optional SensitivityEnum sensitivityLevel = 11;
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;

/** This command SHALL initiate a device self-test. */
command SelfTestRequest(): DefaultSuccess = 0;
}

/** Attributes and commands for monitoring HEPA filters in a device */
client cluster HepaFilterMonitoring = 113 {
enum ChangeIndicationEnum : ENUM8 {
Expand Down
Loading