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

【Feature】dishwasher operational state cluster xml #26949

Closed
Show file tree
Hide file tree
Changes from all commits
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 @@ -167,6 +167,7 @@ jobs:
src/app/zap-templates/zcl/data-model/chip/onoff-cluster.xml \
src/app/zap-templates/zcl/data-model/chip/operational-credentials-cluster.xml \
src/app/zap-templates/zcl/data-model/chip/operational-state-cluster.xml \
src/app/zap-templates/zcl/data-model/chip/operational-state-dishwasher-cluster.xml \
src/app/zap-templates/zcl/data-model/chip/pressure-measurement-cluster.xml \
src/app/zap-templates/zcl/data-model/chip/power-source-cluster.xml \
src/app/zap-templates/zcl/data-model/chip/power-source-configuration-cluster.xml \
Expand Down
1 change: 1 addition & 0 deletions scripts/rules.matterlint
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,7 @@ load "../src/app/zap-templates/zcl/data-model/chip/occupancy-sensing-cluster.xml
load "../src/app/zap-templates/zcl/data-model/chip/onoff-cluster.xml";
load "../src/app/zap-templates/zcl/data-model/chip/operational-credentials-cluster.xml";
load "../src/app/zap-templates/zcl/data-model/chip/operational-state-cluster.xml";
load "../src/app/zap-templates/zcl/data-model/chip/operational-state-dishwasher-cluster.xml";
load "../src/app/zap-templates/zcl/data-model/chip/power-source-cluster.xml";
load "../src/app/zap-templates/zcl/data-model/chip/power-source-configuration-cluster.xml";
load "../src/app/zap-templates/zcl/data-model/chip/pressure-measurement-cluster.xml";
Expand Down
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 @@ -49,6 +49,7 @@
<xi:include href="chip/onoff-cluster.xml" />
<xi:include href="chip/operational-credentials-cluster.xml" />
<xi:include href="chip/operational-state-cluster.xml" />
<xi:include href="chip/operational-state-dishasher-cluster.xml" />
<xi:include href="chip/pressure-measurement-cluster.xml" />
<xi:include href="chip/power-source-cluster.xml" />
<xi:include href="chip/power-source-configuration-cluster.xml" />
Expand Down
Copy link
Contributor

Choose a reason for hiding this comment

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

Original file line number Diff line number Diff line change
@@ -0,0 +1,107 @@
<?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"/>

<enum name="OperationalStateEnum" type="ENUM8">
mideayanghui marked this conversation as resolved.
Show resolved Hide resolved
<cluster code="0x005A"/>
<item name="Stopped" value="0x00"/>
mideayanghui marked this conversation as resolved.
Show resolved Hide resolved
<item name="Running" value="0x01"/>
<item name="Paused" value="0x02"/>
<item name="Error" value="0x03"/>
</enum>

<enum name="ErrorStateEnum" type="ENUM8">
<cluster code="0x005A"/>
<item name="NoError" value="0x00"/>
mideayanghui marked this conversation as resolved.
Show resolved Hide resolved
Copy link
Contributor

@plauric plauric Jun 8, 2023

Choose a reason for hiding this comment

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

Similar comment to my previous one. The values from the generic Operational State cluster (0x01 to 0x03) should not be redefined here. This enum should only include those specific to this cluster derivation (0x40 to 0x45).

Please see what was done for the Mode Select cluster and its derivations, in this merged PR:

https://github.com/project-chip/connectedhomeip/pull/26508/files#

src/app/zap-templates/zcl/data-model/chip/dishwasher-mode-select-cluster.xml

Copy link
Contributor

Choose a reason for hiding this comment

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

Sorry, I'm not sure why this was marked as resolved. Please clarify.

<item name="UnableToStartOrResume" value="0x01"/>
<item name="UnableToCompleteOperation" value="0x02"/>
<item name="CommandInvalidInState" value="0x03"/>
<item name="InflowError" value="0x40"/>
Copy link
Contributor

Choose a reason for hiding this comment

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

Could you point me to where these Dishwasher specific errors are defined in the spec?

Copy link
Contributor

Choose a reason for hiding this comment

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

They used to be there, then got removed in https://github.com/CHIP-Specifications/connectedhomeip-spec/pull/7070

Hence my question above about what changes this XML needs as a result.

<item name="DrainError" value="0x41"/>
<item name="DoorError" value="0x42"/>
<item name="TempTooLow" value="0x43"/>
<item name="TempTooHigh" value="0x44"/>
<item name="WaterLevelError" value="0x45"/>
</enum>

<struct name="OperationalStateStruct">
mideayanghui marked this conversation as resolved.
Show resolved Hide resolved
<cluster code="0x005A"/>
<item name="OperationalStateID" type="OperationalStateEnum" optional="false"/>
<item name="OperationalStateLabel" type="CHAR_STRING" optional="false" length="64"/>
</struct>

