Skip to content

Commit

Permalink
XMLs for valve configuration and control cluster, and boolean sensor …
Browse files Browse the repository at this point in the history
…configuration cluster & device types (#29787)

Co-authored-by: Boris Zbarsky <[email protected]>
  • Loading branch information
2 people authored and pull[bot] committed Dec 22, 2023
1 parent 6ca798e commit df4f330
Show file tree
Hide file tree
Showing 64 changed files with 55,634 additions and 0 deletions.
2 changes: 2 additions & 0 deletions src/app/util/util.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -158,6 +158,8 @@ void MatterRefrigeratorAndTemperatureControlledCabinetModePluginServerInitCallba
void MatterOperationalStatePluginServerInitCallback() {}
void MatterRvcOperationalStatePluginServerInitCallback() {}
void MatterDishwasherAlarmPluginServerInitCallback() {}
void MatterBooleanSensorConfigurationPluginServerInitCallback() {}
void MatterValveConfigurationAndControlPluginServerInitCallback() {}
// ****************************************
// Print out information about each cluster
// ****************************************
Expand Down
2 changes: 2 additions & 0 deletions src/app/zap-templates/zcl/data-model/all.xml
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
<xi:include href="chip/ballast-configuration-cluster.xml" />
<xi:include href="chip/basic-information-cluster.xml" />
<xi:include href="chip/binding-cluster.xml" />
<xi:include href="chip/boolean-sensor-configuration-cluster.xml" />
<xi:include href="chip/boolean-state-cluster.xml" />
<xi:include href="chip/actions-cluster.xml" />
<xi:include href="chip/bridged-device-basic-information.xml" />
Expand Down Expand Up @@ -85,6 +86,7 @@
<xi:include href="chip/channel-cluster.xml" />
<xi:include href="chip/user-label-cluster.xml" />
<xi:include href="chip/unit-localization-cluster.xml" />
<xi:include href="chip/valve-configuration-and-control-cluster.xml" />
<xi:include href="chip/wake-on-lan-cluster.xml" />
<xi:include href="chip/washer-controls-cluster.xml" />
<xi:include href="chip/wifi-network-diagnostics-cluster.xml" />
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,71 @@
<?xml version="1.0"?>
<!--
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.
-->
<configurator>
<domain name="CHIP"/>

<bitmap name="Feature" type="bitmap32">
<cluster code="0x0080"/>
<field name="Visual" mask="0x1"/>
<field name="Audible" mask="0x2"/>
<field name="AlarmSuppress" mask="0x4"/>
<field name="SensitivityLevel" mask="0x8"/>
</bitmap>

<bitmap name="AlarmModeBitmap" type="bitmap8">
<cluster code="0x0080"/>
<field name="Visual" mask="0x1"/>
<field name="Audible" mask="0x2"/>
</bitmap>

<enum name="SensitivityEnum" type="enum8">
<cluster code="0x0080"/>
<item name="High" value="0x0"/>
<item name="Standard" value="0x1"/>
<item name="Low" value="0x2"/>
</enum>

<cluster apiMaturity="provisional">
<name>Boolean Sensor Configuration</name>
<domain>Measurement &amp; Sensing</domain>
<code>0x0080</code>
<define>BOOLEAN_SENSOR_CONFIGURATION_CLUSTER</define>
<client tick="false" init="false">true</client>
<server tick="false" init="false">true</server>
<description>This cluster is used to configure a boolean sensor.</description>
<globalAttribute side="either" code="0xFFFD" value="1"/>

<attribute side="server" code="0x0000" define="SENSITIVITY_LEVEL" type="SensitivityEnum" isNullable="false" min="0" max="2" writable="true" optional="true">SensitivityLevel</attribute>
<attribute side="server" code="0x0001" define="ALARMS_ACTIVE" type="AlarmModeBitmap" isNullable="false" writable="false" optional="true">AlarmsActive</attribute>
<attribute side="server" code="0x0002" define="ALARMS_SUPPRESSED" type="AlarmModeBitmap" isNullable="false" writable="false" optional="true">AlarmsSuppressed</attribute>
<attribute side="server" code="0x0003" define="ALARMS_ENABLED" type="AlarmModeBitmap" isNullable="false" writable="true" optional="true">AlarmsEnabled</attribute>

<command source="client" code="0x00" name="SuppressRequest" optional="true">
<description>This command is used to suppress the specified alarm.</description>
<arg name="AlarmsToSuppress" type="AlarmModeBitmap"/>
</command>

<event side="server" code="0x00" priority="info" name="AlarmsStateChanged" optional="true">
<description>This event SHALL be generated when any bits in the AlarmsActive and/or AlarmsSuppressed attributes change.</description>
<field id="0" name="AlarmsActive" type="AlarmModeBitmap"/>
<field id="1" name="AlarmsSuppressed" type="AlarmModeBitmap" optional="true"/>
</event>

<event side="server" code="0x01" priority="info" name="SensorFault" optional="true">
<description>This event SHALL be generated when the device detects a sensor fault.</description>
</event>
</cluster>
</configurator>
48 changes: 48 additions & 0 deletions src/app/zap-templates/zcl/data-model/chip/matter-devices.xml
Original file line number Diff line number Diff line change
Expand Up @@ -2032,6 +2032,54 @@ limitations under the License.
<include cluster="Refrigerator And Temperature Controlled Cabinet Mode" client="false" server="false" clientLocked="true" serverLocked="false"></include>
</clusters>
</deviceType>
<deviceType>
<name>MA-boolean-sensor</name>
<domain>CHIP</domain>
<typeName>Matter Boolean Sensor</typeName>
<profileId editable="false">0x0103</profileId>
<deviceId editable="false">0x0041</deviceId>
<class>Simple</class>
<scope>Endpoint</scope>
<clusters lockOthers="true">
<include cluster="Identify" client="false" server="true" clientLocked="true" serverLocked="true"></include>
<include cluster="Boolean State" client="false" server="true" clientLocked="true" serverLocked="true"></include>
<include cluster="Descriptor" client="false" server="true" clientLocked="true" serverLocked="true">
<requireAttribute>TAG_LIST</requireAttribute>
</include>
</clusters>
</deviceType>
<deviceType>
<name>MA-valve</name>
<domain>CHIP</domain>
<typeName>Matter Valve</typeName>
<profileId editable="false">0x0103</profileId>
<deviceId editable="false">0x0042</deviceId>
<class>Simple</class>
<scope>Endpoint</scope>
<clusters lockOthers="true">
<include cluster="Identify" client="false" server="true" clientLocked="true" serverLocked="true"></include>
<include cluster="Valve Configuration and Control" client="false" server="true" clientLocked="true" serverLocked="true"></include>
<include cluster="Descriptor" client="false" server="true" clientLocked="true" serverLocked="true"></include>
</clusters>
</deviceType>
<deviceType>
<name>MA-water-leak-detector</name>
<domain>CHIP</domain>
<typeName>Matter Water Leak Detector</typeName>
<profileId editable="false">0x0103</profileId>
<deviceId editable="false">0x0043</deviceId>
<class>Simple</class>
<scope>Endpoint</scope>
<superset>Matter Boolean Sensor</superset>
<clusters lockOthers="true">
<include cluster="Identify" client="false" server="true" clientLocked="true" serverLocked="true"></include>
<include cluster="Boolean State" client="false" server="true" clientLocked="true" serverLocked="true"></include>
<include cluster="Boolean Sensor Configuration" client="false" server="true" clientLocked="true" serverLocked="true"></include>
<include cluster="Descriptor" client="false" server="true" clientLocked="true" serverLocked="true">
<requireAttribute>TAG_LIST</requireAttribute>
</include>
</clusters>
</deviceType>
<deviceType>
<name>MA-all-clusters-app</name>
<domain>CHIP</domain>
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,99 @@
<?xml version="1.0"?>
<!--
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.
-->
<configurator>
<domain name="CHIP"/>

<bitmap name="Feature" type="bitmap32">
<cluster code="0x0081"/>
<field name="TimeSync" mask="0x1"/>
<field name="Level" mask="0x2"/>
</bitmap>

<bitmap name="ValveFaultBitmap" type="bitmap16">
<cluster code="0x0081"/>
<field name="GeneralFault" mask="0x1"/>
<field name="Blocked" mask="0x2"/>
<field name="Leaking" mask="0x4"/>
</bitmap>

<enum name="ValveStateEnum" type="enum8">
<cluster code="0x0081"/>
<item name="Open" value="0x0"/>
<item name="Closed" value="0x1"/>
</enum>

<cluster apiMaturity="provisional">
<name>Valve Configuration and Control</name>
<domain>HVAC</domain>
<code>0x0081</code>
<define>VALVE_CONFIGURATION_AND_CONTROL_CLUSTER</define>
<client tick="false" init="false">true</client>
<server tick="false" init="false">true</server>
<description>This cluster is used to configure a valve.</description>
<globalAttribute side="either" code="0xFFFD" value="1"/>

<!-- min max definition for attribute size larger than 2 bytes is not allowed by zap codegen https://github.com/project-chip/zap/issues/1187 -->
<!-- Therefore, this check needs to be done in code. -->
<attribute side="server" code="0x0000" define="OPEN_DURATION" type="elapsed_s" isNullable="true" writable="true" optional="false">
<description>OpenDuration</description>
<access op="read" privilege="view"/>
<access op="write" privilege="manage"/>
</attribute>
<attribute side="server" code="0x0001" define="AUTO_CLOSE_TIME" type="epoch_us" isNullable="true" writable="false" optional="true">AutoCloseTime</attribute>
<attribute side="server" code="0x0002" define="REMAINING_DURATION" type="elapsed_s" isNullable="true" writable="false" optional="true">RemainingDuration</attribute>
<attribute side="server" code="0x0003" define="CURRENT_STATE" type="ValveStateEnum" isNullable="true" writable="false" optional="false">CurrentState</attribute>
<attribute side="server" code="0x0004" define="TARGET_STATE" type="ValveStateEnum" isNullable="true" writable="false" optional="false">TargetState</attribute>
<attribute side="server" code="0x0005" define="START_UP_STATE" type="ValveStateEnum" isNullable="false" writable="true" optional="true">
<description>StartUpState</description>
<access op="read" privilege="view"/>
<access op="write" privilege="manage"/>
</attribute>
<attribute side="server" code="0x0006" define="CURRENT_LEVEL" type="percent" isNullable="true" min="0" max="100" writable="false" optional="true">CurrentLevel</attribute>
<attribute side="server" code="0x0007" define="TARGET_LEVEL" type="percent" isNullable="true" min="0" max="100" writable="false" optional="true">TargetLevel</attribute>
<attribute side="server" code="0x0008" define="OPEN_LEVEL" type="percent" isNullable="true" min="1" max="100" writable="true" default="100" optional="true">
<description>OpenLevel</description>
<access op="read" privilege="view"/>
<access op="write" privilege="manage"/>
</attribute>
<attribute side="server" code="0x0009" define="VALVE_FAULT" type="ValveFaultBitmap" isNullable="false" writable="false" optional="true">ValveFault</attribute>

<command source="client" code="0x00" name="Open" optional="false">
<description>This command is used to set the valve to its fully open position.</description>
<arg name="OpenDuration" type="elapsed_s" optional="true"/>
</command>

<command source="client" code="0x01" name="Close" optional="false">
<description>This command is used to set the valve to its fully closed position.</description>
</command>

<command source="client" code="0x02" name="SetLevel" optional="true">
<description>This command is used to set the valve to a specific level.</description>
<arg name="Level" type="percent"/>
<arg name="OpenDuration" type="elapsed_s" optional="true"/>
</command>

<event side="server" code="0x00" priority="info" name="ValveStateChanged" optional="true">
<description>This event SHALL be generated when the valve changes state, either opens or closes.</description>
<field id="0" name="ValveState" type="ValveStateEnum"/>
</event>

<event side="server" code="0x01" priority="info" name="ValveFault" optional="true">
<description>This event SHALL be generated when the valve registers a fault.</description>
<field id="0" name="ValveFault" type="ValveFaultBitmap"/>
</event>
</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 @@ -24,6 +24,7 @@
"barrier-control-cluster.xml",
"basic-information-cluster.xml",
"binding-cluster.xml",
"boolean-sensor-configuration-cluster.xml",
"boolean-state-cluster.xml",
"actions-cluster.xml",
"bridged-device-basic-information.xml",
Expand Down Expand Up @@ -104,6 +105,7 @@
"timer-cluster.xml",
"user-label-cluster.xml",
"unit-localization-cluster.xml",
"valve-configuration-and-control-cluster.xml",
"wake-on-lan-cluster.xml",
"washer-controls-cluster.xml",
"wifi-network-diagnostics-cluster.xml",
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 @@ -23,6 +23,7 @@
"barrier-control-cluster.xml",
"basic-information-cluster.xml",
"binding-cluster.xml",
"boolean-sensor-configuration-cluster.xml",
"boolean-state-cluster.xml",
"actions-cluster.xml",
"bridged-device-basic-information.xml",
Expand Down Expand Up @@ -102,6 +103,7 @@
"timer-cluster.xml",
"user-label-cluster.xml",
"unit-localization-cluster.xml",
"valve-configuration-and-control-cluster.xml",
"wake-on-lan-cluster.xml",
"washer-controls-cluster.xml",
"wifi-network-diagnostics-cluster.xml",
Expand Down
4 changes: 4 additions & 0 deletions src/app/zap_cluster_list.json
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@
"BASIC_INFORMATION_CLUSTER": [],
"BINARY_INPUT_BASIC_CLUSTER": [],
"BINDING_CLUSTER": [],
"BOOLEAN_SENSOR_CONFIGURATION_CLUSTER": [],
"BOOLEAN_STATE_CLUSTER": [],
"BRIDGED_DEVICE_BASIC_INFORMATION_CLUSTER": [],
"CARBON_DIOXIDE_CONCENTRATION_MEASUREMENT_CLUSTER": [],
Expand Down Expand Up @@ -110,6 +111,7 @@
"UNIT_TESTING_CLUSTER": [],
"USER_LABEL_CLUSTER": [],
"TVOC_CONCENTRATION_MEASUREMENT_CLUSTER": [],
"VALVE_CONFIGURATION_AND_CONTROL_CLUSTER": [],
"WAKE_ON_LAN_CLUSTER": [],
"LAUNDRY_WASHER_CONTROLS_CLUSTER": [],
"WIFI_NETWORK_DIAGNOSTICS_CLUSTER": [],
Expand All @@ -136,6 +138,7 @@
"BASIC_INFORMATION_CLUSTER": ["basic-information"],
"BINARY_INPUT_BASIC_CLUSTER": [],
"BINDING_CLUSTER": ["bindings"],
"BOOLEAN_SENSOR_CONFIGURATION_CLUSTER": [],
"BOOLEAN_STATE_CLUSTER": [],
"BRIDGED_DEVICE_BASIC_INFORMATION_CLUSTER": [
"bridged-device-basic-information-server"
Expand Down Expand Up @@ -263,6 +266,7 @@
"UNIT_LOCALIZATION_CLUSTER": [],
"UNIT_TESTING_CLUSTER": ["test-cluster-server"],
"USER_LABEL_CLUSTER": ["user-label-server"],
"VALVE_CONFIGURATION_AND_CONTROL_CLUSTER": [],
"WAKE_ON_LAN_CLUSTER": ["wake-on-lan-server"],
"LAUNDRY_WASHER_CONTROLS_CLUSTER": ["laundry-washer-controls-server"],
"WIFI_NETWORK_DIAGNOSTICS_CLUSTER": ["wifi-network-diagnostics-server"],
Expand Down
Loading

0 comments on commit df4f330

Please sign in to comment.