<struct name="ErrorStateStruct">
mideayanghui marked this conversation as resolved.
Show resolved Hide resolved
<cluster code="0x005A"/>
<item name="ErrorStateID" type="ErrorStateEnum" optional="false" />
<item name="ErrorStateLabel" type="CHAR_STRING" optional="false" isNullable="true" length="64"/>
<item name="ErrorStateDetails" type="CHAR_STRING" optional="true" length="64"/>
</struct>

<cluster>
<domain>Appliances</domain>
<name>Dishwasher Operational State</name>
<code>0x005A</code>
<define>OPERATIONAL_STATE_DISHWASHER_CLUSTER</define>
<client init="false" tick="false">true</client>
<server init="false" tick="false">true</server>
<description>This cluster supports remotely monitoring and, where supported, changing the operational state of a Dishwasher.</description>

<globalAttribute side="server" code="0xFFFD" value="1" />

<attribute side="server" code="0x0000" define="PHASE_LIST" type="ARRAY" entryType="CHAR_STRING" writable="false" isNullable="true" optional="false">PhaseList</attribute>
<attribute side="server" code="0x0001" define="CURRENT_PHASE" type="INT8U" min="0x00" max="0x1F" writable="false" isNullable="true" optional="false">CurrentPhase</attribute>
<attribute side="server" code="0x0002" define="COUNTDOWN_TIME" type="elapsed_s" min="0x00" max="2529200" writable="false" isNullable="true" optional="true">CountdownTime</attribute>
<attribute side="server" code="0x0003" define="OPERATIONAL_STATE_LIST" type="ARRAY" entryType="OperationalStateStruct" writable="false" optional="false">OperationalStateList</attribute>
<attribute side="server" code="0x0004" define="OPERATIONAL_STATE" type="OperationalStateStruct" writable="false" optional="false">OperationalState</attribute>
<attribute side="server" code="0x0005" define="OPERATIONAL_ERROR" type="ErrorStateStruct" writable="false" optional="false">OperationalError</attribute>

<command source="client" code="0x00" name="Pause" response="OperationalCommandResponse" optional="true">
<description>Upon receipt, the device SHALL pause its operation if it is possible based on the current function of the server.</description>
</command>

<command source="client" code="0x01" name="Stop" response="OperationalCommandResponse" optional="true">
<description>Upon receipt, the device SHALL stop its operation if it is at a position where it is safe to do so and/or permitted.</description>
</command>

<command source="client" code="0x02" name="Start" response="OperationalCommandResponse" optional="true">
<description>Upon receipt, the device SHALL start its operation if it is safe to do so and the device is in an operational state from which it can be started.</description>
</command>

<command source="client" code="0x03" name="Resume" response="OperationalCommandResponse" optional="true">
<description>Upon receipt, the device SHALL resume its operation from the point it was at when it received the Pause command, or from the point when it was paused by means outside of this cluster (for example by manual button press).</description>
</command>

<command source="server" code="0x04" name="OperationalCommandResponse" optional="true">
<description>This command SHALL be generated in response to any of the Start, Stop, Pause, or Resume commands.</description>
<arg name="CommandResponseState" type="ErrorStateStruct"/>
</command>

<event side="server" code="0x00" priority="critical" name="OperationalError" optional="false">
<description>OperationalError</description>
<field id="0" name="ErrorState" type="ErrorStateStruct" />
</event>

<event side="server" code="0x01" priority="info" name="OperationCompletion" optional="true">
<description>OperationCompletion</description>
<field id="0" name="CompletionErrorCode" type="ErrorStateEnum" />
<field id="1" name="TotalOperationalTime" type="elapsed_s" isNullable="true" optional="true"/>
<field id="2" name="PausedTime" type="elapsed_s" isNullable="true" optional="true"/>
</event>

</cluster>
</configurator>
4 changes: 3 additions & 1 deletion src/app/zap-templates/zcl/zcl-with-test-extensions.json
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,7 @@
"onoff-switch-configuration-cluster.xml",
"operational-credentials-cluster.xml",
"operational-state-cluster.xml",
"operational-state-dishwasher-cluster.xml",
"pressure-measurement-cluster.xml",
"power-source-cluster.xml",
"power-source-configuration-cluster.xml",
Expand Down Expand Up @@ -300,7 +301,8 @@
"LocalTime"
],
"Temperature Control": ["SupportedTemperatureLevels"],
"Operational State": ["OperationalState", "OperationalError"]
"Operational State": ["OperationalState", "OperationalError"],
"Dishwasher Operational State": ["OperationalState", "OperationalError"]
plauric marked this conversation as resolved.
Show resolved Hide resolved
},
"defaultReportingPolicy": "mandatory",
"ZCLDataTypes": ["ARRAY", "BITMAP", "ENUM", "NUMBER", "STRING", "STRUCT"],
Expand Down
4 changes: 3 additions & 1 deletion src/app/zap-templates/zcl/zcl.json
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,7 @@
"onoff-switch-configuration-cluster.xml",
"operational-credentials-cluster.xml",
"operational-state-cluster.xml",
"operational-state-dishwasher-cluster.xml",
"pressure-measurement-cluster.xml",
"power-source-cluster.xml",
"power-source-configuration-cluster.xml",
Expand Down Expand Up @@ -298,7 +299,8 @@
"LocalTime"
],
"Temperature Control": ["SupportedTemperatureLevels"],
"Operational State": ["OperationalState", "OperationalError"]
"Operational State": ["OperationalState", "OperationalError"],
"Dishwasher Operational State": ["OperationalState", "OperationalError"]
plauric marked this conversation as resolved.
Show resolved Hide resolved
},
"defaultReportingPolicy": "mandatory",
"ZCLDataTypes": ["ARRAY", "BITMAP", "ENUM", "NUMBER", "STRING", "STRUCT"],
Expand Down
1 change: 1 addition & 0 deletions src/app/zap_cluster_list.json
Original file line number Diff line number Diff line change
Expand Up @@ -84,6 +84,7 @@
"ON_OFF_SWITCH_CONFIGURATION_CLUSTER": [],
"OPERATIONAL_CREDENTIALS_CLUSTER": [],
"OPERATIONAL_STATE_CLUSTER": [],
"OPERATIONAL_STATE_DISHWASHER_CLUSTER": [],
"OTA_BOOTLOAD_CLUSTER": [],
"OTA_SOFTWARE_UPDATE_PROVIDER_CLUSTER": [],
"OTA_SOFTWARE_UPDATE_REQUESTOR_CLUSTER": [],
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 @@ -202,6 +202,8 @@ if (current_os == "android" || matter_enable_java_compilation) {
"jni/OperationalCredentialsClient-ReadImpl.cpp",
"jni/OperationalStateClient-InvokeSubscribeImpl.cpp",
"jni/OperationalStateClient-ReadImpl.cpp",
"jni/DishwasherOperationalStateClient-InvokeSubscribeImpl.cpp",
"jni/DishwasherOperationalStateClient-ReadImpl.cpp",
"jni/OtaSoftwareUpdateProviderClient-InvokeSubscribeImpl.cpp",
"jni/OtaSoftwareUpdateProviderClient-ReadImpl.cpp",
"jni/OtaSoftwareUpdateRequestorClient-InvokeSubscribeImpl.cpp",
Expand Down
70 changes: 70 additions & 0 deletions src/controller/data_model/controller-clusters.matter
Original file line number Diff line number Diff line change
Expand Up @@ -3208,6 +3208,76 @@ client cluster DishwasherModeSelect = 89 {
command ChangeToModeWithStatus(ChangeToModeWithStatusRequest): ChangeToModeResponse = 1;
}

/** This cluster supports remotely monitoring and, where supported, changing the operational state of a Dishwasher. */
client cluster DishwasherOperationalState = 90 {
enum ErrorStateEnum : ENUM8 {
kNoError = 0;
kUnableToStartOrResume = 1;
kUnableToCompleteOperation = 2;
kCommandInvalidInState = 3;
kInflowError = 64;
kDrainError = 65;
kDoorError = 66;
kTempTooLow = 67;
kTempTooHigh = 68;
kWaterLevelError = 69;
}

enum OperationalStateEnum : ENUM8 {
kStopped = 0;
kRunning = 1;
kPaused = 2;
kError = 3;
}

struct ErrorStateStruct {
ErrorStateEnum errorStateID = 0;
nullable char_string<64> errorStateLabel = 1;
optional char_string<64> errorStateDetails = 2;
}

struct OperationalStateStruct {
OperationalStateEnum operationalStateID = 0;
char_string<64> operationalStateLabel = 1;
}

critical event OperationalError = 0 {
ErrorStateStruct errorState = 0;
}

info event OperationCompletion = 1 {
ErrorStateEnum completionErrorCode = 0;
optional nullable elapsed_s totalOperationalTime = 1;
optional nullable elapsed_s pausedTime = 2;
}

readonly attribute nullable CHAR_STRING phaseList[] = 0;
readonly attribute nullable int8u currentPhase = 1;
readonly attribute optional nullable elapsed_s countdownTime = 2;
readonly attribute OperationalStateStruct operationalStateList[] = 3;
readonly attribute OperationalStateStruct operationalState = 4;
readonly attribute ErrorStateStruct operationalError = 5;
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;

response struct OperationalCommandResponse = 4 {
ErrorStateStruct commandResponseState = 0;
}

/** Upon receipt, the device SHALL pause its operation if it is possible based on the current function of the server. */
command Pause(): OperationalCommandResponse = 0;
/** Upon receipt, the device SHALL stop its operation if it is at a position where it is safe to do so and/or permitted. */
command Stop(): OperationalCommandResponse = 1;
/** Upon receipt, the device SHALL start its operation if it is safe to do so and the device is in an operational state from which it can be started. */
command Start(): OperationalCommandResponse = 2;
/** Upon receipt, the device SHALL resume its operation from the point it was at when it received the Pause command, or from the point when it was paused by means outside of this cluster (for example by manual button press). */
command Resume(): OperationalCommandResponse = 3;
}

/** Attributes for reporting air quality classification */
client cluster AirQuality = 91 {
enum AirQualityEnum : ENUM8 {
Expand Down
Loading