From 1069192a7cfbbebfafe153544f53ffa9ca0c49bb Mon Sep 17 00:00:00 2001 From: raju-apple <84206864+raju-apple@users.noreply.github.com> Date: Wed, 29 Sep 2021 18:23:25 -0700 Subject: [PATCH] Adding 3 new Yamls and also splitting existing Color Cluster Yaml to match the cert test cases (#10050) * Add new Yamls and splitting the CC Yamls to seperate ones to match the cert tests * Update generated tests * Restyled by whitespace * Restyled by prettier-yaml Co-authored-by: Restyled.io --- .../chip-tool/templates/tests-commands.zapt | 2 +- .../suites/certification/Test_TC_CC_3_1.yaml | 138 + .../suites/certification/Test_TC_CC_3_2.yaml | 139 + .../suites/certification/Test_TC_CC_3_3.yaml | 99 + .../suites/certification/Test_TC_CC_3_4.yaml | 428 - .../suites/certification/Test_TC_CC_4_1.yaml | 71 + .../suites/certification/Test_TC_CC_4_2.yaml | 86 + .../suites/certification/Test_TC_CC_4_3.yaml | 97 + .../suites/certification/Test_TC_CC_4_4.yaml | 91 + .../suites/certification/Test_TC_CC_5_1.yaml | 93 + ...{Test_TC_CC_5.yaml => Test_TC_CC_5_2.yaml} | 54 +- .../suites/certification/Test_TC_CC_5_3.yaml | 93 + .../suites/certification/Test_TC_CC_6_1.yaml | 71 + ...{Test_TC_CC_6.yaml => Test_TC_CC_6_2.yaml} | 68 +- .../suites/certification/Test_TC_CC_6_3.yaml | 102 + .../suites/certification/Test_TC_CC_7_1.yaml | 74 + ...{Test_TC_CC_7.yaml => Test_TC_CC_7_2.yaml} | 106 +- .../suites/certification/Test_TC_CC_7_3.yaml | 99 + .../suites/certification/Test_TC_CC_7_4.yaml | 86 + ...{Test_TC_CC_8.yaml => Test_TC_CC_8_1.yaml} | 2 +- .../suites/certification/Test_TC_PCC_2_1.yaml | 835 ++ .../suites/certification/Test_TC_TM_2_1.yaml | 57 + .../certification/Test_TC_TSUIC_2_1.yaml | 122 + .../CHIP/templates/clusters-tests.zapt | 2 +- .../Framework/CHIPTests/CHIPClustersTests.m | 4008 ++++++--- .../chip-tool/zap-generated/test/Commands.h | 7988 ++++++++++++----- 26 files changed, 10662 insertions(+), 4349 deletions(-) create mode 100644 src/app/tests/suites/certification/Test_TC_CC_3_1.yaml create mode 100644 src/app/tests/suites/certification/Test_TC_CC_3_2.yaml create mode 100644 src/app/tests/suites/certification/Test_TC_CC_3_3.yaml delete mode 100644 src/app/tests/suites/certification/Test_TC_CC_3_4.yaml create mode 100644 src/app/tests/suites/certification/Test_TC_CC_4_1.yaml create mode 100644 src/app/tests/suites/certification/Test_TC_CC_4_2.yaml create mode 100644 src/app/tests/suites/certification/Test_TC_CC_4_3.yaml create mode 100644 src/app/tests/suites/certification/Test_TC_CC_4_4.yaml create mode 100644 src/app/tests/suites/certification/Test_TC_CC_5_1.yaml rename src/app/tests/suites/certification/{Test_TC_CC_5.yaml => Test_TC_CC_5_2.yaml} (70%) create mode 100644 src/app/tests/suites/certification/Test_TC_CC_5_3.yaml create mode 100644 src/app/tests/suites/certification/Test_TC_CC_6_1.yaml rename src/app/tests/suites/certification/{Test_TC_CC_6.yaml => Test_TC_CC_6_2.yaml} (63%) create mode 100644 src/app/tests/suites/certification/Test_TC_CC_6_3.yaml create mode 100644 src/app/tests/suites/certification/Test_TC_CC_7_1.yaml rename src/app/tests/suites/certification/{Test_TC_CC_7.yaml => Test_TC_CC_7_2.yaml} (52%) create mode 100644 src/app/tests/suites/certification/Test_TC_CC_7_3.yaml create mode 100644 src/app/tests/suites/certification/Test_TC_CC_7_4.yaml rename src/app/tests/suites/certification/{Test_TC_CC_8.yaml => Test_TC_CC_8_1.yaml} (98%) create mode 100644 src/app/tests/suites/certification/Test_TC_PCC_2_1.yaml create mode 100644 src/app/tests/suites/certification/Test_TC_TM_2_1.yaml create mode 100644 src/app/tests/suites/certification/Test_TC_TSUIC_2_1.yaml diff --git a/examples/chip-tool/templates/tests-commands.zapt b/examples/chip-tool/templates/tests-commands.zapt index cb6d6e1af9fe80..a69d591237f3eb 100644 --- a/examples/chip-tool/templates/tests-commands.zapt +++ b/examples/chip-tool/templates/tests-commands.zapt @@ -4,4 +4,4 @@ #include -{{>test_cluster tests="TV_TargetNavigatorCluster, TV_AudioOutputCluster, TV_ApplicationLauncherCluster, TV_KeypadInputCluster, TV_AccountLoginCluster, TV_WakeOnLanCluster, TV_ApplicationBasicCluster, TV_MediaPlaybackCluster, TV_TvChannelCluster, TV_LowPowerCluster, TV_MediaInputCluster, TestCluster, TestConstraints, TestDelayCommands, TestSubscribe_OnOff, Test_TC_OO_1_1, Test_TC_OO_2_1, Test_TC_OO_2_2, Test_TC_DM_1_1, Test_TC_DM_3_1, Test_TC_CC_3_4, Test_TC_CC_5, Test_TC_CC_6, Test_TC_CC_7, Test_TC_CC_8, Test_TC_WNCV_1_1, Test_TC_WNCV_2_1, Test_TC_WNCV_3_1, Test_TC_WNCV_3_2, Test_TC_WNCV_3_3, Test_TC_BI_1_1, Test_TC_FLW_1_1, Test_TC_TM_1_1, Test_TC_OCC_1_1, TestOperationalCredentialsCluster, Test_TC_LVL_1_1, Test_TC_CC_1_1, Test_TC_RH_1_1, Test_TC_MC_1_1, Test_TC_TSTAT_1_1, Test_TC_PCC_1_1, Test_TC_TSUIC_1_1, Test_TC_DIAGTH_1_1"}} +{{>test_cluster tests="TV_TargetNavigatorCluster, TV_AudioOutputCluster, TV_ApplicationLauncherCluster, TV_KeypadInputCluster, TV_AccountLoginCluster, TV_WakeOnLanCluster, TV_ApplicationBasicCluster, TV_MediaPlaybackCluster, TV_TvChannelCluster, TV_LowPowerCluster, TV_MediaInputCluster, TestCluster, TestConstraints, TestDelayCommands, TestSubscribe_OnOff, Test_TC_OO_1_1, Test_TC_OO_2_1, Test_TC_OO_2_2, Test_TC_DM_1_1, Test_TC_DM_3_1, Test_TC_WNCV_1_1, Test_TC_WNCV_2_1, Test_TC_WNCV_3_1, Test_TC_WNCV_3_2, Test_TC_WNCV_3_3, Test_TC_BI_1_1, Test_TC_FLW_1_1, Test_TC_TM_1_1, Test_TC_OCC_1_1, TestOperationalCredentialsCluster, Test_TC_LVL_1_1, Test_TC_CC_1_1, Test_TC_RH_1_1, Test_TC_MC_1_1, Test_TC_TSTAT_1_1, Test_TC_PCC_1_1, Test_TC_TSUIC_1_1, Test_TC_DIAGTH_1_1, Test_TC_TM_2_1, Test_TC_TSUIC_2_1, Test_TC_PCC_2_1, Test_TC_CC_3_1, Test_TC_CC_3_2, Test_TC_CC_3_3, Test_TC_CC_4_1, Test_TC_CC_4_2, Test_TC_CC_4_3, Test_TC_CC_4_4, Test_TC_CC_5_1, Test_TC_CC_5_2, Test_TC_CC_5_3, Test_TC_CC_6_1, Test_TC_CC_6_2, Test_TC_CC_6_3, Test_TC_CC_7_1, Test_TC_CC_7_2, Test_TC_CC_7_3, Test_TC_CC_7_4, Test_TC_CC_8_1"}} diff --git a/src/app/tests/suites/certification/Test_TC_CC_3_1.yaml b/src/app/tests/suites/certification/Test_TC_CC_3_1.yaml new file mode 100644 index 00000000000000..adaf4f5507bd32 --- /dev/null +++ b/src/app/tests/suites/certification/Test_TC_CC_3_1.yaml @@ -0,0 +1,138 @@ +# Copyright (c) 2021 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. + +name: 27.2.2. [TC-CC-3.1] Hue MoveTo functionality with server as DUT + +config: + cluster: "Color Control" + endpoint: 1 + +tests: + - label: "Turn on light for color control tests" + cluster: "On/Off" + command: "on" + + - label: "Check on/off attribute value is true after on command" + cluster: "On/Off" + command: "readAttribute" + attribute: "OnOff" + response: + value: 1 + + - label: "Move to hue shortest distance command" + command: "MoveToHue" + arguments: + values: + - name: "hue" + value: 150 + - name: "direction" + value: 0 + - name: "transitionTime" + value: 100 + - name: "optionsMask" + value: 0 + - name: "optionsOverride" + value: 0 + + - label: + "Check current hue attribute value matched the value sent by the last + command" + disabled: true + command: "readAttribute" + attribute: "current hue" + response: + value: 150 + + - label: "Move to hue longest distance command" + command: "MoveToHue" + arguments: + values: + - name: "hue" + value: 200 + - name: "direction" + value: 1 + - name: "transitionTime" + value: 100 + - name: "optionsMask" + value: 0 + - name: "optionsOverride" + value: 0 + + - label: + "Check current hue attribute value matched the value sent by the last + command" + disabled: true + command: "readAttribute" + attribute: "current hue" + response: + value: 150 + + - label: "Move to hue up command" + command: "MoveToHue" + arguments: + values: + - name: "hue" + value: 250 + - name: "direction" + value: 2 + - name: "transitionTime" + value: 100 + - name: "optionsMask" + value: 0 + - name: "optionsOverride" + value: 0 + + - label: + "Check current hue attribute value matched the value sent by the last + command" + disabled: true + command: "readAttribute" + attribute: "current hue" + response: + value: 250 + + - label: "Move to hue down command" + command: "MoveToHue" + arguments: + values: + - name: "hue" + value: 225 + - name: "direction" + value: 3 + - name: "transitionTime" + value: 100 + - name: "optionsMask" + value: 0 + - name: "optionsOverride" + value: 0 + + - label: + "Check current hue attribute value matched the value sent by the last + command" + disabled: true + command: "readAttribute" + attribute: "current hue" + response: + value: 225 + + - label: "Turn off light that we turned on" + cluster: "On/Off" + command: "off" + + - label: "Check on/off attribute value is false after off command" + cluster: "On/Off" + command: "readAttribute" + attribute: "OnOff" + response: + value: 0 diff --git a/src/app/tests/suites/certification/Test_TC_CC_3_2.yaml b/src/app/tests/suites/certification/Test_TC_CC_3_2.yaml new file mode 100644 index 00000000000000..4d041984abfac7 --- /dev/null +++ b/src/app/tests/suites/certification/Test_TC_CC_3_2.yaml @@ -0,0 +1,139 @@ +# Copyright (c) 2021 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. + +name: 27.2.3. [TC-CC-3.2] Hue Move functionality with server as DUT + +config: + cluster: "Color Control" + endpoint: 1 + +tests: + - label: "Turn on light for color control tests" + cluster: "On/Off" + command: "on" + + - label: "Check on/off attribute value is true after on command" + cluster: "On/Off" + command: "readAttribute" + attribute: "OnOff" + response: + value: 1 + + - label: + "Check current hue attribute value matched the value sent by the last + command" + disabled: true + command: "readAttribute" + attribute: "current hue" + response: + value: 150 + + - label: "Move hue up command" + command: "MoveHue" + arguments: + values: + - name: "moveMode" + value: 1 + - name: "rate" + value: 50 + - name: "optionsMask" + value: 0 + - name: "optionsOverride" + value: 0 + + - label: + "Check current hue attribute value matched the value sent by the last + command" + disabled: true + command: "readAttribute" + attribute: "current hue" + response: + value: -1 + + - label: "Move hue stop command" + command: "MoveHue" + arguments: + values: + - name: "moveMode" + value: 0 + - name: "rate" + value: 50 + - name: "optionsMask" + value: 0 + - name: "optionsOverride" + value: 0 + + - label: + "Check current hue attribute value matched the value sent by the last + command" + disabled: true + command: "readAttribute" + attribute: "current hue" + response: + value: -1 + + - label: "Move hue down command" + command: "MoveHue" + arguments: + values: + - name: "moveMode" + value: 3 + - name: "rate" + value: 50 + - name: "optionsMask" + value: 0 + - name: "optionsOverride" + value: 0 + + - label: + "Check current hue attribute value matched the value sent by the last + command" + disabled: true + command: "readAttribute" + attribute: "current hue" + response: + value: -1 + + - label: "Move hue stop command" + command: "MoveHue" + arguments: + values: + - name: "moveMode" + value: 0 + - name: "rate" + value: 50 + - name: "optionsMask" + value: 0 + - name: "optionsOverride" + value: 0 + + - label: + "Check current hue attribute value matched the value sent by the last + command" + disabled: true + command: "readAttribute" + attribute: "current hue" + response: + value: -1 + + - label: "Turn off light that we turned on" + cluster: "On/Off" + command: "off" + + - label: "Check on/off attribute value is false after off command" + cluster: "On/Off" + command: "readAttribute" + attribute: "OnOff" + response: + value: 0 diff --git a/src/app/tests/suites/certification/Test_TC_CC_3_3.yaml b/src/app/tests/suites/certification/Test_TC_CC_3_3.yaml new file mode 100644 index 00000000000000..7a7aeb323ba236 --- /dev/null +++ b/src/app/tests/suites/certification/Test_TC_CC_3_3.yaml @@ -0,0 +1,99 @@ +# Copyright (c) 2021 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. + +name: 27.2.4. [TC-CC-3.3] Hue Step functionality with server as DUT + +config: + cluster: "Color Control" + endpoint: 1 + +tests: + - label: "Turn on light for color control tests" + cluster: "On/Off" + command: "on" + + - label: "Check on/off attribute value is true after on command" + cluster: "On/Off" + command: "readAttribute" + attribute: "OnOff" + response: + value: 1 + + - label: + "Check current hue attribute value matched the value sent by the last + command" + disabled: true + command: "readAttribute" + attribute: "current hue" + response: + value: 150 + + - label: "Step hue up command" + command: "StepHue" + arguments: + values: + - name: "stepMode" + value: 1 + - name: "stepSize" + value: 5 + - name: "transitionTime" + value: 25 + - name: "optionsMask" + value: 0 + - name: "optionsOverride" + value: 0 + + - label: + "Check current hue attribute value matched the value sent by the last + command" + disabled: true + command: "readAttribute" + attribute: "current hue" + response: + value: -1 + + - label: "Step hue down command" + command: "StepHue" + arguments: + values: + - name: "stepMode" + value: 3 + - name: "stepSize" + value: 5 + - name: "transitionTime" + value: 25 + - name: "optionsMask" + value: 0 + - name: "optionsOverride" + value: 0 + + - label: + "Check current hue attribute value matched the value sent by the last + command" + disabled: true + command: "readAttribute" + attribute: "current hue" + response: + value: -1 + + - label: "Turn off light that we turned on" + cluster: "On/Off" + command: "off" + + - label: "Check on/off attribute value is false after off command" + cluster: "On/Off" + command: "readAttribute" + attribute: "OnOff" + response: + value: 0 diff --git a/src/app/tests/suites/certification/Test_TC_CC_3_4.yaml b/src/app/tests/suites/certification/Test_TC_CC_3_4.yaml deleted file mode 100644 index e99e2d57d41bab..00000000000000 --- a/src/app/tests/suites/certification/Test_TC_CC_3_4.yaml +++ /dev/null @@ -1,428 +0,0 @@ -# Copyright (c) 2021 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. - -name: - 3.2.15. [TC-CC-3.1 to 3.3 and 4.1 to 4.4] Color Hue and Saturation Controls - -config: - cluster: "Color Control" - endpoint: 1 - -tests: - - label: "Turn on light for color control tests" - cluster: "On/Off" - command: "on" - - - label: "Check on/off attribute value is true after on command" - cluster: "On/Off" - command: "readAttribute" - attribute: "OnOff" - response: - value: 1 - - - label: "Move to hue shortest distance command" - command: "MoveToHue" - arguments: - values: - - name: "hue" - value: 150 - - name: "direction" - value: 0 - - name: "transitionTime" - value: 100 - - name: "optionsMask" - value: 0 - - name: "optionsOverride" - value: 0 - - - label: - "Check current hue attribute value matched the value sent by the last - command" - disabled: true - command: "readAttribute" - attribute: "current hue" - response: - value: 150 - - - label: "Move to hue longest distance command" - command: "MoveToHue" - arguments: - values: - - name: "hue" - value: 200 - - name: "direction" - value: 1 - - name: "transitionTime" - value: 100 - - name: "optionsMask" - value: 0 - - name: "optionsOverride" - value: 0 - - - label: - "Check current hue attribute value matched the value sent by the last - command" - disabled: true - command: "readAttribute" - attribute: "current hue" - response: - value: 150 - - - label: "Move to hue up command" - command: "MoveToHue" - arguments: - values: - - name: "hue" - value: 250 - - name: "direction" - value: 2 - - name: "transitionTime" - value: 100 - - name: "optionsMask" - value: 0 - - name: "optionsOverride" - value: 0 - - - label: - "Check current hue attribute value matched the value sent by the last - command" - disabled: true - command: "readAttribute" - attribute: "current hue" - response: - value: 250 - - - label: "Move to hue down command" - command: "MoveToHue" - arguments: - values: - - name: "hue" - value: 225 - - name: "direction" - value: 3 - - name: "transitionTime" - value: 100 - - name: "optionsMask" - value: 0 - - name: "optionsOverride" - value: 0 - - - label: - "Check current hue attribute value matched the value sent by the last - command" - disabled: true - command: "readAttribute" - attribute: "current hue" - response: - value: 225 - - - label: "Move hue up command" - command: "MoveHue" - arguments: - values: - - name: "moveMode" - value: 1 - - name: "rate" - value: 50 - - name: "optionsMask" - value: 0 - - name: "optionsOverride" - value: 0 - - - label: - "Check current hue attribute value matched the value sent by the last - command" - disabled: true - command: "readAttribute" - attribute: "current hue" - response: - value: -1 - - - label: "Move hue stop command" - command: "MoveHue" - arguments: - values: - - name: "moveMode" - value: 0 - - name: "rate" - value: 50 - - name: "optionsMask" - value: 0 - - name: "optionsOverride" - value: 0 - - - label: - "Check current hue attribute value matched the value sent by the last - command" - disabled: true - command: "readAttribute" - attribute: "current hue" - response: - value: -1 - - - label: "Move hue down command" - command: "MoveHue" - arguments: - values: - - name: "moveMode" - value: 3 - - name: "rate" - value: 50 - - name: "optionsMask" - value: 0 - - name: "optionsOverride" - value: 0 - - - label: - "Check current hue attribute value matched the value sent by the last - command" - disabled: true - command: "readAttribute" - attribute: "current hue" - response: - value: -1 - - - label: "Move hue stop command" - command: "MoveHue" - arguments: - values: - - name: "moveMode" - value: 0 - - name: "rate" - value: 50 - - name: "optionsMask" - value: 0 - - name: "optionsOverride" - value: 0 - - - label: - "Check current hue attribute value matched the value sent by the last - command" - disabled: true - command: "readAttribute" - attribute: "current hue" - response: - value: -1 - - - label: "Step hue up command" - command: "StepHue" - arguments: - values: - - name: "stepMode" - value: 1 - - name: "stepSize" - value: 5 - - name: "transitionTime" - value: 25 - - name: "optionsMask" - value: 0 - - name: "optionsOverride" - value: 0 - - - label: - "Check current hue attribute value matched the value sent by the last - command" - disabled: true - command: "readAttribute" - attribute: "current hue" - response: - value: -1 - - - label: "Step hue down command" - command: "StepHue" - arguments: - values: - - name: "stepMode" - value: 3 - - name: "stepSize" - value: 5 - - name: "transitionTime" - value: 25 - - name: "optionsMask" - value: 0 - - name: "optionsOverride" - value: 0 - - - label: - "Check current hue attribute value matched the value sent by the last - command" - disabled: true - command: "readAttribute" - attribute: "current hue" - response: - value: -1 - - - label: "Check Saturation attribute value matched before any change" - disabled: true - command: "readAttribute" - attribute: "current saturation" - response: - value: 90 - - - label: "Move to saturation command" - command: "MoveToSaturation" - arguments: - values: - - name: "saturation" - value: 90 - - name: "transitionTime" - value: 10 - - name: "optionsMask" - value: 0 - - name: "optionsOverride" - value: 0 - - - label: - "Check Saturation attribute value matched the value sent by the last - command" - disabled: true - command: "readAttribute" - attribute: "current saturation" - response: - value: 90 - - - label: "Move saturation up command" - command: "MoveSaturation" - arguments: - values: - - name: "moveMode" - value: 1 - - name: "rate" - value: 5 - - name: "optionsMask" - value: 0 - - name: "optionsOverride" - value: 0 - - - label: - "Check Saturation attribute value matched the value sent by the last - command" - disabled: true - command: "readAttribute" - attribute: "current saturation" - response: - value: -1 - - - label: "Move saturation down command" - command: "MoveSaturation" - arguments: - values: - - name: "moveMode" - value: 3 - - name: "rate" - value: 5 - - name: "optionsMask" - value: 0 - - name: "optionsOverride" - value: 0 - - - label: - "Check Saturation attribute value matched the value sent by the last - command" - disabled: true - command: "readAttribute" - attribute: "current saturation" - response: - value: -1 - - - label: "Step saturation up command" - command: "StepSaturation" - arguments: - values: - - name: "stepMode" - value: 1 - - name: "stepSize" - value: 15 - - name: "transitionTime" - value: 10 - - name: "optionsMask" - value: 0 - - name: "optionsOverride" - value: 0 - - - label: - "Check Saturation attribute value matched the value sent by the last - command" - disabled: true - command: "readAttribute" - attribute: "current saturation" - response: - value: -1 - - - label: "Step saturation down command" - command: "StepSaturation" - arguments: - values: - - name: "stepMode" - value: 3 - - name: "stepSize" - value: 20 - - name: "transitionTime" - value: 10 - - name: "optionsMask" - value: 0 - - name: "optionsOverride" - value: 0 - - - label: - "Check Saturation attribute value matched the value sent by the last - command" - disabled: true - command: "readAttribute" - attribute: "current saturation" - response: - value: -1 - - - label: "Move To current hue and saturation command" - command: "MoveToHueAndSaturation" - arguments: - values: - - name: "hue" - value: 40 - - name: "saturation" - value: 160 - - name: "transitionTime" - value: 10 - - name: "optionsMask" - value: 0 - - name: "optionsOverride" - value: 0 - - label: - "Check current hue attribute value matched the value sent by the last - command" - disabled: true - command: "readAttribute" - attribute: "current hue" - response: - value: 40 - - - label: - "Check Saturation attribute value matched the value sent by the last - command" - disabled: true - command: "readAttribute" - attribute: "current saturation" - response: - value: 160 - - - label: "Turn off light that we turned on" - cluster: "On/Off" - command: "off" - - - label: "Check on/off attribute value is false after off command" - cluster: "On/Off" - command: "readAttribute" - attribute: "OnOff" - response: - value: 0 diff --git a/src/app/tests/suites/certification/Test_TC_CC_4_1.yaml b/src/app/tests/suites/certification/Test_TC_CC_4_1.yaml new file mode 100644 index 00000000000000..7fde6110df1171 --- /dev/null +++ b/src/app/tests/suites/certification/Test_TC_CC_4_1.yaml @@ -0,0 +1,71 @@ +# Copyright (c) 2021 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. + +name: 27.2.5. [TC-CC-4.1] Saturation MoveTo functionality with server as DUT + +config: + cluster: "Color Control" + endpoint: 1 + +tests: + - label: "Turn on light for color control tests" + cluster: "On/Off" + command: "on" + + - label: "Check on/off attribute value is true after on command" + cluster: "On/Off" + command: "readAttribute" + attribute: "OnOff" + response: + value: 1 + + - label: "Check Saturation attribute value matched before any change" + disabled: true + command: "readAttribute" + attribute: "current saturation" + response: + value: 90 + + - label: "Move to saturation command" + command: "MoveToSaturation" + arguments: + values: + - name: "saturation" + value: 90 + - name: "transitionTime" + value: 10 + - name: "optionsMask" + value: 0 + - name: "optionsOverride" + value: 0 + + - label: + "Check Saturation attribute value matched the value sent by the last + command" + disabled: true + command: "readAttribute" + attribute: "current saturation" + response: + value: 90 + + - label: "Turn off light that we turned on" + cluster: "On/Off" + command: "off" + + - label: "Check on/off attribute value is false after off command" + cluster: "On/Off" + command: "readAttribute" + attribute: "OnOff" + response: + value: 0 diff --git a/src/app/tests/suites/certification/Test_TC_CC_4_2.yaml b/src/app/tests/suites/certification/Test_TC_CC_4_2.yaml new file mode 100644 index 00000000000000..067ff74e7ace2d --- /dev/null +++ b/src/app/tests/suites/certification/Test_TC_CC_4_2.yaml @@ -0,0 +1,86 @@ +# Copyright (c) 2021 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. + +name: 27.2.6. [TC-CC-4.2] Saturation Move functionality with server as DUT + +config: + cluster: "Color Control" + endpoint: 1 + +tests: + - label: "Turn on light for color control tests" + cluster: "On/Off" + command: "on" + + - label: "Check on/off attribute value is true after on command" + cluster: "On/Off" + command: "readAttribute" + attribute: "OnOff" + response: + value: 1 + + - label: + "Check Saturation attribute value matched the value sent by the last + command" + disabled: true + command: "readAttribute" + attribute: "current saturation" + response: + value: 90 + + - label: "Move saturation up command" + command: "MoveSaturation" + arguments: + values: + - name: "moveMode" + value: 1 + - name: "rate" + value: 5 + - name: "optionsMask" + value: 0 + - name: "optionsOverride" + value: 0 + + - label: + "Check Saturation attribute value matched the value sent by the last + command" + disabled: true + command: "readAttribute" + attribute: "current saturation" + response: + value: -1 + + - label: "Move saturation down command" + command: "MoveSaturation" + arguments: + values: + - name: "moveMode" + value: 3 + - name: "rate" + value: 5 + - name: "optionsMask" + value: 0 + - name: "optionsOverride" + value: 0 + + - label: "Turn off light that we turned on" + cluster: "On/Off" + command: "off" + + - label: "Check on/off attribute value is false after off command" + cluster: "On/Off" + command: "readAttribute" + attribute: "OnOff" + response: + value: 0 diff --git a/src/app/tests/suites/certification/Test_TC_CC_4_3.yaml b/src/app/tests/suites/certification/Test_TC_CC_4_3.yaml new file mode 100644 index 00000000000000..55941c4cc5b5bd --- /dev/null +++ b/src/app/tests/suites/certification/Test_TC_CC_4_3.yaml @@ -0,0 +1,97 @@ +# Copyright (c) 2021 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. + +name: 27.2.7. [TC-CC-4.3] Saturation Step functionality with server as DUT + +config: + cluster: "Color Control" + endpoint: 1 + +tests: + - label: "Turn on light for color control tests" + cluster: "On/Off" + command: "on" + + - label: "Check on/off attribute value is true after on command" + cluster: "On/Off" + command: "readAttribute" + attribute: "OnOff" + response: + value: 1 + + - label: "Check Saturation attribute value matched before any change" + disabled: true + command: "readAttribute" + attribute: "current saturation" + response: + value: 90 + + - label: "Step saturation up command" + command: "StepSaturation" + arguments: + values: + - name: "stepMode" + value: 1 + - name: "stepSize" + value: 15 + - name: "transitionTime" + value: 10 + - name: "optionsMask" + value: 0 + - name: "optionsOverride" + value: 0 + + - label: + "Check Saturation attribute value matched the value sent by the last + command" + disabled: true + command: "readAttribute" + attribute: "current saturation" + response: + value: -1 + + - label: "Step saturation down command" + command: "StepSaturation" + arguments: + values: + - name: "stepMode" + value: 3 + - name: "stepSize" + value: 20 + - name: "transitionTime" + value: 10 + - name: "optionsMask" + value: 0 + - name: "optionsOverride" + value: 0 + + - label: + "Check Saturation attribute value matched the value sent by the last + command" + disabled: true + command: "readAttribute" + attribute: "current saturation" + response: + value: -1 + + - label: "Turn off light that we turned on" + cluster: "On/Off" + command: "off" + + - label: "Check on/off attribute value is false after off command" + cluster: "On/Off" + command: "readAttribute" + attribute: "OnOff" + response: + value: 0 diff --git a/src/app/tests/suites/certification/Test_TC_CC_4_4.yaml b/src/app/tests/suites/certification/Test_TC_CC_4_4.yaml new file mode 100644 index 00000000000000..f222e8f5575dde --- /dev/null +++ b/src/app/tests/suites/certification/Test_TC_CC_4_4.yaml @@ -0,0 +1,91 @@ +# Copyright (c) 2021 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. + +name: + 27.2.8. [TC-CC-4.4] MoveToHueAndSaturation functionality with server as DUT + +config: + cluster: "Color Control" + endpoint: 1 + +tests: + - label: "Turn on light for color control tests" + cluster: "On/Off" + command: "on" + + - label: "Check on/off attribute value is true after on command" + cluster: "On/Off" + command: "readAttribute" + attribute: "OnOff" + response: + value: 1 + + - label: + "Check current hue attribute value matched the value sent by the last + command" + disabled: true + command: "readAttribute" + attribute: "current hue" + response: + value: 250 + + - label: "Check Saturation attribute value matched before any change" + disabled: true + command: "readAttribute" + attribute: "current saturation" + response: + value: 90 + + - label: "Move To current hue and saturation command" + command: "MoveToHueAndSaturation" + arguments: + values: + - name: "hue" + value: 40 + - name: "saturation" + value: 160 + - name: "transitionTime" + value: 10 + - name: "optionsMask" + value: 0 + - name: "optionsOverride" + value: 0 + - label: + "Check current hue attribute value matched the value sent by the last + command" + disabled: true + command: "readAttribute" + attribute: "current hue" + response: + value: 40 + + - label: + "Check Saturation attribute value matched the value sent by the last + command" + disabled: true + command: "readAttribute" + attribute: "current saturation" + response: + value: 160 + + - label: "Turn off light that we turned on" + cluster: "On/Off" + command: "off" + + - label: "Check on/off attribute value is false after off command" + cluster: "On/Off" + command: "readAttribute" + attribute: "OnOff" + response: + value: 0 diff --git a/src/app/tests/suites/certification/Test_TC_CC_5_1.yaml b/src/app/tests/suites/certification/Test_TC_CC_5_1.yaml new file mode 100644 index 00000000000000..1494c9519c5b61 --- /dev/null +++ b/src/app/tests/suites/certification/Test_TC_CC_5_1.yaml @@ -0,0 +1,93 @@ +# Copyright (c) 2021 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. + +name: 27.2.9. [TC-CC-5.1] Color MoveTo functionality with server as DUT + +config: + cluster: "Color Control" + endpoint: 1 + +tests: + - label: "Turn on light for color control tests" + cluster: "On/Off" + command: "on" + + - label: "Check on/off attribute value is true after on command" + cluster: "On/Off" + command: "readAttribute" + attribute: "OnOff" + response: + value: 1 + + - label: + "Check current x attribute value matched the value sent by the last + command" + disabled: true + command: "readAttribute" + attribute: "current x" + response: + value: 200 + + - label: + "Check current y attribute value matched the value sent by the last + command" + disabled: true + command: "readAttribute" + attribute: "current y" + response: + value: 300 + + - label: "Move to Color command" + command: "MoveToColor" + arguments: + values: + - name: "colorX" + value: 200 + - name: "colorY" + value: 300 + - name: "transitionTime" + value: 20 + - name: "optionsMask" + value: 0 + - name: "optionsOverride" + value: 0 + + - label: + "Check current x attribute value matched the value sent by the last + command" + disabled: true + command: "readAttribute" + attribute: "current x" + response: + value: 200 + + - label: + "Check current y attribute value matched the value sent by the last + command" + disabled: true + command: "readAttribute" + attribute: "current y" + response: + value: 300 + + - label: "Turn off light that we turned on" + cluster: "On/Off" + command: "off" + + - label: "Check on/off attribute value is false after off command" + cluster: "On/Off" + command: "readAttribute" + attribute: "OnOff" + response: + value: 0 diff --git a/src/app/tests/suites/certification/Test_TC_CC_5.yaml b/src/app/tests/suites/certification/Test_TC_CC_5_2.yaml similarity index 70% rename from src/app/tests/suites/certification/Test_TC_CC_5.yaml rename to src/app/tests/suites/certification/Test_TC_CC_5_2.yaml index 8035f79264a666..fcee7edef32ab1 100644 --- a/src/app/tests/suites/certification/Test_TC_CC_5.yaml +++ b/src/app/tests/suites/certification/Test_TC_CC_5_2.yaml @@ -12,7 +12,7 @@ # See the License for the specific language governing permissions and # limitations under the License. -name: 3.2.15. [TC-CC-5.1 to 5.3] Color XY Controls +name: 27.2.10. [TC-CC-5.2] Color Move functionality with server as DUT config: cluster: "Color Control" @@ -30,23 +30,8 @@ tests: response: value: 1 - - label: "Move to Color command" - command: "MoveToColor" - arguments: - values: - - name: "colorX" - value: 200 - - name: "colorY" - value: 300 - - name: "transitionTime" - value: 20 - - name: "optionsMask" - value: 0 - - name: "optionsOverride" - value: 0 - - label: - "Check current y attribute value matched the value sent by the last + "Check current x attribute value matched the value sent by the last command" disabled: true command: "readAttribute" @@ -55,7 +40,7 @@ tests: value: 200 - label: - "Check current x attribute value matched the value sent by the last + "Check current y attribute value matched the value sent by the last command" disabled: true command: "readAttribute" @@ -121,39 +106,6 @@ tests: response: value: -1 - - label: "Step Color command" - command: "StepColor" - arguments: - values: - - name: "stepX" - value: 15 - - name: "stepY" - value: 20 - - name: "transitionTime" - value: 50 - - name: "optionsMask" - value: 0 - - name: "optionsOverride" - value: 0 - - - label: - "Check current x attribute value matched the value sent by the last - command" - disabled: true - command: "readAttribute" - attribute: "current x" - response: - value: -1 - - - label: - "Check current y attribute value matched the value sent by the last - command" - disabled: true - command: "readAttribute" - attribute: "current y" - response: - value: -1 - - label: "Turn off light that we turned on" cluster: "On/Off" command: "off" diff --git a/src/app/tests/suites/certification/Test_TC_CC_5_3.yaml b/src/app/tests/suites/certification/Test_TC_CC_5_3.yaml new file mode 100644 index 00000000000000..917405473806b1 --- /dev/null +++ b/src/app/tests/suites/certification/Test_TC_CC_5_3.yaml @@ -0,0 +1,93 @@ +# Copyright (c) 2021 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. + +name: 27.2.11. [TC-CC-5.3] Color Step functionality with server as DUT + +config: + cluster: "Color Control" + endpoint: 1 + +tests: + - label: "Turn on light for color control tests" + cluster: "On/Off" + command: "on" + + - label: "Check on/off attribute value is true after on command" + cluster: "On/Off" + command: "readAttribute" + attribute: "OnOff" + response: + value: 1 + + - label: + "Check current x attribute value matched the value sent by the last + command" + disabled: true + command: "readAttribute" + attribute: "current x" + response: + value: 200 + + - label: + "Check current y attribute value matched the value sent by the last + command" + disabled: true + command: "readAttribute" + attribute: "current y" + response: + value: 300 + + - label: "Step Color command" + command: "StepColor" + arguments: + values: + - name: "stepX" + value: 15 + - name: "stepY" + value: 20 + - name: "transitionTime" + value: 50 + - name: "optionsMask" + value: 0 + - name: "optionsOverride" + value: 0 + + - label: + "Check current x attribute value matched the value sent by the last + command" + disabled: true + command: "readAttribute" + attribute: "current x" + response: + value: -1 + + - label: + "Check current y attribute value matched the value sent by the last + command" + disabled: true + command: "readAttribute" + attribute: "current y" + response: + value: -1 + + - label: "Turn off light that we turned on" + cluster: "On/Off" + command: "off" + + - label: "Check on/off attribute value is false after off command" + cluster: "On/Off" + command: "readAttribute" + attribute: "OnOff" + response: + value: 0 diff --git a/src/app/tests/suites/certification/Test_TC_CC_6_1.yaml b/src/app/tests/suites/certification/Test_TC_CC_6_1.yaml new file mode 100644 index 00000000000000..8b99f2c0d77fae --- /dev/null +++ b/src/app/tests/suites/certification/Test_TC_CC_6_1.yaml @@ -0,0 +1,71 @@ +# Copyright (c) 2021 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. + +name: + 27.2.12. [TC-CC-6.1] Color Temperature MoveTo functionality with server as + DUT + +config: + cluster: "Color Control" + endpoint: 1 + +tests: + - label: "Turn on light for color control tests" + cluster: "On/Off" + command: "on" + + - label: "Check on/off attribute value is true after on command" + cluster: "On/Off" + command: "readAttribute" + attribute: "OnOff" + response: + value: 1 + + - label: "Read current color temprature" + disabled: true + command: "readAttribute" + attribute: "color temperature" + response: + value: 100 + + - label: "Move To Color Temperature command" + command: "MoveToColorTemperature" + arguments: + values: + - name: "colorTemperature" + value: 100 + - name: "transitionTime" + value: 10 + - name: "optionsMask" + value: 0 + - name: "optionsOverride" + value: 0 + + - label: "Read current color temprature" + disabled: true + command: "readAttribute" + attribute: "color temperature" + response: + value: 100 + + - label: "Turn off light that we turned on" + cluster: "On/Off" + command: "off" + + - label: "Check on/off attribute value is false after off command" + cluster: "On/Off" + command: "readAttribute" + attribute: "OnOff" + response: + value: 0 diff --git a/src/app/tests/suites/certification/Test_TC_CC_6.yaml b/src/app/tests/suites/certification/Test_TC_CC_6_2.yaml similarity index 63% rename from src/app/tests/suites/certification/Test_TC_CC_6.yaml rename to src/app/tests/suites/certification/Test_TC_CC_6_2.yaml index 8eaad66af7ff35..d74d1506a94795 100644 --- a/src/app/tests/suites/certification/Test_TC_CC_6.yaml +++ b/src/app/tests/suites/certification/Test_TC_CC_6_2.yaml @@ -12,7 +12,8 @@ # See the License for the specific language governing permissions and # limitations under the License. -name: 3.2.15. [TC-CC-6.1 to 6.3] Color Temperature Controls +name: + 27.2.13. [TC-CC-6.2] Color Temperature Move functionality with server as DUT config: cluster: "Color Control" @@ -30,19 +31,6 @@ tests: response: value: 1 - - label: "Move To Color Temperature command" - command: "MoveToColorTemperature" - arguments: - values: - - name: "colorTemperature" - value: 100 - - name: "transitionTime" - value: 10 - - name: "optionsMask" - value: 0 - - name: "optionsOverride" - value: 0 - - label: "Read current color temprature" disabled: true command: "readAttribute" @@ -122,58 +110,6 @@ tests: response: value: -1 - - label: "Step up color temperature command" - command: "StepColorTemperature" - arguments: - values: - - name: "stepMode" - value: 1 - - name: "stepSize" - value: 5 - - name: "transitionTime" - value: 50 - - name: "colorTemperatureMinimum" - value: 5 - - name: "colorTemperatureMaximum" - value: 100 - - name: "optionsMask" - value: 0 - - name: "optionsOverride" - value: 0 - - - label: "Read current color temprature" - disabled: true - command: "readAttribute" - attribute: "color temperature" - response: - value: -1 - - - label: "Step down color temperature command" - command: "StepColorTemperature" - arguments: - values: - - name: "stepMode" - value: 3 - - name: "stepSize" - value: 5 - - name: "transitionTime" - value: 50 - - name: "colorTemperatureMinimum" - value: 5 - - name: "colorTemperatureMaximum" - value: 100 - - name: "optionsMask" - value: 0 - - name: "optionsOverride" - value: 0 - - - label: "Read current color temprature" - disabled: true - command: "readAttribute" - attribute: "color temperature" - response: - value: -1 - - label: "Turn off light that we turned on" cluster: "On/Off" command: "off" diff --git a/src/app/tests/suites/certification/Test_TC_CC_6_3.yaml b/src/app/tests/suites/certification/Test_TC_CC_6_3.yaml new file mode 100644 index 00000000000000..ba9f0f546689af --- /dev/null +++ b/src/app/tests/suites/certification/Test_TC_CC_6_3.yaml @@ -0,0 +1,102 @@ +# Copyright (c) 2021 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. + +name: + 27.2.14. [TC-CC-6.3] Color Temperature Step functionality with server as DUT + +config: + cluster: "Color Control" + endpoint: 1 + +tests: + - label: "Turn on light for color control tests" + cluster: "On/Off" + command: "on" + + - label: "Check on/off attribute value is true after on command" + cluster: "On/Off" + command: "readAttribute" + attribute: "OnOff" + response: + value: 1 + + - label: "Read current color temprature" + disabled: true + command: "readAttribute" + attribute: "color temperature" + response: + value: 100 + + - label: "Step up color temperature command" + command: "StepColorTemperature" + arguments: + values: + - name: "stepMode" + value: 1 + - name: "stepSize" + value: 5 + - name: "transitionTime" + value: 50 + - name: "colorTemperatureMinimum" + value: 5 + - name: "colorTemperatureMaximum" + value: 100 + - name: "optionsMask" + value: 0 + - name: "optionsOverride" + value: 0 + + - label: "Read current color temprature" + disabled: true + command: "readAttribute" + attribute: "color temperature" + response: + value: -1 + + - label: "Step down color temperature command" + command: "StepColorTemperature" + arguments: + values: + - name: "stepMode" + value: 3 + - name: "stepSize" + value: 5 + - name: "transitionTime" + value: 50 + - name: "colorTemperatureMinimum" + value: 5 + - name: "colorTemperatureMaximum" + value: 100 + - name: "optionsMask" + value: 0 + - name: "optionsOverride" + value: 0 + + - label: "Read current color temprature" + disabled: true + command: "readAttribute" + attribute: "color temperature" + response: + value: -1 + + - label: "Turn off light that we turned on" + cluster: "On/Off" + command: "off" + + - label: "Check on/off attribute value is false after off command" + cluster: "On/Off" + command: "readAttribute" + attribute: "OnOff" + response: + value: 0 diff --git a/src/app/tests/suites/certification/Test_TC_CC_7_1.yaml b/src/app/tests/suites/certification/Test_TC_CC_7_1.yaml new file mode 100644 index 00000000000000..221d9ef1452421 --- /dev/null +++ b/src/app/tests/suites/certification/Test_TC_CC_7_1.yaml @@ -0,0 +1,74 @@ +# Copyright (c) 2021 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. + +name: 27.2.15. [TC-CC-7.1] Enhanced MoveToHue functionality with server as DUT + +config: + cluster: "Color Control" + endpoint: 1 + +tests: + - label: "Turn on light for color control tests" + cluster: "On/Off" + command: "on" + + - label: "Check on/off attribute value is true after on command" + cluster: "On/Off" + command: "readAttribute" + attribute: "OnOff" + response: + value: 1 + + - label: "Enhanced Move To Hue command" + command: "EnhancedMoveToHue" + arguments: + values: + - name: "enhancedHue" + value: 1025 + - name: "direction" + value: 0 + - name: "transitionTime" + value: 1 + - name: "optionsMask" + value: 0 + - name: "optionsOverride" + value: 0 + + - label: + "Check Remaining time attribute value matched the value sent by the + last command" + command: "readAttribute" + attribute: "remaining time" + response: + value: 1 + + - label: + "Check EnhancedCurrentHue attribute value matched the value sent by + the last command" + disabled: true + command: "readAttribute" + attribute: "enhanced current hue" + response: + value: 1025 + + - label: "Turn off light that we turned on" + cluster: "On/Off" + command: "off" + + - label: "Check on/off attribute value is false after off command" + cluster: "On/Off" + command: "readAttribute" + attribute: "OnOff" + response: + value: 0 diff --git a/src/app/tests/suites/certification/Test_TC_CC_7.yaml b/src/app/tests/suites/certification/Test_TC_CC_7_2.yaml similarity index 52% rename from src/app/tests/suites/certification/Test_TC_CC_7.yaml rename to src/app/tests/suites/certification/Test_TC_CC_7_2.yaml index 660f4b15a732e3..b99f17b8d2959c 100644 --- a/src/app/tests/suites/certification/Test_TC_CC_7.yaml +++ b/src/app/tests/suites/certification/Test_TC_CC_7_2.yaml @@ -12,7 +12,7 @@ # See the License for the specific language governing permissions and # limitations under the License. -name: 3.2.15. [TC-CC-7.1 to 7.4] Enhanced Color Controls +name: 27.2.16. [TC-CC-7.2] Enhanced MoveHue functionality with server as DUT config: cluster: "Color Control" @@ -30,29 +30,6 @@ tests: response: value: 1 - - label: "Enhanced Move To Hue command" - command: "EnhancedMoveToHue" - arguments: - values: - - name: "enhancedHue" - value: 1025 - - name: "direction" - value: 0 - - name: "transitionTime" - value: 1 - - name: "optionsMask" - value: 0 - - name: "optionsOverride" - value: 0 - - - label: - "Check Remaining time attribute value matched the value sent by the - last command" - command: "readAttribute" - attribute: "remaining time" - response: - value: 1 - - label: "Check EnhancedCurrentHue attribute value matched the value sent by the last command" @@ -128,87 +105,6 @@ tests: response: value: -1 - - label: "Enhanced Step Hue Up command" - command: "EnhancedStepHue" - arguments: - values: - - name: "stepMode" - value: 0 - - name: "stepSize" - value: 50 - - name: "transitionTime" - value: 1 - - name: "optionsMask" - value: 0 - - name: "optionsOverride" - value: 0 - - - label: - "Check EnhancedCurrentHue attribute value matched the value sent by - the last command" - disabled: true - command: "readAttribute" - attribute: "enhanced current hue" - response: - value: 1075 - - - label: "Enhanced Step Hue Down command" - command: "EnhancedStepHue" - arguments: - values: - - name: "stepMode" - value: 1 - - name: "stepSize" - value: 75 - - name: "transitionTime" - value: 1 - - name: "optionsMask" - value: 0 - - name: "optionsOverride" - value: 0 - - - label: - "Check EnhancedCurrentHue attribute value matched the value sent by - the last command" - disabled: true - command: "readAttribute" - attribute: "enhanced current hue" - response: - value: 1000 - - - label: "Enhanced move to hue and saturation command" - command: "EnhancedMoveToHueAndSaturation" - arguments: - values: - - name: "enhancedHue" - value: 1200 - - name: "saturation" - value: 90 - - name: "transitionTime" - value: 10 - - name: "optionsMask" - value: 0 - - name: "optionsOverride" - value: 0 - - - label: - "Check EnhancedCurrentHue attribute value matched the value sent by - the last command" - disabled: true - command: "readAttribute" - attribute: "enhanced current hue" - response: - value: 1200 - - - label: - "Check Saturation attribute value matched the value sent by the last - command" - disabled: true - command: "readAttribute" - attribute: "current saturation" - response: - value: 90 - - label: "Turn off light that we turned on" cluster: "On/Off" command: "off" diff --git a/src/app/tests/suites/certification/Test_TC_CC_7_3.yaml b/src/app/tests/suites/certification/Test_TC_CC_7_3.yaml new file mode 100644 index 00000000000000..8a8c94ee491893 --- /dev/null +++ b/src/app/tests/suites/certification/Test_TC_CC_7_3.yaml @@ -0,0 +1,99 @@ +# Copyright (c) 2021 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. + +name: 27.2.17. [TC-CC-7.3] Enhanced Step functionality with server as DUT + +config: + cluster: "Color Control" + endpoint: 1 + +tests: + - label: "Turn on light for color control tests" + cluster: "On/Off" + command: "on" + + - label: "Check on/off attribute value is true after on command" + cluster: "On/Off" + command: "readAttribute" + attribute: "OnOff" + response: + value: 1 + + - label: + "Check EnhancedCurrentHue attribute value matched the value sent by + the last command" + disabled: true + command: "readAttribute" + attribute: "enhanced current hue" + response: + value: 1025 + + - label: "Enhanced Step Hue Up command" + command: "EnhancedStepHue" + arguments: + values: + - name: "stepMode" + value: 0 + - name: "stepSize" + value: 50 + - name: "transitionTime" + value: 1 + - name: "optionsMask" + value: 0 + - name: "optionsOverride" + value: 0 + + - label: + "Check EnhancedCurrentHue attribute value matched the value sent by + the last command" + disabled: true + command: "readAttribute" + attribute: "enhanced current hue" + response: + value: 1075 + + - label: "Enhanced Step Hue Down command" + command: "EnhancedStepHue" + arguments: + values: + - name: "stepMode" + value: 1 + - name: "stepSize" + value: 75 + - name: "transitionTime" + value: 1 + - name: "optionsMask" + value: 0 + - name: "optionsOverride" + value: 0 + + - label: + "Check EnhancedCurrentHue attribute value matched the value sent by + the last command" + disabled: true + command: "readAttribute" + attribute: "enhanced current hue" + response: + value: 1000 + + - label: "Turn off light that we turned on" + cluster: "On/Off" + command: "off" + + - label: "Check on/off attribute value is false after off command" + cluster: "On/Off" + command: "readAttribute" + attribute: "OnOff" + response: + value: 0 diff --git a/src/app/tests/suites/certification/Test_TC_CC_7_4.yaml b/src/app/tests/suites/certification/Test_TC_CC_7_4.yaml new file mode 100644 index 00000000000000..4bd9c71b3524cb --- /dev/null +++ b/src/app/tests/suites/certification/Test_TC_CC_7_4.yaml @@ -0,0 +1,86 @@ +# Copyright (c) 2021 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. + +name: + 27.2.18. [TC-CC-7.4] MoveToEnhancedHueAndSaturation functionality with + server as DUT + +config: + cluster: "Color Control" + endpoint: 1 + +tests: + - label: "Turn on light for color control tests" + cluster: "On/Off" + command: "on" + + - label: "Check on/off attribute value is true after on command" + cluster: "On/Off" + command: "readAttribute" + attribute: "OnOff" + response: + value: 1 + + - label: + "Check EnhancedCurrentHue attribute value matched the value sent by + the last command" + disabled: true + command: "readAttribute" + attribute: "enhanced current hue" + response: + value: 1025 + + - label: "Enhanced move to hue and saturation command" + command: "EnhancedMoveToHueAndSaturation" + arguments: + values: + - name: "enhancedHue" + value: 1200 + - name: "saturation" + value: 90 + - name: "transitionTime" + value: 10 + - name: "optionsMask" + value: 0 + - name: "optionsOverride" + value: 0 + + - label: + "Check EnhancedCurrentHue attribute value matched the value sent by + the last command" + disabled: true + command: "readAttribute" + attribute: "enhanced current hue" + response: + value: 1200 + + - label: + "Check Saturation attribute value matched the value sent by the last + command" + disabled: true + command: "readAttribute" + attribute: "current saturation" + response: + value: 90 + + - label: "Turn off light that we turned on" + cluster: "On/Off" + command: "off" + + - label: "Check on/off attribute value is false after off command" + cluster: "On/Off" + command: "readAttribute" + attribute: "OnOff" + response: + value: 0 diff --git a/src/app/tests/suites/certification/Test_TC_CC_8.yaml b/src/app/tests/suites/certification/Test_TC_CC_8_1.yaml similarity index 98% rename from src/app/tests/suites/certification/Test_TC_CC_8.yaml rename to src/app/tests/suites/certification/Test_TC_CC_8_1.yaml index 69731b48d85438..8dc94d083d5fa0 100644 --- a/src/app/tests/suites/certification/Test_TC_CC_8.yaml +++ b/src/app/tests/suites/certification/Test_TC_CC_8_1.yaml @@ -12,7 +12,7 @@ # See the License for the specific language governing permissions and # limitations under the License. -name: . [TC-CC-8] Color Loop Controls +name: 27.2.19. [TC-CC-8.1] StopMoveStep functionality with server as DUT config: cluster: "Color Control" diff --git a/src/app/tests/suites/certification/Test_TC_PCC_2_1.yaml b/src/app/tests/suites/certification/Test_TC_PCC_2_1.yaml new file mode 100644 index 00000000000000..c3fc9cd495cce8 --- /dev/null +++ b/src/app/tests/suites/certification/Test_TC_PCC_2_1.yaml @@ -0,0 +1,835 @@ +# Copyright (c) 2021 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. + +name: 15.2.1. [TC-PCC-2.1] Attributes with server as DUT + +config: + cluster: "Pump Configuration and Control" + endpoint: 1 + +tests: + - label: "read the mandatory attribute: MaxPressure" + disabled: true + command: "readAttribute" + attribute: "max pressure" + response: + value: null + + - label: "read the mandatory attribute: MaxPressure" + command: "readAttribute" + attribute: "max pressure" + response: + constraints: + type: int16 + + - label: "read the mandatory attribute: MaxSpeed" + disabled: true + command: "readAttribute" + attribute: "max speed" + response: + value: null + + - label: "read the mandatory attribute: MaxSpeed" + disabled: true + command: "readAttribute" + attribute: "max speed" + response: + constraints: + type: uint16 + + - label: "read the mandatory attribute: MaxFlow" + disabled: true + command: "readAttribute" + attribute: "max flow" + response: + value: null + + - label: "read the mandatory attribute: MaxFlow" + disabled: true + command: "readAttribute" + attribute: "max flow" + response: + constraints: + type: uint16 + + - label: "read the mandatory attribute: EffectiveOperationMode" + disabled: true + command: "readAttribute" + attribute: "effective operation mode" + response: + value: desc + + - label: "read the mandatory attribute: EffectiveOperationMode" + command: "readAttribute" + attribute: "effective operation mode" + response: + constraints: + type: enum8 + + - label: "read the mandatory attribute: EffectiveControlMode" + disabled: true + command: "readAttribute" + attribute: "effective control mode" + response: + value: desc + + - label: "read the mandatory attribute: EffectiveControlMode" + command: "readAttribute" + attribute: "effective control mode" + response: + constraints: + type: enum8 + + - label: "read the mandatory attribute: Capacity" + disabled: true + command: "readAttribute" + attribute: "capacity" + response: + value: null + + - label: "read the mandatory attribute: Capacity" + command: "readAttribute" + attribute: "capacity" + response: + constraints: + type: int16 + + - label: "write to the mandatory attribute: MaxPressure" + disabled: true + command: "writeAttribute" + attribute: "max pressure" + arguments: + value: null + response: + error: 1 + + - label: "write to the mandatory attribute: MaxSpeed" + disabled: true + command: "writeAttribute" + attribute: "max speed" + arguments: + value: null + response: + error: 1 + + - label: "write to the mandatory attribute: MaxFlow" + disabled: true + command: "writeAttribute" + attribute: "max flow" + arguments: + value: null + response: + error: 1 + + - label: "write to the mandatory attribute: EffectiveOperationMode" + disabled: true + command: "writeAttribute" + attribute: "effective operation mode" + arguments: + value: desc + response: + error: 1 + + - label: "write to the mandatory attribute: EffectiveControlMode" + disabled: true + command: "writeAttribute" + attribute: "effective control mode" + arguments: + value: desc + response: + error: 1 + + - label: "write to the mandatory attribute: Capacity" + disabled: true + command: "writeAttribute" + attribute: "capacity" + arguments: + value: null + response: + error: 1 + + - label: "read the mandatory attribute: MaxPressure" + disabled: true + command: "readAttribute" + attribute: "max pressure" + response: + value: null + + - label: "read the mandatory attribute: MaxPressure" + command: "readAttribute" + attribute: "max pressure" + response: + constraints: + type: int16 + + - label: "read the mandatory attribute: MaxSpeed" + disabled: true + command: "readAttribute" + attribute: "max speed" + response: + value: null + + - label: "read the mandatory attribute: MaxSpeed" + disabled: true + command: "readAttribute" + attribute: "max speed" + response: + constraints: + type: uint16 + + - label: "read the mandatory attribute: MaxFlow" + disabled: true + command: "readAttribute" + attribute: "max flow" + response: + value: null + + - label: "read the mandatory attribute: MaxFlow" + disabled: true + command: "readAttribute" + attribute: "max flow" + response: + constraints: + type: uint16 + + - label: "read the mandatory attribute: EffectiveOperationMode" + disabled: true + command: "readAttribute" + attribute: "effective operation mode" + response: + value: desc + + - label: "read the mandatory attribute: EffectiveOperationMode" + command: "readAttribute" + attribute: "effective operation mode" + response: + constraints: + type: enum8 + + - label: "read the mandatory attribute: EffectiveControlMode" + disabled: true + command: "readAttribute" + attribute: "effective control mode" + response: + value: desc + + - label: "read the mandatory attribute: EffectiveControlMode" + command: "readAttribute" + attribute: "effective control mode" + response: + constraints: + type: enum8 + + - label: "read the mandatory attribute: Capacity" + disabled: true + command: "readAttribute" + attribute: "capacity" + response: + value: null + + - label: "read the mandatory attribute: Capacity" + command: "readAttribute" + attribute: "capacity" + response: + constraints: + type: int16 + + - label: "read the optional attribute: MinConstPressure" + disabled: true + command: "readAttribute" + attribute: "MinConstPressure" + response: + value: null + + - label: "read the optional attribute: MinConstPressure" + disabled: true + command: "readAttribute" + attribute: "MinConstPressure" + response: + constraints: + type: int16 + + - label: "read the optional attribute: MaxConstPressure" + disabled: true + command: "readAttribute" + attribute: "MaxConstPressure" + response: + value: null + + - label: "read the optional attribute: MaxConstPressure" + disabled: true + command: "readAttribute" + attribute: "MaxConstPressure" + response: + constraints: + type: int16 + + - label: "read the optional attribute: MinCompPressure" + disabled: true + command: "readAttribute" + attribute: "MinCompPressure" + response: + value: null + + - label: "read the optional attribute: MinCompPressure" + disabled: true + command: "readAttribute" + attribute: "MinCompPressure" + response: + constraints: + type: int16 + + - label: "read the optional attribute: MaxCompPressure" + disabled: true + command: "readAttribute" + attribute: "MaxCompPressure" + response: + value: null + + - label: "read the optional attribute: MaxCompPressure" + disabled: true + command: "readAttribute" + attribute: "MaxCompPressure" + response: + constraints: + type: int16 + + - label: "read the optional attribute: MinConstSpeed" + disabled: true + command: "readAttribute" + attribute: "MinConstSpeed" + response: + value: null + + - label: "read the optional attribute: MinConstSpeed" + disabled: true + command: "readAttribute" + attribute: "MinConstSpeed" + response: + constraints: + type: uint16 + + - label: "read the optional attribute: MaxConstSpeed" + disabled: true + command: "readAttribute" + attribute: "MaxConstSpeed" + response: + value: null + + - label: "read the optional attribute: MaxConstSpeed" + disabled: true + command: "readAttribute" + attribute: "MaxConstSpeed" + response: + constraints: + type: uint16 + + - label: "read the optional attribute: MinConstFlow" + disabled: true + command: "readAttribute" + attribute: "MinConstFlow" + response: + value: null + + - label: "read the optional attribute: MinConstFlow" + disabled: true + command: "readAttribute" + attribute: "MinConstFlow" + response: + constraints: + type: uint16 + + - label: "read the optional attribute: MaxConstFlow" + disabled: true + command: "readAttribute" + attribute: "MaxConstFlow" + response: + value: null + + - label: "read the optional attribute: MaxConstFlow" + disabled: true + command: "readAttribute" + attribute: "MaxConstFlow" + response: + constraints: + type: uint16 + + - label: "read the optional attribute: MinConstTemp" + disabled: true + command: "readAttribute" + attribute: "MinConstTemp" + response: + value: null + + - label: "read the optional attribute: MinConstTemp" + disabled: true + command: "readAttribute" + attribute: "MinConstTemp" + response: + constraints: + type: int16 + minValue: -27315 + + - label: "read the optional attribute: MaxConstTemp" + disabled: true + command: "readAttribute" + attribute: "MaxConstTemp" + response: + value: null + + - label: "read the optional attribute: MaxConstTemp" + disabled: true + command: "readAttribute" + attribute: "MaxConstTemp" + response: + constraints: + type: int16 + minValue: -27315 + + - label: "read the optional attribute: PumpStatus" + disabled: true + command: "readAttribute" + attribute: "pump status" + response: + value: 0 + + - label: "read the optional attribute: PumpStatus" + disabled: true + command: "readAttribute" + attribute: "pump status" + response: + constraints: + type: map16 + + - label: "read the optional attribute: Speed" + disabled: true + command: "readAttribute" + attribute: "speed" + response: + value: null + + - label: "read the optional attribute: Speed" + disabled: true + command: "readAttribute" + attribute: "speed" + response: + constraints: + type: uint16 + + - label: "read the optional attribute: LifetimeRunningHours" + disabled: true + command: "readAttribute" + attribute: "lifetime running hours" + response: + value: 0 + + - label: "read the optional attribute: LifetimeRunningHours" + disabled: true + command: "readAttribute" + attribute: "lifetime running hours" + response: + constraints: + type: uint24 + + - label: "read the optional attribute: Power" + disabled: true + command: "readAttribute" + attribute: "power" + response: + value: null + + - label: "read the optional attribute: Power" + disabled: true + command: "readAttribute" + attribute: "power" + response: + constraints: + type: uint24 + + - label: "read the optional attribute: LifetimeEnergyConsumed" + disabled: true + command: "readAttribute" + attribute: "lifetime energy consumed" + response: + value: 0 + + - label: "read the optional attribute: LifetimeEnergyConsumed" + disabled: true + command: "readAttribute" + attribute: "lifetime energy consumed" + response: + constraints: + type: uint32 + + - label: "write to the optional attribute: MinConstPressure" + disabled: true + command: "writeAttribute" + attribute: "MinConstPressure" + arguments: + value: null + response: + error: 1 + + - label: "write to the optional attribute: MaxConstPressure" + disabled: true + command: "writeAttribute" + attribute: "MaxConstPressure" + arguments: + value: null + response: + error: 1 + + - label: "write to the optional attribute: MinCompPressure" + disabled: true + command: "writeAttribute" + attribute: "MinCompPressure" + arguments: + value: null + response: + error: 1 + + - label: "write to the optional attribute: MaxCompPressure" + disabled: true + command: "writeAttribute" + attribute: "MaxCompPressure" + arguments: + value: null + response: + error: 1 + + - label: "write to the optional attribute: MinConstSpeed" + disabled: true + command: "writeAttribute" + attribute: "MinConstSpeed" + arguments: + value: null + response: + error: 1 + + - label: "write to the optional attribute: MaxConstSpeed" + disabled: true + command: "writeAttribute" + attribute: "MaxConstSpeed" + arguments: + value: null + response: + error: 1 + + - label: "write to the optional attribute: MinConstFlow" + disabled: true + command: "writeAttribute" + attribute: "MinConstFlow" + arguments: + value: null + response: + error: 1 + + - label: "write to the optional attribute: MaxConstFlow" + disabled: true + command: "writeAttribute" + attribute: "MaxConstFlow" + arguments: + value: null + response: + error: 1 + + - label: "write to the optional attribute: MinConstTemp" + disabled: true + command: "writeAttribute" + attribute: "MinConstTemp" + arguments: + value: null + response: + error: 1 + + - label: "write to the optional attribute: MaxConstTemp" + disabled: true + command: "writeAttribute" + attribute: "MaxConstTemp" + arguments: + value: null + response: + error: 1 + + - label: "write to the optional attribute: PumpStatus" + disabled: true + command: "writeAttribute" + attribute: "pump status" + arguments: + value: 0 + response: + error: 1 + + - label: "write to the optional attribute: Speed" + disabled: true + command: "writeAttribute" + attribute: "speed" + arguments: + value: null + response: + error: 1 + + - label: "write to the optional attribute: LifetimeRunningHours" + disabled: true + command: "writeAttribute" + attribute: "lifetime running hours" + arguments: + value: 0 + response: + error: 0 + + - label: "write to the optional attribute: Power" + disabled: true + command: "writeAttribute" + attribute: "power" + arguments: + value: null + response: + error: 1 + + - label: "write to the optional attribute: LifetimeEnergyConsumed" + disabled: true + command: "writeAttribute" + attribute: "lifetime energy consumed" + arguments: + value: 0 + response: + error: 0 + + - label: "read the optional attribute: MinConstPressure" + disabled: true + command: "readAttribute" + attribute: "MinConstPressure" + response: + value: null + + - label: "read the optional attribute: MinConstPressure" + disabled: true + command: "readAttribute" + attribute: "MinConstPressure" + response: + constraints: + type: int16 + + - label: "read the optional attribute: MaxConstPressure" + disabled: true + command: "readAttribute" + attribute: "MaxConstPressure" + response: + value: null + + - label: "read the optional attribute: MaxConstPressure" + disabled: true + command: "readAttribute" + attribute: "MaxConstPressure" + response: + constraints: + type: int16 + + - label: "read the optional attribute: MinCompPressure" + disabled: true + command: "readAttribute" + attribute: "MinCompPressure" + response: + value: null + + - label: "read the optional attribute: MinCompPressure" + disabled: true + command: "readAttribute" + attribute: "MinCompPressure" + response: + constraints: + type: int16 + + - label: "read the optional attribute: MaxCompPressure" + disabled: true + command: "readAttribute" + attribute: "MaxCompPressure" + response: + value: null + + - label: "read the optional attribute: MaxCompPressure" + disabled: true + command: "readAttribute" + attribute: "MaxCompPressure" + response: + constraints: + type: int16 + + - label: "read the optional attribute: MinConstSpeed" + disabled: true + command: "readAttribute" + attribute: "MinConstSpeed" + response: + value: null + + - label: "read the optional attribute: MinConstSpeed" + disabled: true + command: "readAttribute" + attribute: "MinConstSpeed" + response: + constraints: + type: uint16 + + - label: "read the optional attribute: MaxConstSpeed" + disabled: true + command: "readAttribute" + attribute: "MaxConstSpeed" + response: + value: null + + - label: "read the optional attribute: MaxConstSpeed" + disabled: true + command: "readAttribute" + attribute: "MaxConstSpeed" + response: + constraints: + type: uint16 + + - label: "read the optional attribute: MinConstFlow" + disabled: true + command: "readAttribute" + attribute: "MinConstFlow" + response: + value: null + + - label: "read the optional attribute: MinConstFlow" + disabled: true + command: "readAttribute" + attribute: "MinConstFlow" + response: + constraints: + type: uint16 + + - label: "read the optional attribute: MaxConstFlow" + disabled: true + command: "readAttribute" + attribute: "MaxConstFlow" + response: + value: null + + - label: "read the optional attribute: MaxConstFlow" + disabled: true + command: "readAttribute" + attribute: "MaxConstFlow" + response: + constraints: + type: uint16 + + - label: "read the optional attribute: MinConstTemp" + disabled: true + command: "readAttribute" + attribute: "MinConstTemp" + response: + value: null + + - label: "read the optional attribute: MinConstTemp" + disabled: true + command: "readAttribute" + attribute: "MinConstTemp" + response: + constraints: + type: int16 + minValue: -27315 + + - label: "read the optional attribute: MaxConstTemp" + disabled: true + command: "readAttribute" + attribute: "MaxConstTemp" + response: + value: null + + - label: "read the optional attribute: MaxConstTemp" + disabled: true + command: "readAttribute" + attribute: "MaxConstTemp" + response: + constraints: + type: int16 + minValue: -27315 + + - label: "read the optional attribute: PumpStatus" + disabled: true + command: "readAttribute" + attribute: "pump status" + response: + value: 0 + + - label: "read the optional attribute: PumpStatus" + disabled: true + command: "readAttribute" + attribute: "pump status" + response: + constraints: + type: map16 + + - label: "read the optional attribute: Speed" + disabled: true + command: "readAttribute" + attribute: "speed" + response: + value: null + + - label: "read the optional attribute: Speed" + disabled: true + command: "readAttribute" + attribute: "speed" + response: + constraints: + type: uint16 + + - label: "read the optional attribute: LifetimeRunningHours" + disabled: true + command: "readAttribute" + attribute: "lifetime running hours" + response: + value: 0 + + - label: "read the optional attribute: LifetimeRunningHours" + disabled: true + command: "readAttribute" + attribute: "lifetime running hours" + response: + constraints: + type: uint24 + + - label: "read the optional attribute: Power" + disabled: true + command: "readAttribute" + attribute: "power" + response: + value: null + + - label: "read the optional attribute: Power" + disabled: true + command: "readAttribute" + attribute: "power" + response: + constraints: + type: uint24 + + - label: "read the optional attribute: LifetimeEnergyConsumed" + disabled: true + command: "readAttribute" + attribute: "lifetime energy consumed" + response: + value: 0 + + - label: "read the optional attribute: LifetimeEnergyConsumed" + disabled: true + command: "readAttribute" + attribute: "lifetime energy consumed" + response: + constraints: + type: uint32 diff --git a/src/app/tests/suites/certification/Test_TC_TM_2_1.yaml b/src/app/tests/suites/certification/Test_TC_TM_2_1.yaml new file mode 100644 index 00000000000000..a6e0f4f172f848 --- /dev/null +++ b/src/app/tests/suites/certification/Test_TC_TM_2_1.yaml @@ -0,0 +1,57 @@ +# Copyright (c) 2021 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. + +name: 6.2.1. [TC-TM-2.1] Attributes with server as DUT + +config: + cluster: "Temperature Measurement" + endpoint: 1 + +tests: + - label: "read the mandatory attribute: MeasuredValue" + command: "readAttribute" + attribute: "measured value" + response: + constraints: + type: int16 + + - label: "read the mandatory attribute: MinMeasuredValue" + disabled: true + command: "readAttribute" + attribute: "min measured value" + response: + constraints: + type: int16 + minValue: -27315 + maxValue: 32766 + + - label: "read the mandatory attribute: MaxMeasuredValue" + disabled: true + command: "readAttribute" + attribute: "max measured value" + response: + constraints: + type: int16 + minValue: -27314 + maxValue: 32767 + + - label: "read the optional attribute: Tolerance" + disabled: true + command: "readAttribute" + attribute: "Tolerance" + response: + constraints: + type: uint16 + minValue: 0 + maxValue: 2048 diff --git a/src/app/tests/suites/certification/Test_TC_TSUIC_2_1.yaml b/src/app/tests/suites/certification/Test_TC_TSUIC_2_1.yaml new file mode 100644 index 00000000000000..987fcabfdfe94e --- /dev/null +++ b/src/app/tests/suites/certification/Test_TC_TSUIC_2_1.yaml @@ -0,0 +1,122 @@ +# Copyright (c) 2021 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. + +name: 12.2.1. [TC-TSUIC-2.1] Attributes with server as DUT + +config: + cluster: "Thermostat User Interface Configuration" + endpoint: 1 + +tests: + - label: "read the mandatory attribute: TemperatureDisplayMode" + command: "readAttribute" + attribute: "temperature display mode" + response: + value: 0 + + - label: "read the mandatory attribute: TemperatureDisplayMode" + command: "readAttribute" + attribute: "temperature display mode" + response: + constraints: + type: enum8 + + - label: "write to the mandatory attribute: TemperatureDisplayMode" + command: "writeAttribute" + attribute: "temperature display mode" + arguments: + value: 0 + response: + error: 0 + + - label: "read the mandatory attribute: TemperatureDisplayMode" + command: "readAttribute" + attribute: "temperature display mode" + response: + value: 0 + + - label: "read the mandatory attribute: TemperatureDisplayMode" + command: "readAttribute" + attribute: "temperature display mode" + response: + constraints: + type: enum8 + + - label: "read the mandatory attribute: KeypadLockout" + command: "readAttribute" + attribute: "keypad lockout" + response: + value: 0 + + - label: "read the mandatory attribute: KeypadLockout" + command: "readAttribute" + attribute: "keypad lockout" + response: + constraints: + type: enum8 + + - label: "write to the mandatory attribute: KeypadLockout" + command: "writeAttribute" + attribute: "keypad lockout" + arguments: + value: 0 + response: + error: 0 + + - label: "read the mandatory attribute: KeypadLockout" + command: "readAttribute" + attribute: "keypad lockout" + response: + value: 0 + + - label: "read the mandatory attribute: KeypadLockout" + command: "readAttribute" + attribute: "keypad lockout" + response: + constraints: + type: enum8 + + - label: "read the optional attribute: ScheduleProgrammingVisibility" + command: "readAttribute" + attribute: "schedule programming visibility" + response: + value: 0 + + - label: "read the optional attribute: ScheduleProgrammingVisibility" + command: "readAttribute" + attribute: "schedule programming visibility" + response: + constraints: + type: enum8 + + - label: "write to the mandatory attribute: ScheduleProgrammingVisibility" + command: "writeAttribute" + attribute: "schedule programming visibility" + arguments: + value: 0 + response: + error: 0 + + - label: "read the optional attribute: ScheduleProgrammingVisibility" + command: "readAttribute" + attribute: "schedule programming visibility" + response: + value: 0 + + - label: "read the optional attribute: ScheduleProgrammingVisibility" + command: "readAttribute" + attribute: "schedule programming visibility" + response: + constraints: + type: enum8 diff --git a/src/darwin/Framework/CHIP/templates/clusters-tests.zapt b/src/darwin/Framework/CHIP/templates/clusters-tests.zapt index e12558b3c1b0de..b5c3138569007f 100644 --- a/src/darwin/Framework/CHIP/templates/clusters-tests.zapt +++ b/src/darwin/Framework/CHIP/templates/clusters-tests.zapt @@ -143,7 +143,7 @@ CHIPDevice * GetPairedDevice(uint64_t deviceId) [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; } -{{>test_cluster tests="TestCluster, TestConstraints, TestDelayCommands, TestSubscribe_OnOff, Test_TC_OO_1_1, Test_TC_OO_2_1, Test_TC_OO_2_2, Test_TC_DM_1_1, Test_TC_DM_3_1, Test_TC_CC_3_4, Test_TC_CC_5, Test_TC_CC_6, Test_TC_CC_7, Test_TC_CC_8, Test_TC_WNCV_1_1, Test_TC_WNCV_2_1, Test_TC_WNCV_3_1, Test_TC_WNCV_3_2, Test_TC_WNCV_3_3, Test_TC_BI_1_1, Test_TC_FLW_1_1, Test_TC_TM_1_1, Test_TC_OCC_1_1, TestOperationalCredentialsCluster, Test_TC_LVL_1_1, Test_TC_CC_1_1, Test_TC_RH_1_1, Test_TC_MC_1_1, Test_TC_TSTAT_1_1, Test_TC_PCC_1_1, Test_TC_TSUIC_1_1, Test_TC_DIAGTH_1_1"}} +{{>test_cluster tests="TestCluster, TestConstraints, TestDelayCommands, TestSubscribe_OnOff, Test_TC_OO_1_1, Test_TC_OO_2_1, Test_TC_OO_2_2, Test_TC_DM_1_1, Test_TC_DM_3_1, Test_TC_WNCV_1_1, Test_TC_WNCV_2_1, Test_TC_WNCV_3_1, Test_TC_WNCV_3_2, Test_TC_WNCV_3_3, Test_TC_BI_1_1, Test_TC_FLW_1_1, Test_TC_TM_1_1, Test_TC_OCC_1_1, TestOperationalCredentialsCluster, Test_TC_LVL_1_1, Test_TC_CC_1_1, Test_TC_RH_1_1, Test_TC_MC_1_1, Test_TC_TSTAT_1_1, Test_TC_PCC_1_1, Test_TC_TSUIC_1_1, Test_TC_DIAGTH_1_1, Test_TC_TM_2_1, Test_TC_TSUIC_2_1, Test_TC_PCC_2_1, Test_TC_CC_3_1, Test_TC_CC_3_2, Test_TC_CC_3_3, Test_TC_CC_4_1, Test_TC_CC_4_2, Test_TC_CC_4_3, Test_TC_CC_4_4, Test_TC_CC_5_1, Test_TC_CC_5_2, Test_TC_CC_5_3, Test_TC_CC_6_1, Test_TC_CC_6_2, Test_TC_CC_6_3, Test_TC_CC_7_1, Test_TC_CC_7_2, Test_TC_CC_7_3, Test_TC_CC_7_4, Test_TC_CC_8_1"}} {{#chip_client_clusters}} {{#unless (isStrEqual "Test Cluster" name)}} diff --git a/src/darwin/Framework/CHIPTests/CHIPClustersTests.m b/src/darwin/Framework/CHIPTests/CHIPClustersTests.m index 343712676915a7..b7901418fa692b 100644 --- a/src/darwin/Framework/CHIPTests/CHIPClustersTests.m +++ b/src/darwin/Framework/CHIPTests/CHIPClustersTests.m @@ -4062,507 +4062,394 @@ - (void)testSendClusterTest_TC_DM_1_1_000017_ReadAttribute [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; } -- (void)testSendClusterTest_TC_CC_3_4_000000_On +- (void)testSendClusterTest_TC_WNCV_1_1_000000_ReadAttribute { - XCTestExpectation * expectation = [self expectationWithDescription:@"Turn on light for color control tests"]; + XCTestExpectation * expectation = [self expectationWithDescription:@"read the global attribute: ClusterRevision"]; CHIPDevice * device = GetPairedDevice(kDeviceId); dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPTestOnOff * cluster = [[CHIPTestOnOff alloc] initWithDevice:device endpoint:1 queue:queue]; + CHIPTestWindowCovering * cluster = [[CHIPTestWindowCovering alloc] initWithDevice:device endpoint:1 queue:queue]; XCTAssertNotNil(cluster); - [cluster on:^(NSError * err, NSDictionary * values) { - NSLog(@"Turn on light for color control tests Error: %@", err); + [cluster readAttributeClusterRevisionWithResponseHandler:^(NSError * err, NSDictionary * values) { + NSLog(@"read the global attribute: ClusterRevision Error: %@", err); XCTAssertEqual(err.code, 0); + XCTAssertEqual([values[@"value"] unsignedShortValue], 5); + [expectation fulfill]; }]; [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; } -- (void)testSendClusterTest_TC_CC_3_4_000001_ReadAttribute +- (void)testSendClusterTest_TC_WNCV_1_1_000001_WriteAttribute { - XCTestExpectation * expectation = [self expectationWithDescription:@"Check on/off attribute value is true after on command"]; + XCTestExpectation * expectation = + [self expectationWithDescription:@"write the default value to mandatory global attribute: ClusterRevision"]; CHIPDevice * device = GetPairedDevice(kDeviceId); dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPTestOnOff * cluster = [[CHIPTestOnOff alloc] initWithDevice:device endpoint:1 queue:queue]; + CHIPTestWindowCovering * cluster = [[CHIPTestWindowCovering alloc] initWithDevice:device endpoint:1 queue:queue]; XCTAssertNotNil(cluster); - [cluster readAttributeOnOffWithResponseHandler:^(NSError * err, NSDictionary * values) { - NSLog(@"Check on/off attribute value is true after on command Error: %@", err); - - XCTAssertEqual(err.code, 0); - - XCTAssertEqual([values[@"value"] boolValue], 1); + uint16_t clusterRevisionArgument = 5U; + [cluster + writeAttributeClusterRevisionWithValue:clusterRevisionArgument + responseHandler:^(NSError * err, NSDictionary * values) { + NSLog(@"write the default value to mandatory global attribute: ClusterRevision Error: %@", err); - [expectation fulfill]; - }]; + XCTAssertEqual(err.code, 1); + [expectation fulfill]; + }]; [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; } -- (void)testSendClusterTest_TC_CC_3_4_000002_MoveToHue +- (void)testSendClusterTest_TC_WNCV_1_1_000002_ReadAttribute { - XCTestExpectation * expectation = [self expectationWithDescription:@"Move to hue shortest distance command"]; + XCTestExpectation * expectation = [self expectationWithDescription:@"reads back global attribute: ClusterRevision"]; CHIPDevice * device = GetPairedDevice(kDeviceId); dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPTestColorControl * cluster = [[CHIPTestColorControl alloc] initWithDevice:device endpoint:1 queue:queue]; + CHIPTestWindowCovering * cluster = [[CHIPTestWindowCovering alloc] initWithDevice:device endpoint:1 queue:queue]; XCTAssertNotNil(cluster); - uint8_t hueArgument = 150; - uint8_t directionArgument = 0; - uint16_t transitionTimeArgument = 100U; - uint8_t optionsMaskArgument = 0; - uint8_t optionsOverrideArgument = 0; - [cluster moveToHue:hueArgument - direction:directionArgument - transitionTime:transitionTimeArgument - optionsMask:optionsMaskArgument - optionsOverride:optionsOverrideArgument - responseHandler:^(NSError * err, NSDictionary * values) { - NSLog(@"Move to hue shortest distance command Error: %@", err); + [cluster readAttributeClusterRevisionWithResponseHandler:^(NSError * err, NSDictionary * values) { + NSLog(@"reads back global attribute: ClusterRevision Error: %@", err); - XCTAssertEqual(err.code, 0); + XCTAssertEqual(err.code, 0); - [expectation fulfill]; - }]; + XCTAssertEqual([values[@"value"] unsignedShortValue], 5); + + [expectation fulfill]; + }]; [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; } -- (void)testSendClusterTest_TC_CC_3_4_000003_MoveToHue + +- (void)testSendClusterTest_TC_WNCV_2_1_000000_ReadAttribute { - XCTestExpectation * expectation = [self expectationWithDescription:@"Move to hue longest distance command"]; + XCTestExpectation * expectation = [self expectationWithDescription:@"read the RO mandatory attribute default: Type"]; CHIPDevice * device = GetPairedDevice(kDeviceId); dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPTestColorControl * cluster = [[CHIPTestColorControl alloc] initWithDevice:device endpoint:1 queue:queue]; + CHIPTestWindowCovering * cluster = [[CHIPTestWindowCovering alloc] initWithDevice:device endpoint:1 queue:queue]; XCTAssertNotNil(cluster); - uint8_t hueArgument = 200; - uint8_t directionArgument = 1; - uint16_t transitionTimeArgument = 100U; - uint8_t optionsMaskArgument = 0; - uint8_t optionsOverrideArgument = 0; - [cluster moveToHue:hueArgument - direction:directionArgument - transitionTime:transitionTimeArgument - optionsMask:optionsMaskArgument - optionsOverride:optionsOverrideArgument - responseHandler:^(NSError * err, NSDictionary * values) { - NSLog(@"Move to hue longest distance command Error: %@", err); + [cluster readAttributeTypeWithResponseHandler:^(NSError * err, NSDictionary * values) { + NSLog(@"read the RO mandatory attribute default: Type Error: %@", err); - XCTAssertEqual(err.code, 0); + XCTAssertEqual(err.code, 0); - [expectation fulfill]; - }]; + XCTAssertEqual([values[@"value"] unsignedCharValue], 0); + + [expectation fulfill]; + }]; [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; } -- (void)testSendClusterTest_TC_CC_3_4_000004_MoveToHue +- (void)testSendClusterTest_TC_WNCV_2_1_000001_ReadAttribute { - XCTestExpectation * expectation = [self expectationWithDescription:@"Move to hue up command"]; + XCTestExpectation * expectation = [self expectationWithDescription:@"reads back the RO mandatory attribute: Type"]; CHIPDevice * device = GetPairedDevice(kDeviceId); dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPTestColorControl * cluster = [[CHIPTestColorControl alloc] initWithDevice:device endpoint:1 queue:queue]; + CHIPTestWindowCovering * cluster = [[CHIPTestWindowCovering alloc] initWithDevice:device endpoint:1 queue:queue]; XCTAssertNotNil(cluster); - uint8_t hueArgument = 250; - uint8_t directionArgument = 2; - uint16_t transitionTimeArgument = 100U; - uint8_t optionsMaskArgument = 0; - uint8_t optionsOverrideArgument = 0; - [cluster moveToHue:hueArgument - direction:directionArgument - transitionTime:transitionTimeArgument - optionsMask:optionsMaskArgument - optionsOverride:optionsOverrideArgument - responseHandler:^(NSError * err, NSDictionary * values) { - NSLog(@"Move to hue up command Error: %@", err); + [cluster readAttributeTypeWithResponseHandler:^(NSError * err, NSDictionary * values) { + NSLog(@"reads back the RO mandatory attribute: Type Error: %@", err); - XCTAssertEqual(err.code, 0); + XCTAssertEqual(err.code, 0); - [expectation fulfill]; - }]; + XCTAssertEqual([values[@"value"] unsignedCharValue], 0); + + [expectation fulfill]; + }]; [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; } -- (void)testSendClusterTest_TC_CC_3_4_000005_MoveToHue +- (void)testSendClusterTest_TC_WNCV_2_1_000002_ReadAttribute { - XCTestExpectation * expectation = [self expectationWithDescription:@"Move to hue down command"]; + XCTestExpectation * expectation = [self expectationWithDescription:@"read the RO mandatory attribute default: ConfigStatus"]; CHIPDevice * device = GetPairedDevice(kDeviceId); dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPTestColorControl * cluster = [[CHIPTestColorControl alloc] initWithDevice:device endpoint:1 queue:queue]; + CHIPTestWindowCovering * cluster = [[CHIPTestWindowCovering alloc] initWithDevice:device endpoint:1 queue:queue]; XCTAssertNotNil(cluster); - uint8_t hueArgument = 225; - uint8_t directionArgument = 3; - uint16_t transitionTimeArgument = 100U; - uint8_t optionsMaskArgument = 0; - uint8_t optionsOverrideArgument = 0; - [cluster moveToHue:hueArgument - direction:directionArgument - transitionTime:transitionTimeArgument - optionsMask:optionsMaskArgument - optionsOverride:optionsOverrideArgument - responseHandler:^(NSError * err, NSDictionary * values) { - NSLog(@"Move to hue down command Error: %@", err); + [cluster readAttributeConfigStatusWithResponseHandler:^(NSError * err, NSDictionary * values) { + NSLog(@"read the RO mandatory attribute default: ConfigStatus Error: %@", err); - XCTAssertEqual(err.code, 0); + XCTAssertEqual(err.code, 0); - [expectation fulfill]; - }]; + XCTAssertEqual([values[@"value"] unsignedCharValue], 3); + + [expectation fulfill]; + }]; [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; } -- (void)testSendClusterTest_TC_CC_3_4_000006_MoveHue +- (void)testSendClusterTest_TC_WNCV_2_1_000003_ReadAttribute { - XCTestExpectation * expectation = [self expectationWithDescription:@"Move hue up command"]; + XCTestExpectation * expectation = [self expectationWithDescription:@"reads back the RO mandatory attribute: ConfigStatus"]; CHIPDevice * device = GetPairedDevice(kDeviceId); dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPTestColorControl * cluster = [[CHIPTestColorControl alloc] initWithDevice:device endpoint:1 queue:queue]; + CHIPTestWindowCovering * cluster = [[CHIPTestWindowCovering alloc] initWithDevice:device endpoint:1 queue:queue]; XCTAssertNotNil(cluster); - uint8_t moveModeArgument = 1; - uint8_t rateArgument = 50; - uint8_t optionsMaskArgument = 0; - uint8_t optionsOverrideArgument = 0; - [cluster moveHue:moveModeArgument - rate:rateArgument - optionsMask:optionsMaskArgument - optionsOverride:optionsOverrideArgument - responseHandler:^(NSError * err, NSDictionary * values) { - NSLog(@"Move hue up command Error: %@", err); + [cluster readAttributeConfigStatusWithResponseHandler:^(NSError * err, NSDictionary * values) { + NSLog(@"reads back the RO mandatory attribute: ConfigStatus Error: %@", err); - XCTAssertEqual(err.code, 0); + XCTAssertEqual(err.code, 0); - [expectation fulfill]; - }]; + XCTAssertEqual([values[@"value"] unsignedCharValue], 3); + + [expectation fulfill]; + }]; [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; } -- (void)testSendClusterTest_TC_CC_3_4_000007_MoveHue +- (void)testSendClusterTest_TC_WNCV_2_1_000004_ReadAttribute { - XCTestExpectation * expectation = [self expectationWithDescription:@"Move hue stop command"]; + XCTestExpectation * expectation = + [self expectationWithDescription:@"read the RO mandatory attribute default: OperationalStatus"]; CHIPDevice * device = GetPairedDevice(kDeviceId); dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPTestColorControl * cluster = [[CHIPTestColorControl alloc] initWithDevice:device endpoint:1 queue:queue]; + CHIPTestWindowCovering * cluster = [[CHIPTestWindowCovering alloc] initWithDevice:device endpoint:1 queue:queue]; XCTAssertNotNil(cluster); - uint8_t moveModeArgument = 0; - uint8_t rateArgument = 50; - uint8_t optionsMaskArgument = 0; - uint8_t optionsOverrideArgument = 0; - [cluster moveHue:moveModeArgument - rate:rateArgument - optionsMask:optionsMaskArgument - optionsOverride:optionsOverrideArgument - responseHandler:^(NSError * err, NSDictionary * values) { - NSLog(@"Move hue stop command Error: %@", err); + [cluster readAttributeOperationalStatusWithResponseHandler:^(NSError * err, NSDictionary * values) { + NSLog(@"read the RO mandatory attribute default: OperationalStatus Error: %@", err); - XCTAssertEqual(err.code, 0); + XCTAssertEqual(err.code, 0); - [expectation fulfill]; - }]; + XCTAssertEqual([values[@"value"] unsignedCharValue], 0); + + [expectation fulfill]; + }]; [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; } -- (void)testSendClusterTest_TC_CC_3_4_000008_MoveHue +- (void)testSendClusterTest_TC_WNCV_2_1_000005_ReadAttribute { - XCTestExpectation * expectation = [self expectationWithDescription:@"Move hue down command"]; + XCTestExpectation * expectation = [self expectationWithDescription:@"reads back the RO mandatory attribute: OperationalStatus"]; CHIPDevice * device = GetPairedDevice(kDeviceId); dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPTestColorControl * cluster = [[CHIPTestColorControl alloc] initWithDevice:device endpoint:1 queue:queue]; + CHIPTestWindowCovering * cluster = [[CHIPTestWindowCovering alloc] initWithDevice:device endpoint:1 queue:queue]; XCTAssertNotNil(cluster); - uint8_t moveModeArgument = 3; - uint8_t rateArgument = 50; - uint8_t optionsMaskArgument = 0; - uint8_t optionsOverrideArgument = 0; - [cluster moveHue:moveModeArgument - rate:rateArgument - optionsMask:optionsMaskArgument - optionsOverride:optionsOverrideArgument - responseHandler:^(NSError * err, NSDictionary * values) { - NSLog(@"Move hue down command Error: %@", err); + [cluster readAttributeOperationalStatusWithResponseHandler:^(NSError * err, NSDictionary * values) { + NSLog(@"reads back the RO mandatory attribute: OperationalStatus Error: %@", err); - XCTAssertEqual(err.code, 0); + XCTAssertEqual(err.code, 0); - [expectation fulfill]; - }]; + XCTAssertEqual([values[@"value"] unsignedCharValue], 0); + + [expectation fulfill]; + }]; [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; } -- (void)testSendClusterTest_TC_CC_3_4_000009_MoveHue +- (void)testSendClusterTest_TC_WNCV_2_1_000006_ReadAttribute { - XCTestExpectation * expectation = [self expectationWithDescription:@"Move hue stop command"]; + XCTestExpectation * expectation = [self expectationWithDescription:@"read the RO mandatory attribute default: EndProductType"]; CHIPDevice * device = GetPairedDevice(kDeviceId); dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPTestColorControl * cluster = [[CHIPTestColorControl alloc] initWithDevice:device endpoint:1 queue:queue]; + CHIPTestWindowCovering * cluster = [[CHIPTestWindowCovering alloc] initWithDevice:device endpoint:1 queue:queue]; XCTAssertNotNil(cluster); - uint8_t moveModeArgument = 0; - uint8_t rateArgument = 50; - uint8_t optionsMaskArgument = 0; - uint8_t optionsOverrideArgument = 0; - [cluster moveHue:moveModeArgument - rate:rateArgument - optionsMask:optionsMaskArgument - optionsOverride:optionsOverrideArgument - responseHandler:^(NSError * err, NSDictionary * values) { - NSLog(@"Move hue stop command Error: %@", err); + [cluster readAttributeEndProductTypeWithResponseHandler:^(NSError * err, NSDictionary * values) { + NSLog(@"read the RO mandatory attribute default: EndProductType Error: %@", err); - XCTAssertEqual(err.code, 0); + XCTAssertEqual(err.code, 0); - [expectation fulfill]; - }]; + XCTAssertEqual([values[@"value"] unsignedCharValue], 0); + + [expectation fulfill]; + }]; [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; } -- (void)testSendClusterTest_TC_CC_3_4_000010_StepHue +- (void)testSendClusterTest_TC_WNCV_2_1_000007_ReadAttribute { - XCTestExpectation * expectation = [self expectationWithDescription:@"Step hue up command"]; + XCTestExpectation * expectation = [self expectationWithDescription:@"reads back the RO mandatory attribute: EndProductType"]; CHIPDevice * device = GetPairedDevice(kDeviceId); dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPTestColorControl * cluster = [[CHIPTestColorControl alloc] initWithDevice:device endpoint:1 queue:queue]; + CHIPTestWindowCovering * cluster = [[CHIPTestWindowCovering alloc] initWithDevice:device endpoint:1 queue:queue]; XCTAssertNotNil(cluster); - uint8_t stepModeArgument = 1; - uint8_t stepSizeArgument = 5; - uint8_t transitionTimeArgument = 25; - uint8_t optionsMaskArgument = 0; - uint8_t optionsOverrideArgument = 0; - [cluster stepHue:stepModeArgument - stepSize:stepSizeArgument - transitionTime:transitionTimeArgument - optionsMask:optionsMaskArgument - optionsOverride:optionsOverrideArgument - responseHandler:^(NSError * err, NSDictionary * values) { - NSLog(@"Step hue up command Error: %@", err); + [cluster readAttributeEndProductTypeWithResponseHandler:^(NSError * err, NSDictionary * values) { + NSLog(@"reads back the RO mandatory attribute: EndProductType Error: %@", err); - XCTAssertEqual(err.code, 0); + XCTAssertEqual(err.code, 0); - [expectation fulfill]; - }]; + XCTAssertEqual([values[@"value"] unsignedCharValue], 0); + + [expectation fulfill]; + }]; [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; } -- (void)testSendClusterTest_TC_CC_3_4_000011_StepHue +- (void)testSendClusterTest_TC_WNCV_2_1_000008_ReadAttribute { - XCTestExpectation * expectation = [self expectationWithDescription:@"Step hue down command"]; + XCTestExpectation * expectation = [self expectationWithDescription:@"read the RW mandatory attribute default: Mode"]; CHIPDevice * device = GetPairedDevice(kDeviceId); dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPTestColorControl * cluster = [[CHIPTestColorControl alloc] initWithDevice:device endpoint:1 queue:queue]; + CHIPTestWindowCovering * cluster = [[CHIPTestWindowCovering alloc] initWithDevice:device endpoint:1 queue:queue]; XCTAssertNotNil(cluster); - uint8_t stepModeArgument = 3; - uint8_t stepSizeArgument = 5; - uint8_t transitionTimeArgument = 25; - uint8_t optionsMaskArgument = 0; - uint8_t optionsOverrideArgument = 0; - [cluster stepHue:stepModeArgument - stepSize:stepSizeArgument - transitionTime:transitionTimeArgument - optionsMask:optionsMaskArgument - optionsOverride:optionsOverrideArgument - responseHandler:^(NSError * err, NSDictionary * values) { - NSLog(@"Step hue down command Error: %@", err); + [cluster readAttributeModeWithResponseHandler:^(NSError * err, NSDictionary * values) { + NSLog(@"read the RW mandatory attribute default: Mode Error: %@", err); - XCTAssertEqual(err.code, 0); + XCTAssertEqual(err.code, 0); - [expectation fulfill]; - }]; + XCTAssertEqual([values[@"value"] unsignedCharValue], 0); + + [expectation fulfill]; + }]; [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; } -- (void)testSendClusterTest_TC_CC_3_4_000012_MoveToSaturation +- (void)testSendClusterTest_TC_WNCV_2_1_000009_WriteAttribute { - XCTestExpectation * expectation = [self expectationWithDescription:@"Move to saturation command"]; + XCTestExpectation * expectation = [self expectationWithDescription:@"write a value into the RW mandatory attribute:: Mode"]; CHIPDevice * device = GetPairedDevice(kDeviceId); dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPTestColorControl * cluster = [[CHIPTestColorControl alloc] initWithDevice:device endpoint:1 queue:queue]; + CHIPTestWindowCovering * cluster = [[CHIPTestWindowCovering alloc] initWithDevice:device endpoint:1 queue:queue]; XCTAssertNotNil(cluster); - uint8_t saturationArgument = 90; - uint16_t transitionTimeArgument = 10U; - uint8_t optionsMaskArgument = 0; - uint8_t optionsOverrideArgument = 0; - [cluster moveToSaturation:saturationArgument - transitionTime:transitionTimeArgument - optionsMask:optionsMaskArgument - optionsOverride:optionsOverrideArgument - responseHandler:^(NSError * err, NSDictionary * values) { - NSLog(@"Move to saturation command Error: %@", err); + uint8_t modeArgument = 7; + [cluster writeAttributeModeWithValue:modeArgument + responseHandler:^(NSError * err, NSDictionary * values) { + NSLog(@"write a value into the RW mandatory attribute:: Mode Error: %@", err); - XCTAssertEqual(err.code, 0); + XCTAssertEqual(err.code, 0); - [expectation fulfill]; - }]; + [expectation fulfill]; + }]; [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; } -- (void)testSendClusterTest_TC_CC_3_4_000013_MoveSaturation +- (void)testSendClusterTest_TC_WNCV_2_1_000010_ReadAttribute { - XCTestExpectation * expectation = [self expectationWithDescription:@"Move saturation up command"]; + XCTestExpectation * expectation = [self expectationWithDescription:@"reads back the RW mandatory attribute: Mode"]; CHIPDevice * device = GetPairedDevice(kDeviceId); dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPTestColorControl * cluster = [[CHIPTestColorControl alloc] initWithDevice:device endpoint:1 queue:queue]; + CHIPTestWindowCovering * cluster = [[CHIPTestWindowCovering alloc] initWithDevice:device endpoint:1 queue:queue]; XCTAssertNotNil(cluster); - uint8_t moveModeArgument = 1; - uint8_t rateArgument = 5; - uint8_t optionsMaskArgument = 0; - uint8_t optionsOverrideArgument = 0; - [cluster moveSaturation:moveModeArgument - rate:rateArgument - optionsMask:optionsMaskArgument - optionsOverride:optionsOverrideArgument - responseHandler:^(NSError * err, NSDictionary * values) { - NSLog(@"Move saturation up command Error: %@", err); + [cluster readAttributeModeWithResponseHandler:^(NSError * err, NSDictionary * values) { + NSLog(@"reads back the RW mandatory attribute: Mode Error: %@", err); - XCTAssertEqual(err.code, 0); + XCTAssertEqual(err.code, 0); - [expectation fulfill]; - }]; + XCTAssertEqual([values[@"value"] unsignedCharValue], 7); + + [expectation fulfill]; + }]; [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; } -- (void)testSendClusterTest_TC_CC_3_4_000014_MoveSaturation + +- (void)testSendClusterTest_TC_WNCV_3_1_000000_DownOrClose { - XCTestExpectation * expectation = [self expectationWithDescription:@"Move saturation down command"]; + XCTestExpectation * expectation = [self expectationWithDescription:@"1a: TH adjusts the the DUT to a non-open position"]; CHIPDevice * device = GetPairedDevice(kDeviceId); dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPTestColorControl * cluster = [[CHIPTestColorControl alloc] initWithDevice:device endpoint:1 queue:queue]; + CHIPTestWindowCovering * cluster = [[CHIPTestWindowCovering alloc] initWithDevice:device endpoint:1 queue:queue]; XCTAssertNotNil(cluster); - uint8_t moveModeArgument = 3; - uint8_t rateArgument = 5; - uint8_t optionsMaskArgument = 0; - uint8_t optionsOverrideArgument = 0; - [cluster moveSaturation:moveModeArgument - rate:rateArgument - optionsMask:optionsMaskArgument - optionsOverride:optionsOverrideArgument - responseHandler:^(NSError * err, NSDictionary * values) { - NSLog(@"Move saturation down command Error: %@", err); + [cluster downOrClose:^(NSError * err, NSDictionary * values) { + NSLog(@"1a: TH adjusts the the DUT to a non-open position Error: %@", err); - XCTAssertEqual(err.code, 0); + XCTAssertEqual(err.code, 0); - [expectation fulfill]; - }]; + [expectation fulfill]; + }]; [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; } -- (void)testSendClusterTest_TC_CC_3_4_000015_StepSaturation +- (void)testSendClusterTest_TC_WNCV_3_1_000001_UpOrOpen { - XCTestExpectation * expectation = [self expectationWithDescription:@"Step saturation up command"]; + XCTestExpectation * expectation = [self expectationWithDescription:@"2a: TH sends UpOrOpen command to DUT"]; CHIPDevice * device = GetPairedDevice(kDeviceId); dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPTestColorControl * cluster = [[CHIPTestColorControl alloc] initWithDevice:device endpoint:1 queue:queue]; + CHIPTestWindowCovering * cluster = [[CHIPTestWindowCovering alloc] initWithDevice:device endpoint:1 queue:queue]; XCTAssertNotNil(cluster); - uint8_t stepModeArgument = 1; - uint8_t stepSizeArgument = 15; - uint8_t transitionTimeArgument = 10; - uint8_t optionsMaskArgument = 0; - uint8_t optionsOverrideArgument = 0; - [cluster stepSaturation:stepModeArgument - stepSize:stepSizeArgument - transitionTime:transitionTimeArgument - optionsMask:optionsMaskArgument - optionsOverride:optionsOverrideArgument - responseHandler:^(NSError * err, NSDictionary * values) { - NSLog(@"Step saturation up command Error: %@", err); + [cluster upOrOpen:^(NSError * err, NSDictionary * values) { + NSLog(@"2a: TH sends UpOrOpen command to DUT Error: %@", err); - XCTAssertEqual(err.code, 0); + XCTAssertEqual(err.code, 0); - [expectation fulfill]; - }]; + [expectation fulfill]; + }]; [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; } -- (void)testSendClusterTest_TC_CC_3_4_000016_StepSaturation +- (void)testSendClusterTest_TC_WNCV_3_1_000002_ReadAttribute { - XCTestExpectation * expectation = [self expectationWithDescription:@"Step saturation down command"]; + XCTestExpectation * expectation = [self expectationWithDescription:@"3a: TH reads OperationalStatus attribute from DUT"]; CHIPDevice * device = GetPairedDevice(kDeviceId); dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPTestColorControl * cluster = [[CHIPTestColorControl alloc] initWithDevice:device endpoint:1 queue:queue]; + CHIPTestWindowCovering * cluster = [[CHIPTestWindowCovering alloc] initWithDevice:device endpoint:1 queue:queue]; XCTAssertNotNil(cluster); - uint8_t stepModeArgument = 3; - uint8_t stepSizeArgument = 20; - uint8_t transitionTimeArgument = 10; - uint8_t optionsMaskArgument = 0; - uint8_t optionsOverrideArgument = 0; - [cluster stepSaturation:stepModeArgument - stepSize:stepSizeArgument - transitionTime:transitionTimeArgument - optionsMask:optionsMaskArgument - optionsOverride:optionsOverrideArgument - responseHandler:^(NSError * err, NSDictionary * values) { - NSLog(@"Step saturation down command Error: %@", err); + [cluster readAttributeOperationalStatusWithResponseHandler:^(NSError * err, NSDictionary * values) { + NSLog(@"3a: TH reads OperationalStatus attribute from DUT Error: %@", err); - XCTAssertEqual(err.code, 0); + XCTAssertEqual(err.code, 0); - [expectation fulfill]; - }]; + XCTAssertEqual([values[@"value"] unsignedCharValue], 0); + + [expectation fulfill]; + }]; [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; } -- (void)testSendClusterTest_TC_CC_3_4_000017_MoveToHueAndSaturation + +- (void)testSendClusterTest_TC_WNCV_3_2_000000_UpOrOpen { - XCTestExpectation * expectation = [self expectationWithDescription:@"Move To current hue and saturation command"]; + XCTestExpectation * expectation = [self expectationWithDescription:@"1a: TH adjusts the the DUT to a non-closed position"]; CHIPDevice * device = GetPairedDevice(kDeviceId); dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPTestColorControl * cluster = [[CHIPTestColorControl alloc] initWithDevice:device endpoint:1 queue:queue]; + CHIPTestWindowCovering * cluster = [[CHIPTestWindowCovering alloc] initWithDevice:device endpoint:1 queue:queue]; XCTAssertNotNil(cluster); - uint8_t hueArgument = 40; - uint8_t saturationArgument = 160; - uint16_t transitionTimeArgument = 10U; - uint8_t optionsMaskArgument = 0; - uint8_t optionsOverrideArgument = 0; - [cluster moveToHueAndSaturation:hueArgument - saturation:saturationArgument - transitionTime:transitionTimeArgument - optionsMask:optionsMaskArgument - optionsOverride:optionsOverrideArgument - responseHandler:^(NSError * err, NSDictionary * values) { - NSLog(@"Move To current hue and saturation command Error: %@", err); + [cluster upOrOpen:^(NSError * err, NSDictionary * values) { + NSLog(@"1a: TH adjusts the the DUT to a non-closed position Error: %@", err); - XCTAssertEqual(err.code, 0); + XCTAssertEqual(err.code, 0); - [expectation fulfill]; - }]; + [expectation fulfill]; + }]; [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; } -- (void)testSendClusterTest_TC_CC_3_4_000018_Off +- (void)testSendClusterTest_TC_WNCV_3_2_000001_DownOrClose { - XCTestExpectation * expectation = [self expectationWithDescription:@"Turn off light that we turned on"]; + XCTestExpectation * expectation = [self expectationWithDescription:@"2a: TH sends DownOrClose command to DUT"]; CHIPDevice * device = GetPairedDevice(kDeviceId); dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPTestOnOff * cluster = [[CHIPTestOnOff alloc] initWithDevice:device endpoint:1 queue:queue]; + CHIPTestWindowCovering * cluster = [[CHIPTestWindowCovering alloc] initWithDevice:device endpoint:1 queue:queue]; XCTAssertNotNil(cluster); - [cluster off:^(NSError * err, NSDictionary * values) { - NSLog(@"Turn off light that we turned on Error: %@", err); + [cluster downOrClose:^(NSError * err, NSDictionary * values) { + NSLog(@"2a: TH sends DownOrClose command to DUT Error: %@", err); XCTAssertEqual(err.code, 0); @@ -4571,21 +4458,21 @@ - (void)testSendClusterTest_TC_CC_3_4_000018_Off [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; } -- (void)testSendClusterTest_TC_CC_3_4_000019_ReadAttribute +- (void)testSendClusterTest_TC_WNCV_3_2_000002_ReadAttribute { - XCTestExpectation * expectation = [self expectationWithDescription:@"Check on/off attribute value is false after off command"]; + XCTestExpectation * expectation = [self expectationWithDescription:@"3a: TH reads OperationalStatus attribute from DUT"]; CHIPDevice * device = GetPairedDevice(kDeviceId); dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPTestOnOff * cluster = [[CHIPTestOnOff alloc] initWithDevice:device endpoint:1 queue:queue]; + CHIPTestWindowCovering * cluster = [[CHIPTestWindowCovering alloc] initWithDevice:device endpoint:1 queue:queue]; XCTAssertNotNil(cluster); - [cluster readAttributeOnOffWithResponseHandler:^(NSError * err, NSDictionary * values) { - NSLog(@"Check on/off attribute value is false after off command Error: %@", err); + [cluster readAttributeOperationalStatusWithResponseHandler:^(NSError * err, NSDictionary * values) { + NSLog(@"3a: TH reads OperationalStatus attribute from DUT Error: %@", err); XCTAssertEqual(err.code, 0); - XCTAssertEqual([values[@"value"] boolValue], 0); + XCTAssertEqual([values[@"value"] unsignedCharValue], 0); [expectation fulfill]; }]; @@ -4593,17 +4480,17 @@ - (void)testSendClusterTest_TC_CC_3_4_000019_ReadAttribute [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; } -- (void)testSendClusterTest_TC_CC_5_000000_On +- (void)testSendClusterTest_TC_WNCV_3_3_000000_UpOrOpen { - XCTestExpectation * expectation = [self expectationWithDescription:@"Turn on light for color control tests"]; + XCTestExpectation * expectation = [self expectationWithDescription:@"1a: TH adjusts the the DUT to a non-open position"]; CHIPDevice * device = GetPairedDevice(kDeviceId); dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPTestOnOff * cluster = [[CHIPTestOnOff alloc] initWithDevice:device endpoint:1 queue:queue]; + CHIPTestWindowCovering * cluster = [[CHIPTestWindowCovering alloc] initWithDevice:device endpoint:1 queue:queue]; XCTAssertNotNil(cluster); - [cluster on:^(NSError * err, NSDictionary * values) { - NSLog(@"Turn on light for color control tests Error: %@", err); + [cluster upOrOpen:^(NSError * err, NSDictionary * values) { + NSLog(@"1a: TH adjusts the the DUT to a non-open position Error: %@", err); XCTAssertEqual(err.code, 0); @@ -4612,339 +4499,1864 @@ - (void)testSendClusterTest_TC_CC_5_000000_On [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; } -- (void)testSendClusterTest_TC_CC_5_000001_ReadAttribute +- (void)testSendClusterTest_TC_WNCV_3_3_000001_StopMotion { - XCTestExpectation * expectation = [self expectationWithDescription:@"Check on/off attribute value is true after on command"]; + XCTestExpectation * expectation = [self expectationWithDescription:@"2a: TH sends StopMotion command to DUT"]; CHIPDevice * device = GetPairedDevice(kDeviceId); dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPTestOnOff * cluster = [[CHIPTestOnOff alloc] initWithDevice:device endpoint:1 queue:queue]; + CHIPTestWindowCovering * cluster = [[CHIPTestWindowCovering alloc] initWithDevice:device endpoint:1 queue:queue]; XCTAssertNotNil(cluster); - [cluster readAttributeOnOffWithResponseHandler:^(NSError * err, NSDictionary * values) { - NSLog(@"Check on/off attribute value is true after on command Error: %@", err); + [cluster stopMotion:^(NSError * err, NSDictionary * values) { + NSLog(@"2a: TH sends StopMotion command to DUT Error: %@", err); XCTAssertEqual(err.code, 0); - XCTAssertEqual([values[@"value"] boolValue], 1); - [expectation fulfill]; }]; [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; } -- (void)testSendClusterTest_TC_CC_5_000002_MoveToColor +- (void)testSendClusterTest_TC_WNCV_3_3_000002_ReadAttribute { - XCTestExpectation * expectation = [self expectationWithDescription:@"Move to Color command"]; + XCTestExpectation * expectation = [self expectationWithDescription:@"2b: TH reads OperationalStatus attribute from DUT"]; CHIPDevice * device = GetPairedDevice(kDeviceId); dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPTestColorControl * cluster = [[CHIPTestColorControl alloc] initWithDevice:device endpoint:1 queue:queue]; + CHIPTestWindowCovering * cluster = [[CHIPTestWindowCovering alloc] initWithDevice:device endpoint:1 queue:queue]; XCTAssertNotNil(cluster); - uint16_t colorXArgument = 200U; - uint16_t colorYArgument = 300U; - uint16_t transitionTimeArgument = 20U; - uint8_t optionsMaskArgument = 0; - uint8_t optionsOverrideArgument = 0; - [cluster moveToColor:colorXArgument - colorY:colorYArgument - transitionTime:transitionTimeArgument - optionsMask:optionsMaskArgument - optionsOverride:optionsOverrideArgument - responseHandler:^(NSError * err, NSDictionary * values) { - NSLog(@"Move to Color command Error: %@", err); + [cluster readAttributeOperationalStatusWithResponseHandler:^(NSError * err, NSDictionary * values) { + NSLog(@"2b: TH reads OperationalStatus attribute from DUT Error: %@", err); - XCTAssertEqual(err.code, 0); + XCTAssertEqual(err.code, 0); - [expectation fulfill]; - }]; + XCTAssertEqual([values[@"value"] unsignedCharValue], 0); + + [expectation fulfill]; + }]; [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; } -- (void)testSendClusterTest_TC_CC_5_000003_MoveColor + +- (void)testSendClusterTest_TC_BI_1_1_000000_ReadAttribute { - XCTestExpectation * expectation = [self expectationWithDescription:@"Move Color command"]; + XCTestExpectation * expectation = [self expectationWithDescription:@"read the global attribute: ClusterRevision"]; CHIPDevice * device = GetPairedDevice(kDeviceId); dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPTestColorControl * cluster = [[CHIPTestColorControl alloc] initWithDevice:device endpoint:1 queue:queue]; + CHIPTestBinaryInputBasic * cluster = [[CHIPTestBinaryInputBasic alloc] initWithDevice:device endpoint:1 queue:queue]; XCTAssertNotNil(cluster); - int16_t rateXArgument = 15; - int16_t rateYArgument = 20; - uint8_t optionsMaskArgument = 0; - uint8_t optionsOverrideArgument = 0; - [cluster moveColor:rateXArgument - rateY:rateYArgument - optionsMask:optionsMaskArgument - optionsOverride:optionsOverrideArgument - responseHandler:^(NSError * err, NSDictionary * values) { - NSLog(@"Move Color command Error: %@", err); + [cluster readAttributeClusterRevisionWithResponseHandler:^(NSError * err, NSDictionary * values) { + NSLog(@"read the global attribute: ClusterRevision Error: %@", err); - XCTAssertEqual(err.code, 0); + XCTAssertEqual(err.code, 0); - [expectation fulfill]; - }]; + XCTAssertEqual([values[@"value"] unsignedShortValue], 1); + + [expectation fulfill]; + }]; [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; } -- (void)testSendClusterTest_TC_CC_5_000004_StopMoveStep +- (void)testSendClusterTest_TC_BI_1_1_000001_WriteAttribute { - XCTestExpectation * expectation = [self expectationWithDescription:@"Stop Move Step command"]; + XCTestExpectation * expectation = + [self expectationWithDescription:@"write the default values to mandatory global attribute: ClusterRevision"]; CHIPDevice * device = GetPairedDevice(kDeviceId); dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPTestColorControl * cluster = [[CHIPTestColorControl alloc] initWithDevice:device endpoint:1 queue:queue]; + CHIPTestBinaryInputBasic * cluster = [[CHIPTestBinaryInputBasic alloc] initWithDevice:device endpoint:1 queue:queue]; XCTAssertNotNil(cluster); - uint8_t optionsMaskArgument = 0; - uint8_t optionsOverrideArgument = 0; - [cluster stopMoveStep:optionsMaskArgument - optionsOverride:optionsOverrideArgument - responseHandler:^(NSError * err, NSDictionary * values) { - NSLog(@"Stop Move Step command Error: %@", err); - - XCTAssertEqual(err.code, 0); + uint16_t clusterRevisionArgument = 1U; + [cluster + writeAttributeClusterRevisionWithValue:clusterRevisionArgument + responseHandler:^(NSError * err, NSDictionary * values) { + NSLog(@"write the default values to mandatory global attribute: ClusterRevision Error: %@", err); - [expectation fulfill]; - }]; + XCTAssertEqual(err.code, 1); + [expectation fulfill]; + }]; [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; } -- (void)testSendClusterTest_TC_CC_5_000005_StepColor +- (void)testSendClusterTest_TC_BI_1_1_000002_ReadAttribute { - XCTestExpectation * expectation = [self expectationWithDescription:@"Step Color command"]; + XCTestExpectation * expectation = [self expectationWithDescription:@"reads back global attribute: ClusterRevision"]; CHIPDevice * device = GetPairedDevice(kDeviceId); dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPTestColorControl * cluster = [[CHIPTestColorControl alloc] initWithDevice:device endpoint:1 queue:queue]; + CHIPTestBinaryInputBasic * cluster = [[CHIPTestBinaryInputBasic alloc] initWithDevice:device endpoint:1 queue:queue]; XCTAssertNotNil(cluster); - int16_t stepXArgument = 15; - int16_t stepYArgument = 20; - uint16_t transitionTimeArgument = 50U; - uint8_t optionsMaskArgument = 0; - uint8_t optionsOverrideArgument = 0; - [cluster stepColor:stepXArgument - stepY:stepYArgument - transitionTime:transitionTimeArgument - optionsMask:optionsMaskArgument - optionsOverride:optionsOverrideArgument - responseHandler:^(NSError * err, NSDictionary * values) { - NSLog(@"Step Color command Error: %@", err); + [cluster readAttributeClusterRevisionWithResponseHandler:^(NSError * err, NSDictionary * values) { + NSLog(@"reads back global attribute: ClusterRevision Error: %@", err); - XCTAssertEqual(err.code, 0); + XCTAssertEqual(err.code, 0); - [expectation fulfill]; - }]; + XCTAssertEqual([values[@"value"] unsignedShortValue], 1); + + [expectation fulfill]; + }]; [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; } -- (void)testSendClusterTest_TC_CC_5_000006_Off + +- (void)testSendClusterTest_TC_FLW_1_1_000000_WriteAttribute { - XCTestExpectation * expectation = [self expectationWithDescription:@"Turn off light that we turned on"]; + XCTestExpectation * expectation = + [self expectationWithDescription:@"write the default values to mandatory global attribute: ClusterRevision"]; CHIPDevice * device = GetPairedDevice(kDeviceId); dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPTestOnOff * cluster = [[CHIPTestOnOff alloc] initWithDevice:device endpoint:1 queue:queue]; + CHIPTestFlowMeasurement * cluster = [[CHIPTestFlowMeasurement alloc] initWithDevice:device endpoint:1 queue:queue]; XCTAssertNotNil(cluster); - [cluster off:^(NSError * err, NSDictionary * values) { - NSLog(@"Turn off light that we turned on Error: %@", err); - - XCTAssertEqual(err.code, 0); + uint16_t clusterRevisionArgument = 2U; + [cluster + writeAttributeClusterRevisionWithValue:clusterRevisionArgument + responseHandler:^(NSError * err, NSDictionary * values) { + NSLog(@"write the default values to mandatory global attribute: ClusterRevision Error: %@", err); - [expectation fulfill]; - }]; + XCTAssertEqual(err.code, 1); + [expectation fulfill]; + }]; [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; } -- (void)testSendClusterTest_TC_CC_5_000007_ReadAttribute + +- (void)testSendClusterTest_TC_TM_1_1_000000_ReadAttribute { - XCTestExpectation * expectation = [self expectationWithDescription:@"Check on/off attribute value is false after off command"]; + XCTestExpectation * expectation = [self expectationWithDescription:@"read the global attribute: ClusterRevision"]; CHIPDevice * device = GetPairedDevice(kDeviceId); dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPTestOnOff * cluster = [[CHIPTestOnOff alloc] initWithDevice:device endpoint:1 queue:queue]; + CHIPTestTemperatureMeasurement * cluster = [[CHIPTestTemperatureMeasurement alloc] initWithDevice:device + endpoint:1 + queue:queue]; XCTAssertNotNil(cluster); - [cluster readAttributeOnOffWithResponseHandler:^(NSError * err, NSDictionary * values) { - NSLog(@"Check on/off attribute value is false after off command Error: %@", err); + [cluster readAttributeClusterRevisionWithResponseHandler:^(NSError * err, NSDictionary * values) { + NSLog(@"read the global attribute: ClusterRevision Error: %@", err); XCTAssertEqual(err.code, 0); - XCTAssertEqual([values[@"value"] boolValue], 0); + XCTAssertEqual([values[@"value"] unsignedShortValue], 3); [expectation fulfill]; }]; [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; } - -- (void)testSendClusterTest_TC_CC_6_000000_On +- (void)testSendClusterTest_TC_TM_1_1_000001_WriteAttribute { - XCTestExpectation * expectation = [self expectationWithDescription:@"Turn on light for color control tests"]; + XCTestExpectation * expectation = + [self expectationWithDescription:@"write the default values to mandatory global attribute: ClusterRevision"]; CHIPDevice * device = GetPairedDevice(kDeviceId); dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPTestOnOff * cluster = [[CHIPTestOnOff alloc] initWithDevice:device endpoint:1 queue:queue]; + CHIPTestTemperatureMeasurement * cluster = [[CHIPTestTemperatureMeasurement alloc] initWithDevice:device + endpoint:1 + queue:queue]; XCTAssertNotNil(cluster); - [cluster on:^(NSError * err, NSDictionary * values) { - NSLog(@"Turn on light for color control tests Error: %@", err); - - XCTAssertEqual(err.code, 0); + uint16_t clusterRevisionArgument = 3U; + [cluster + writeAttributeClusterRevisionWithValue:clusterRevisionArgument + responseHandler:^(NSError * err, NSDictionary * values) { + NSLog(@"write the default values to mandatory global attribute: ClusterRevision Error: %@", err); - [expectation fulfill]; - }]; + XCTAssertEqual(err.code, 1); + [expectation fulfill]; + }]; [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; } -- (void)testSendClusterTest_TC_CC_6_000001_ReadAttribute +- (void)testSendClusterTest_TC_TM_1_1_000002_ReadAttribute { - XCTestExpectation * expectation = [self expectationWithDescription:@"Check on/off attribute value is true after on command"]; + XCTestExpectation * expectation = [self expectationWithDescription:@"reads back global attribute: ClusterRevision"]; CHIPDevice * device = GetPairedDevice(kDeviceId); dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPTestOnOff * cluster = [[CHIPTestOnOff alloc] initWithDevice:device endpoint:1 queue:queue]; + CHIPTestTemperatureMeasurement * cluster = [[CHIPTestTemperatureMeasurement alloc] initWithDevice:device + endpoint:1 + queue:queue]; XCTAssertNotNil(cluster); - [cluster readAttributeOnOffWithResponseHandler:^(NSError * err, NSDictionary * values) { - NSLog(@"Check on/off attribute value is true after on command Error: %@", err); + [cluster readAttributeClusterRevisionWithResponseHandler:^(NSError * err, NSDictionary * values) { + NSLog(@"reads back global attribute: ClusterRevision Error: %@", err); XCTAssertEqual(err.code, 0); - XCTAssertEqual([values[@"value"] boolValue], 1); + XCTAssertEqual([values[@"value"] unsignedShortValue], 3); [expectation fulfill]; }]; [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; } -- (void)testSendClusterTest_TC_CC_6_000002_MoveToColorTemperature + +- (void)testSendClusterTest_TC_OCC_1_1_000000_ReadAttribute { - XCTestExpectation * expectation = [self expectationWithDescription:@"Move To Color Temperature command"]; + XCTestExpectation * expectation = [self expectationWithDescription:@"read the global attribute: ClusterRevision"]; CHIPDevice * device = GetPairedDevice(kDeviceId); dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPTestColorControl * cluster = [[CHIPTestColorControl alloc] initWithDevice:device endpoint:1 queue:queue]; + CHIPTestOccupancySensing * cluster = [[CHIPTestOccupancySensing alloc] initWithDevice:device endpoint:1 queue:queue]; XCTAssertNotNil(cluster); - uint16_t colorTemperatureArgument = 100U; - uint16_t transitionTimeArgument = 10U; - uint8_t optionsMaskArgument = 0; - uint8_t optionsOverrideArgument = 0; - [cluster moveToColorTemperature:colorTemperatureArgument - transitionTime:transitionTimeArgument - optionsMask:optionsMaskArgument - optionsOverride:optionsOverrideArgument - responseHandler:^(NSError * err, NSDictionary * values) { - NSLog(@"Move To Color Temperature command Error: %@", err); + [cluster readAttributeClusterRevisionWithResponseHandler:^(NSError * err, NSDictionary * values) { + NSLog(@"read the global attribute: ClusterRevision Error: %@", err); - XCTAssertEqual(err.code, 0); + XCTAssertEqual(err.code, 0); - [expectation fulfill]; - }]; + XCTAssertEqual([values[@"value"] unsignedShortValue], 2); + + [expectation fulfill]; + }]; [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; } -- (void)testSendClusterTest_TC_CC_6_000003_MoveColorTemperature +- (void)testSendClusterTest_TC_OCC_1_1_000001_WriteAttribute { - XCTestExpectation * expectation = [self expectationWithDescription:@"Move up color temperature command"]; + XCTestExpectation * expectation = + [self expectationWithDescription:@"write the default values to mandatory global attribute: ClusterRevision"]; CHIPDevice * device = GetPairedDevice(kDeviceId); dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPTestColorControl * cluster = [[CHIPTestColorControl alloc] initWithDevice:device endpoint:1 queue:queue]; + CHIPTestOccupancySensing * cluster = [[CHIPTestOccupancySensing alloc] initWithDevice:device endpoint:1 queue:queue]; XCTAssertNotNil(cluster); - uint8_t moveModeArgument = 1; - uint16_t rateArgument = 10U; - uint16_t colorTemperatureMinimumArgument = 1U; - uint16_t colorTemperatureMaximumArgument = 255U; - uint8_t optionsMaskArgument = 0; - uint8_t optionsOverrideArgument = 0; - [cluster moveColorTemperature:moveModeArgument - rate:rateArgument - colorTemperatureMinimum:colorTemperatureMinimumArgument - colorTemperatureMaximum:colorTemperatureMaximumArgument - optionsMask:optionsMaskArgument - optionsOverride:optionsOverrideArgument - responseHandler:^(NSError * err, NSDictionary * values) { - NSLog(@"Move up color temperature command Error: %@", err); - - XCTAssertEqual(err.code, 0); + uint16_t clusterRevisionArgument = 2U; + [cluster + writeAttributeClusterRevisionWithValue:clusterRevisionArgument + responseHandler:^(NSError * err, NSDictionary * values) { + NSLog(@"write the default values to mandatory global attribute: ClusterRevision Error: %@", err); - [expectation fulfill]; - }]; + XCTAssertEqual(err.code, 1); + [expectation fulfill]; + }]; [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; } -- (void)testSendClusterTest_TC_CC_6_000004_MoveColorTemperature + +- (void)testSendClusterTestOperationalCredentialsCluster_000000_ReadAttribute { - XCTestExpectation * expectation = [self expectationWithDescription:@"Stop Color Temperature command"]; + XCTestExpectation * expectation = [self expectationWithDescription:@"Read number of supported fabrics"]; CHIPDevice * device = GetPairedDevice(kDeviceId); dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPTestColorControl * cluster = [[CHIPTestColorControl alloc] initWithDevice:device endpoint:1 queue:queue]; + CHIPTestOperationalCredentials * cluster = [[CHIPTestOperationalCredentials alloc] initWithDevice:device + endpoint:0 + queue:queue]; XCTAssertNotNil(cluster); - uint8_t moveModeArgument = 0; - uint16_t rateArgument = 10U; - uint16_t colorTemperatureMinimumArgument = 1U; - uint16_t colorTemperatureMaximumArgument = 255U; - uint8_t optionsMaskArgument = 0; - uint8_t optionsOverrideArgument = 0; - [cluster moveColorTemperature:moveModeArgument - rate:rateArgument - colorTemperatureMinimum:colorTemperatureMinimumArgument - colorTemperatureMaximum:colorTemperatureMaximumArgument - optionsMask:optionsMaskArgument - optionsOverride:optionsOverrideArgument - responseHandler:^(NSError * err, NSDictionary * values) { - NSLog(@"Stop Color Temperature command Error: %@", err); + [cluster readAttributeSupportedFabricsWithResponseHandler:^(NSError * err, NSDictionary * values) { + NSLog(@"Read number of supported fabrics Error: %@", err); - XCTAssertEqual(err.code, 0); + XCTAssertEqual(err.code, 0); - [expectation fulfill]; - }]; + XCTAssertGreaterThanOrEqual([values[@"value"] unsignedCharValue], 4); + + [expectation fulfill]; + }]; [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; } -- (void)testSendClusterTest_TC_CC_6_000005_MoveColorTemperature +- (void)testSendClusterTestOperationalCredentialsCluster_000001_ReadAttribute { - XCTestExpectation * expectation = [self expectationWithDescription:@"Move down color temperature command"]; + XCTestExpectation * expectation = [self expectationWithDescription:@"Read number of commissioned fabrics"]; CHIPDevice * device = GetPairedDevice(kDeviceId); dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPTestColorControl * cluster = [[CHIPTestColorControl alloc] initWithDevice:device endpoint:1 queue:queue]; + CHIPTestOperationalCredentials * cluster = [[CHIPTestOperationalCredentials alloc] initWithDevice:device + endpoint:0 + queue:queue]; XCTAssertNotNil(cluster); - uint8_t moveModeArgument = 3; - uint16_t rateArgument = 20U; - uint16_t colorTemperatureMinimumArgument = 1U; - uint16_t colorTemperatureMaximumArgument = 255U; - uint8_t optionsMaskArgument = 0; - uint8_t optionsOverrideArgument = 0; - [cluster moveColorTemperature:moveModeArgument - rate:rateArgument - colorTemperatureMinimum:colorTemperatureMinimumArgument - colorTemperatureMaximum:colorTemperatureMaximumArgument - optionsMask:optionsMaskArgument - optionsOverride:optionsOverrideArgument - responseHandler:^(NSError * err, NSDictionary * values) { - NSLog(@"Move down color temperature command Error: %@", err); + [cluster readAttributeCommissionedFabricsWithResponseHandler:^(NSError * err, NSDictionary * values) { + NSLog(@"Read number of commissioned fabrics Error: %@", err); + + XCTAssertEqual(err.code, 0); + + XCTAssertGreaterThanOrEqual([values[@"value"] unsignedCharValue], 1); + + [expectation fulfill]; + }]; + + [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; +} + +- (void)testSendClusterTest_TC_LVL_1_1_000000_WriteAttribute +{ + XCTestExpectation * expectation = + [self expectationWithDescription:@"write the default values to mandatory global attribute: ClusterRevision"]; + + CHIPDevice * device = GetPairedDevice(kDeviceId); + dispatch_queue_t queue = dispatch_get_main_queue(); + CHIPTestLevelControl * cluster = [[CHIPTestLevelControl alloc] initWithDevice:device endpoint:1 queue:queue]; + XCTAssertNotNil(cluster); + + uint16_t clusterRevisionArgument = 4U; + [cluster + writeAttributeClusterRevisionWithValue:clusterRevisionArgument + responseHandler:^(NSError * err, NSDictionary * values) { + NSLog(@"write the default values to mandatory global attribute: ClusterRevision Error: %@", err); + + XCTAssertEqual(err.code, 1); + [expectation fulfill]; + }]; + + [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; +} + +- (void)testSendClusterTest_TC_CC_1_1_000000_WriteAttribute +{ + XCTestExpectation * expectation = + [self expectationWithDescription:@"write the default values to mandatory global attribute: ClusterRevision"]; + + CHIPDevice * device = GetPairedDevice(kDeviceId); + dispatch_queue_t queue = dispatch_get_main_queue(); + CHIPTestColorControl * cluster = [[CHIPTestColorControl alloc] initWithDevice:device endpoint:1 queue:queue]; + XCTAssertNotNil(cluster); + + uint16_t clusterRevisionArgument = 4U; + [cluster + writeAttributeClusterRevisionWithValue:clusterRevisionArgument + responseHandler:^(NSError * err, NSDictionary * values) { + NSLog(@"write the default values to mandatory global attribute: ClusterRevision Error: %@", err); + + XCTAssertEqual(err.code, 1); + [expectation fulfill]; + }]; + + [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; +} + +- (void)testSendClusterTest_TC_RH_1_1_000000_WriteAttribute +{ + XCTestExpectation * expectation = + [self expectationWithDescription:@"write the default values to mandatory global attribute: ClusterRevision"]; + + CHIPDevice * device = GetPairedDevice(kDeviceId); + dispatch_queue_t queue = dispatch_get_main_queue(); + CHIPTestRelativeHumidityMeasurement * cluster = [[CHIPTestRelativeHumidityMeasurement alloc] initWithDevice:device + endpoint:1 + queue:queue]; + XCTAssertNotNil(cluster); + + uint16_t clusterRevisionArgument = 1U; + [cluster + writeAttributeClusterRevisionWithValue:clusterRevisionArgument + responseHandler:^(NSError * err, NSDictionary * values) { + NSLog(@"write the default values to mandatory global attribute: ClusterRevision Error: %@", err); + + XCTAssertEqual(err.code, 1); + [expectation fulfill]; + }]; + + [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; +} + +- (void)testSendClusterTest_TC_MC_1_1_000000_WriteAttribute +{ + XCTestExpectation * expectation = + [self expectationWithDescription:@"write the default values to mandatory global attribute: ClusterRevision"]; + + CHIPDevice * device = GetPairedDevice(kDeviceId); + dispatch_queue_t queue = dispatch_get_main_queue(); + CHIPTestRelativeHumidityMeasurement * cluster = [[CHIPTestRelativeHumidityMeasurement alloc] initWithDevice:device + endpoint:1 + queue:queue]; + XCTAssertNotNil(cluster); + + uint16_t clusterRevisionArgument = 1U; + [cluster + writeAttributeClusterRevisionWithValue:clusterRevisionArgument + responseHandler:^(NSError * err, NSDictionary * values) { + NSLog(@"write the default values to mandatory global attribute: ClusterRevision Error: %@", err); + + XCTAssertEqual(err.code, 1); + [expectation fulfill]; + }]; + + [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; +} + +- (void)testSendClusterTest_TC_TSTAT_1_1_000000_WriteAttribute +{ + XCTestExpectation * expectation = + [self expectationWithDescription:@"write the default values to mandatory global attribute: ClusterRevision"]; + + CHIPDevice * device = GetPairedDevice(kDeviceId); + dispatch_queue_t queue = dispatch_get_main_queue(); + CHIPTestThermostat * cluster = [[CHIPTestThermostat alloc] initWithDevice:device endpoint:1 queue:queue]; + XCTAssertNotNil(cluster); + + uint16_t clusterRevisionArgument = 5U; + [cluster + writeAttributeClusterRevisionWithValue:clusterRevisionArgument + responseHandler:^(NSError * err, NSDictionary * values) { + NSLog(@"write the default values to mandatory global attribute: ClusterRevision Error: %@", err); + + XCTAssertEqual(err.code, 1); + [expectation fulfill]; + }]; + + [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; +} + +- (void)testSendClusterTest_TC_PCC_1_1_000000_WriteAttribute +{ + XCTestExpectation * expectation = + [self expectationWithDescription:@"write the default values to mandatory global attribute: ClusterRevision"]; + + CHIPDevice * device = GetPairedDevice(kDeviceId); + dispatch_queue_t queue = dispatch_get_main_queue(); + CHIPTestPumpConfigurationAndControl * cluster = [[CHIPTestPumpConfigurationAndControl alloc] initWithDevice:device + endpoint:1 + queue:queue]; + XCTAssertNotNil(cluster); + + uint16_t clusterRevisionArgument = 3U; + [cluster + writeAttributeClusterRevisionWithValue:clusterRevisionArgument + responseHandler:^(NSError * err, NSDictionary * values) { + NSLog(@"write the default values to mandatory global attribute: ClusterRevision Error: %@", err); + + XCTAssertEqual(err.code, 1); + [expectation fulfill]; + }]; + + [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; +} + +- (void)testSendClusterTest_TC_TSUIC_1_1_000000_WriteAttribute +{ + XCTestExpectation * expectation = + [self expectationWithDescription:@"write the default values to mandatory global attribute: ClusterRevision"]; + + CHIPDevice * device = GetPairedDevice(kDeviceId); + dispatch_queue_t queue = dispatch_get_main_queue(); + CHIPTestThermostatUserInterfaceConfiguration * cluster = + [[CHIPTestThermostatUserInterfaceConfiguration alloc] initWithDevice:device endpoint:1 queue:queue]; + XCTAssertNotNil(cluster); + + uint16_t clusterRevisionArgument = 2U; + [cluster + writeAttributeClusterRevisionWithValue:clusterRevisionArgument + responseHandler:^(NSError * err, NSDictionary * values) { + NSLog(@"write the default values to mandatory global attribute: ClusterRevision Error: %@", err); + + XCTAssertEqual(err.code, 1); + [expectation fulfill]; + }]; + + [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; +} + +- (void)testSendClusterTest_TC_DIAGTH_1_1_000000_ReadAttribute +{ + XCTestExpectation * expectation = [self expectationWithDescription:@"read the global attribute: ClusterRevision"]; + + CHIPDevice * device = GetPairedDevice(kDeviceId); + dispatch_queue_t queue = dispatch_get_main_queue(); + CHIPTestThreadNetworkDiagnostics * cluster = [[CHIPTestThreadNetworkDiagnostics alloc] initWithDevice:device + endpoint:0 + queue:queue]; + XCTAssertNotNil(cluster); + + [cluster readAttributeClusterRevisionWithResponseHandler:^(NSError * err, NSDictionary * values) { + NSLog(@"read the global attribute: ClusterRevision Error: %@", err); + + XCTAssertEqual(err.code, 0); + + XCTAssertEqual([values[@"value"] unsignedShortValue], 1); + + [expectation fulfill]; + }]; + + [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; +} +- (void)testSendClusterTest_TC_DIAGTH_1_1_000001_WriteAttribute +{ + XCTestExpectation * expectation = + [self expectationWithDescription:@"write the default values to mandatory global attribute: ClusterRevision"]; + + CHIPDevice * device = GetPairedDevice(kDeviceId); + dispatch_queue_t queue = dispatch_get_main_queue(); + CHIPTestThreadNetworkDiagnostics * cluster = [[CHIPTestThreadNetworkDiagnostics alloc] initWithDevice:device + endpoint:0 + queue:queue]; + XCTAssertNotNil(cluster); + + uint16_t clusterRevisionArgument = 1U; + [cluster + writeAttributeClusterRevisionWithValue:clusterRevisionArgument + responseHandler:^(NSError * err, NSDictionary * values) { + NSLog(@"write the default values to mandatory global attribute: ClusterRevision Error: %@", err); + + XCTAssertEqual(err.code, 1); + [expectation fulfill]; + }]; + + [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; +} +- (void)testSendClusterTest_TC_DIAGTH_1_1_000002_ReadAttribute +{ + XCTestExpectation * expectation = [self expectationWithDescription:@"reads back global attribute: ClusterRevision"]; + + CHIPDevice * device = GetPairedDevice(kDeviceId); + dispatch_queue_t queue = dispatch_get_main_queue(); + CHIPTestThreadNetworkDiagnostics * cluster = [[CHIPTestThreadNetworkDiagnostics alloc] initWithDevice:device + endpoint:0 + queue:queue]; + XCTAssertNotNil(cluster); + + [cluster readAttributeClusterRevisionWithResponseHandler:^(NSError * err, NSDictionary * values) { + NSLog(@"reads back global attribute: ClusterRevision Error: %@", err); + + XCTAssertEqual(err.code, 0); + + XCTAssertEqual([values[@"value"] unsignedShortValue], 1); + + [expectation fulfill]; + }]; + + [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; +} + +- (void)testSendClusterTest_TC_TM_2_1_000000_ReadAttribute +{ + XCTestExpectation * expectation = [self expectationWithDescription:@"read the mandatory attribute: MeasuredValue"]; + + CHIPDevice * device = GetPairedDevice(kDeviceId); + dispatch_queue_t queue = dispatch_get_main_queue(); + CHIPTestTemperatureMeasurement * cluster = [[CHIPTestTemperatureMeasurement alloc] initWithDevice:device + endpoint:1 + queue:queue]; + XCTAssertNotNil(cluster); + + [cluster readAttributeMeasuredValueWithResponseHandler:^(NSError * err, NSDictionary * values) { + NSLog(@"read the mandatory attribute: MeasuredValue Error: %@", err); + + XCTAssertEqual(err.code, 0); + + [expectation fulfill]; + }]; + + [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; +} + +- (void)testSendClusterTest_TC_TSUIC_2_1_000000_ReadAttribute +{ + XCTestExpectation * expectation = [self expectationWithDescription:@"read the mandatory attribute: TemperatureDisplayMode"]; + + CHIPDevice * device = GetPairedDevice(kDeviceId); + dispatch_queue_t queue = dispatch_get_main_queue(); + CHIPTestThermostatUserInterfaceConfiguration * cluster = + [[CHIPTestThermostatUserInterfaceConfiguration alloc] initWithDevice:device endpoint:1 queue:queue]; + XCTAssertNotNil(cluster); + + [cluster readAttributeTemperatureDisplayModeWithResponseHandler:^(NSError * err, NSDictionary * values) { + NSLog(@"read the mandatory attribute: TemperatureDisplayMode Error: %@", err); + + XCTAssertEqual(err.code, 0); + + XCTAssertEqual([values[@"value"] unsignedCharValue], 0); + + [expectation fulfill]; + }]; + + [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; +} +- (void)testSendClusterTest_TC_TSUIC_2_1_000001_ReadAttribute +{ + XCTestExpectation * expectation = [self expectationWithDescription:@"read the mandatory attribute: TemperatureDisplayMode"]; + + CHIPDevice * device = GetPairedDevice(kDeviceId); + dispatch_queue_t queue = dispatch_get_main_queue(); + CHIPTestThermostatUserInterfaceConfiguration * cluster = + [[CHIPTestThermostatUserInterfaceConfiguration alloc] initWithDevice:device endpoint:1 queue:queue]; + XCTAssertNotNil(cluster); + + [cluster readAttributeTemperatureDisplayModeWithResponseHandler:^(NSError * err, NSDictionary * values) { + NSLog(@"read the mandatory attribute: TemperatureDisplayMode Error: %@", err); + + XCTAssertEqual(err.code, 0); + + [expectation fulfill]; + }]; + + [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; +} +- (void)testSendClusterTest_TC_TSUIC_2_1_000002_WriteAttribute +{ + XCTestExpectation * expectation = [self expectationWithDescription:@"write to the mandatory attribute: TemperatureDisplayMode"]; + + CHIPDevice * device = GetPairedDevice(kDeviceId); + dispatch_queue_t queue = dispatch_get_main_queue(); + CHIPTestThermostatUserInterfaceConfiguration * cluster = + [[CHIPTestThermostatUserInterfaceConfiguration alloc] initWithDevice:device endpoint:1 queue:queue]; + XCTAssertNotNil(cluster); + + uint8_t temperatureDisplayModeArgument = 0; + [cluster writeAttributeTemperatureDisplayModeWithValue:temperatureDisplayModeArgument + responseHandler:^(NSError * err, NSDictionary * values) { + NSLog(@"write to the mandatory attribute: TemperatureDisplayMode Error: %@", err); + + XCTAssertEqual(err.code, 0); + + [expectation fulfill]; + }]; + + [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; +} +- (void)testSendClusterTest_TC_TSUIC_2_1_000003_ReadAttribute +{ + XCTestExpectation * expectation = [self expectationWithDescription:@"read the mandatory attribute: TemperatureDisplayMode"]; + + CHIPDevice * device = GetPairedDevice(kDeviceId); + dispatch_queue_t queue = dispatch_get_main_queue(); + CHIPTestThermostatUserInterfaceConfiguration * cluster = + [[CHIPTestThermostatUserInterfaceConfiguration alloc] initWithDevice:device endpoint:1 queue:queue]; + XCTAssertNotNil(cluster); + + [cluster readAttributeTemperatureDisplayModeWithResponseHandler:^(NSError * err, NSDictionary * values) { + NSLog(@"read the mandatory attribute: TemperatureDisplayMode Error: %@", err); + + XCTAssertEqual(err.code, 0); + + XCTAssertEqual([values[@"value"] unsignedCharValue], 0); + + [expectation fulfill]; + }]; + + [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; +} +- (void)testSendClusterTest_TC_TSUIC_2_1_000004_ReadAttribute +{ + XCTestExpectation * expectation = [self expectationWithDescription:@"read the mandatory attribute: TemperatureDisplayMode"]; + + CHIPDevice * device = GetPairedDevice(kDeviceId); + dispatch_queue_t queue = dispatch_get_main_queue(); + CHIPTestThermostatUserInterfaceConfiguration * cluster = + [[CHIPTestThermostatUserInterfaceConfiguration alloc] initWithDevice:device endpoint:1 queue:queue]; + XCTAssertNotNil(cluster); + + [cluster readAttributeTemperatureDisplayModeWithResponseHandler:^(NSError * err, NSDictionary * values) { + NSLog(@"read the mandatory attribute: TemperatureDisplayMode Error: %@", err); + + XCTAssertEqual(err.code, 0); + + [expectation fulfill]; + }]; + + [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; +} +- (void)testSendClusterTest_TC_TSUIC_2_1_000005_ReadAttribute +{ + XCTestExpectation * expectation = [self expectationWithDescription:@"read the mandatory attribute: KeypadLockout"]; + + CHIPDevice * device = GetPairedDevice(kDeviceId); + dispatch_queue_t queue = dispatch_get_main_queue(); + CHIPTestThermostatUserInterfaceConfiguration * cluster = + [[CHIPTestThermostatUserInterfaceConfiguration alloc] initWithDevice:device endpoint:1 queue:queue]; + XCTAssertNotNil(cluster); + + [cluster readAttributeKeypadLockoutWithResponseHandler:^(NSError * err, NSDictionary * values) { + NSLog(@"read the mandatory attribute: KeypadLockout Error: %@", err); + + XCTAssertEqual(err.code, 0); + + XCTAssertEqual([values[@"value"] unsignedCharValue], 0); + + [expectation fulfill]; + }]; + + [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; +} +- (void)testSendClusterTest_TC_TSUIC_2_1_000006_ReadAttribute +{ + XCTestExpectation * expectation = [self expectationWithDescription:@"read the mandatory attribute: KeypadLockout"]; + + CHIPDevice * device = GetPairedDevice(kDeviceId); + dispatch_queue_t queue = dispatch_get_main_queue(); + CHIPTestThermostatUserInterfaceConfiguration * cluster = + [[CHIPTestThermostatUserInterfaceConfiguration alloc] initWithDevice:device endpoint:1 queue:queue]; + XCTAssertNotNil(cluster); + + [cluster readAttributeKeypadLockoutWithResponseHandler:^(NSError * err, NSDictionary * values) { + NSLog(@"read the mandatory attribute: KeypadLockout Error: %@", err); + + XCTAssertEqual(err.code, 0); + + [expectation fulfill]; + }]; + + [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; +} +- (void)testSendClusterTest_TC_TSUIC_2_1_000007_WriteAttribute +{ + XCTestExpectation * expectation = [self expectationWithDescription:@"write to the mandatory attribute: KeypadLockout"]; + + CHIPDevice * device = GetPairedDevice(kDeviceId); + dispatch_queue_t queue = dispatch_get_main_queue(); + CHIPTestThermostatUserInterfaceConfiguration * cluster = + [[CHIPTestThermostatUserInterfaceConfiguration alloc] initWithDevice:device endpoint:1 queue:queue]; + XCTAssertNotNil(cluster); + + uint8_t keypadLockoutArgument = 0; + [cluster writeAttributeKeypadLockoutWithValue:keypadLockoutArgument + responseHandler:^(NSError * err, NSDictionary * values) { + NSLog(@"write to the mandatory attribute: KeypadLockout Error: %@", err); + + XCTAssertEqual(err.code, 0); + + [expectation fulfill]; + }]; + + [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; +} +- (void)testSendClusterTest_TC_TSUIC_2_1_000008_ReadAttribute +{ + XCTestExpectation * expectation = [self expectationWithDescription:@"read the mandatory attribute: KeypadLockout"]; + + CHIPDevice * device = GetPairedDevice(kDeviceId); + dispatch_queue_t queue = dispatch_get_main_queue(); + CHIPTestThermostatUserInterfaceConfiguration * cluster = + [[CHIPTestThermostatUserInterfaceConfiguration alloc] initWithDevice:device endpoint:1 queue:queue]; + XCTAssertNotNil(cluster); + + [cluster readAttributeKeypadLockoutWithResponseHandler:^(NSError * err, NSDictionary * values) { + NSLog(@"read the mandatory attribute: KeypadLockout Error: %@", err); + + XCTAssertEqual(err.code, 0); + + XCTAssertEqual([values[@"value"] unsignedCharValue], 0); + + [expectation fulfill]; + }]; + + [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; +} +- (void)testSendClusterTest_TC_TSUIC_2_1_000009_ReadAttribute +{ + XCTestExpectation * expectation = [self expectationWithDescription:@"read the mandatory attribute: KeypadLockout"]; + + CHIPDevice * device = GetPairedDevice(kDeviceId); + dispatch_queue_t queue = dispatch_get_main_queue(); + CHIPTestThermostatUserInterfaceConfiguration * cluster = + [[CHIPTestThermostatUserInterfaceConfiguration alloc] initWithDevice:device endpoint:1 queue:queue]; + XCTAssertNotNil(cluster); + + [cluster readAttributeKeypadLockoutWithResponseHandler:^(NSError * err, NSDictionary * values) { + NSLog(@"read the mandatory attribute: KeypadLockout Error: %@", err); + + XCTAssertEqual(err.code, 0); + + [expectation fulfill]; + }]; + + [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; +} +- (void)testSendClusterTest_TC_TSUIC_2_1_000010_ReadAttribute +{ + XCTestExpectation * expectation = + [self expectationWithDescription:@"read the optional attribute: ScheduleProgrammingVisibility"]; + + CHIPDevice * device = GetPairedDevice(kDeviceId); + dispatch_queue_t queue = dispatch_get_main_queue(); + CHIPTestThermostatUserInterfaceConfiguration * cluster = + [[CHIPTestThermostatUserInterfaceConfiguration alloc] initWithDevice:device endpoint:1 queue:queue]; + XCTAssertNotNil(cluster); + + [cluster readAttributeScheduleProgrammingVisibilityWithResponseHandler:^(NSError * err, NSDictionary * values) { + NSLog(@"read the optional attribute: ScheduleProgrammingVisibility Error: %@", err); + + XCTAssertEqual(err.code, 0); + + XCTAssertEqual([values[@"value"] unsignedCharValue], 0); + + [expectation fulfill]; + }]; + + [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; +} +- (void)testSendClusterTest_TC_TSUIC_2_1_000011_ReadAttribute +{ + XCTestExpectation * expectation = + [self expectationWithDescription:@"read the optional attribute: ScheduleProgrammingVisibility"]; + + CHIPDevice * device = GetPairedDevice(kDeviceId); + dispatch_queue_t queue = dispatch_get_main_queue(); + CHIPTestThermostatUserInterfaceConfiguration * cluster = + [[CHIPTestThermostatUserInterfaceConfiguration alloc] initWithDevice:device endpoint:1 queue:queue]; + XCTAssertNotNil(cluster); + + [cluster readAttributeScheduleProgrammingVisibilityWithResponseHandler:^(NSError * err, NSDictionary * values) { + NSLog(@"read the optional attribute: ScheduleProgrammingVisibility Error: %@", err); + + XCTAssertEqual(err.code, 0); + + [expectation fulfill]; + }]; + + [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; +} +- (void)testSendClusterTest_TC_TSUIC_2_1_000012_WriteAttribute +{ + XCTestExpectation * expectation = + [self expectationWithDescription:@"write to the mandatory attribute: ScheduleProgrammingVisibility"]; + + CHIPDevice * device = GetPairedDevice(kDeviceId); + dispatch_queue_t queue = dispatch_get_main_queue(); + CHIPTestThermostatUserInterfaceConfiguration * cluster = + [[CHIPTestThermostatUserInterfaceConfiguration alloc] initWithDevice:device endpoint:1 queue:queue]; + XCTAssertNotNil(cluster); + + uint8_t scheduleProgrammingVisibilityArgument = 0; + [cluster + writeAttributeScheduleProgrammingVisibilityWithValue:scheduleProgrammingVisibilityArgument + responseHandler:^(NSError * err, NSDictionary * values) { + NSLog(@"write to the mandatory attribute: ScheduleProgrammingVisibility Error: %@", + err); + + XCTAssertEqual(err.code, 0); + + [expectation fulfill]; + }]; + + [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; +} +- (void)testSendClusterTest_TC_TSUIC_2_1_000013_ReadAttribute +{ + XCTestExpectation * expectation = + [self expectationWithDescription:@"read the optional attribute: ScheduleProgrammingVisibility"]; + + CHIPDevice * device = GetPairedDevice(kDeviceId); + dispatch_queue_t queue = dispatch_get_main_queue(); + CHIPTestThermostatUserInterfaceConfiguration * cluster = + [[CHIPTestThermostatUserInterfaceConfiguration alloc] initWithDevice:device endpoint:1 queue:queue]; + XCTAssertNotNil(cluster); + + [cluster readAttributeScheduleProgrammingVisibilityWithResponseHandler:^(NSError * err, NSDictionary * values) { + NSLog(@"read the optional attribute: ScheduleProgrammingVisibility Error: %@", err); + + XCTAssertEqual(err.code, 0); + + XCTAssertEqual([values[@"value"] unsignedCharValue], 0); + + [expectation fulfill]; + }]; + + [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; +} +- (void)testSendClusterTest_TC_TSUIC_2_1_000014_ReadAttribute +{ + XCTestExpectation * expectation = + [self expectationWithDescription:@"read the optional attribute: ScheduleProgrammingVisibility"]; + + CHIPDevice * device = GetPairedDevice(kDeviceId); + dispatch_queue_t queue = dispatch_get_main_queue(); + CHIPTestThermostatUserInterfaceConfiguration * cluster = + [[CHIPTestThermostatUserInterfaceConfiguration alloc] initWithDevice:device endpoint:1 queue:queue]; + XCTAssertNotNil(cluster); + + [cluster readAttributeScheduleProgrammingVisibilityWithResponseHandler:^(NSError * err, NSDictionary * values) { + NSLog(@"read the optional attribute: ScheduleProgrammingVisibility Error: %@", err); + + XCTAssertEqual(err.code, 0); + + [expectation fulfill]; + }]; + + [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; +} + +- (void)testSendClusterTest_TC_PCC_2_1_000000_ReadAttribute +{ + XCTestExpectation * expectation = [self expectationWithDescription:@"read the mandatory attribute: MaxPressure"]; + + CHIPDevice * device = GetPairedDevice(kDeviceId); + dispatch_queue_t queue = dispatch_get_main_queue(); + CHIPTestPumpConfigurationAndControl * cluster = [[CHIPTestPumpConfigurationAndControl alloc] initWithDevice:device + endpoint:1 + queue:queue]; + XCTAssertNotNil(cluster); + + [cluster readAttributeMaxPressureWithResponseHandler:^(NSError * err, NSDictionary * values) { + NSLog(@"read the mandatory attribute: MaxPressure Error: %@", err); + + XCTAssertEqual(err.code, 0); + + [expectation fulfill]; + }]; + + [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; +} +- (void)testSendClusterTest_TC_PCC_2_1_000001_ReadAttribute +{ + XCTestExpectation * expectation = [self expectationWithDescription:@"read the mandatory attribute: EffectiveOperationMode"]; + + CHIPDevice * device = GetPairedDevice(kDeviceId); + dispatch_queue_t queue = dispatch_get_main_queue(); + CHIPTestPumpConfigurationAndControl * cluster = [[CHIPTestPumpConfigurationAndControl alloc] initWithDevice:device + endpoint:1 + queue:queue]; + XCTAssertNotNil(cluster); + + [cluster readAttributeEffectiveOperationModeWithResponseHandler:^(NSError * err, NSDictionary * values) { + NSLog(@"read the mandatory attribute: EffectiveOperationMode Error: %@", err); + + XCTAssertEqual(err.code, 0); + + [expectation fulfill]; + }]; + + [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; +} +- (void)testSendClusterTest_TC_PCC_2_1_000002_ReadAttribute +{ + XCTestExpectation * expectation = [self expectationWithDescription:@"read the mandatory attribute: EffectiveControlMode"]; + + CHIPDevice * device = GetPairedDevice(kDeviceId); + dispatch_queue_t queue = dispatch_get_main_queue(); + CHIPTestPumpConfigurationAndControl * cluster = [[CHIPTestPumpConfigurationAndControl alloc] initWithDevice:device + endpoint:1 + queue:queue]; + XCTAssertNotNil(cluster); + + [cluster readAttributeEffectiveControlModeWithResponseHandler:^(NSError * err, NSDictionary * values) { + NSLog(@"read the mandatory attribute: EffectiveControlMode Error: %@", err); + + XCTAssertEqual(err.code, 0); + + [expectation fulfill]; + }]; + + [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; +} +- (void)testSendClusterTest_TC_PCC_2_1_000003_ReadAttribute +{ + XCTestExpectation * expectation = [self expectationWithDescription:@"read the mandatory attribute: Capacity"]; + + CHIPDevice * device = GetPairedDevice(kDeviceId); + dispatch_queue_t queue = dispatch_get_main_queue(); + CHIPTestPumpConfigurationAndControl * cluster = [[CHIPTestPumpConfigurationAndControl alloc] initWithDevice:device + endpoint:1 + queue:queue]; + XCTAssertNotNil(cluster); + + [cluster readAttributeCapacityWithResponseHandler:^(NSError * err, NSDictionary * values) { + NSLog(@"read the mandatory attribute: Capacity Error: %@", err); + + XCTAssertEqual(err.code, 0); + + [expectation fulfill]; + }]; + + [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; +} +- (void)testSendClusterTest_TC_PCC_2_1_000004_ReadAttribute +{ + XCTestExpectation * expectation = [self expectationWithDescription:@"read the mandatory attribute: MaxPressure"]; + + CHIPDevice * device = GetPairedDevice(kDeviceId); + dispatch_queue_t queue = dispatch_get_main_queue(); + CHIPTestPumpConfigurationAndControl * cluster = [[CHIPTestPumpConfigurationAndControl alloc] initWithDevice:device + endpoint:1 + queue:queue]; + XCTAssertNotNil(cluster); + + [cluster readAttributeMaxPressureWithResponseHandler:^(NSError * err, NSDictionary * values) { + NSLog(@"read the mandatory attribute: MaxPressure Error: %@", err); + + XCTAssertEqual(err.code, 0); + + [expectation fulfill]; + }]; + + [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; +} +- (void)testSendClusterTest_TC_PCC_2_1_000005_ReadAttribute +{ + XCTestExpectation * expectation = [self expectationWithDescription:@"read the mandatory attribute: EffectiveOperationMode"]; + + CHIPDevice * device = GetPairedDevice(kDeviceId); + dispatch_queue_t queue = dispatch_get_main_queue(); + CHIPTestPumpConfigurationAndControl * cluster = [[CHIPTestPumpConfigurationAndControl alloc] initWithDevice:device + endpoint:1 + queue:queue]; + XCTAssertNotNil(cluster); + + [cluster readAttributeEffectiveOperationModeWithResponseHandler:^(NSError * err, NSDictionary * values) { + NSLog(@"read the mandatory attribute: EffectiveOperationMode Error: %@", err); + + XCTAssertEqual(err.code, 0); + + [expectation fulfill]; + }]; + + [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; +} +- (void)testSendClusterTest_TC_PCC_2_1_000006_ReadAttribute +{ + XCTestExpectation * expectation = [self expectationWithDescription:@"read the mandatory attribute: EffectiveControlMode"]; + + CHIPDevice * device = GetPairedDevice(kDeviceId); + dispatch_queue_t queue = dispatch_get_main_queue(); + CHIPTestPumpConfigurationAndControl * cluster = [[CHIPTestPumpConfigurationAndControl alloc] initWithDevice:device + endpoint:1 + queue:queue]; + XCTAssertNotNil(cluster); + + [cluster readAttributeEffectiveControlModeWithResponseHandler:^(NSError * err, NSDictionary * values) { + NSLog(@"read the mandatory attribute: EffectiveControlMode Error: %@", err); + + XCTAssertEqual(err.code, 0); + + [expectation fulfill]; + }]; + + [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; +} +- (void)testSendClusterTest_TC_PCC_2_1_000007_ReadAttribute +{ + XCTestExpectation * expectation = [self expectationWithDescription:@"read the mandatory attribute: Capacity"]; + + CHIPDevice * device = GetPairedDevice(kDeviceId); + dispatch_queue_t queue = dispatch_get_main_queue(); + CHIPTestPumpConfigurationAndControl * cluster = [[CHIPTestPumpConfigurationAndControl alloc] initWithDevice:device + endpoint:1 + queue:queue]; + XCTAssertNotNil(cluster); + + [cluster readAttributeCapacityWithResponseHandler:^(NSError * err, NSDictionary * values) { + NSLog(@"read the mandatory attribute: Capacity Error: %@", err); + + XCTAssertEqual(err.code, 0); + + [expectation fulfill]; + }]; + + [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; +} + +- (void)testSendClusterTest_TC_CC_3_1_000000_On +{ + XCTestExpectation * expectation = [self expectationWithDescription:@"Turn on light for color control tests"]; + + CHIPDevice * device = GetPairedDevice(kDeviceId); + dispatch_queue_t queue = dispatch_get_main_queue(); + CHIPTestOnOff * cluster = [[CHIPTestOnOff alloc] initWithDevice:device endpoint:1 queue:queue]; + XCTAssertNotNil(cluster); + + [cluster on:^(NSError * err, NSDictionary * values) { + NSLog(@"Turn on light for color control tests Error: %@", err); + + XCTAssertEqual(err.code, 0); + + [expectation fulfill]; + }]; + + [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; +} +- (void)testSendClusterTest_TC_CC_3_1_000001_ReadAttribute +{ + XCTestExpectation * expectation = [self expectationWithDescription:@"Check on/off attribute value is true after on command"]; + + CHIPDevice * device = GetPairedDevice(kDeviceId); + dispatch_queue_t queue = dispatch_get_main_queue(); + CHIPTestOnOff * cluster = [[CHIPTestOnOff alloc] initWithDevice:device endpoint:1 queue:queue]; + XCTAssertNotNil(cluster); + + [cluster readAttributeOnOffWithResponseHandler:^(NSError * err, NSDictionary * values) { + NSLog(@"Check on/off attribute value is true after on command Error: %@", err); + + XCTAssertEqual(err.code, 0); + + XCTAssertEqual([values[@"value"] boolValue], 1); + + [expectation fulfill]; + }]; + + [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; +} +- (void)testSendClusterTest_TC_CC_3_1_000002_MoveToHue +{ + XCTestExpectation * expectation = [self expectationWithDescription:@"Move to hue shortest distance command"]; + + CHIPDevice * device = GetPairedDevice(kDeviceId); + dispatch_queue_t queue = dispatch_get_main_queue(); + CHIPTestColorControl * cluster = [[CHIPTestColorControl alloc] initWithDevice:device endpoint:1 queue:queue]; + XCTAssertNotNil(cluster); + + uint8_t hueArgument = 150; + uint8_t directionArgument = 0; + uint16_t transitionTimeArgument = 100U; + uint8_t optionsMaskArgument = 0; + uint8_t optionsOverrideArgument = 0; + [cluster moveToHue:hueArgument + direction:directionArgument + transitionTime:transitionTimeArgument + optionsMask:optionsMaskArgument + optionsOverride:optionsOverrideArgument + responseHandler:^(NSError * err, NSDictionary * values) { + NSLog(@"Move to hue shortest distance command Error: %@", err); + + XCTAssertEqual(err.code, 0); + + [expectation fulfill]; + }]; + + [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; +} +- (void)testSendClusterTest_TC_CC_3_1_000003_MoveToHue +{ + XCTestExpectation * expectation = [self expectationWithDescription:@"Move to hue longest distance command"]; + + CHIPDevice * device = GetPairedDevice(kDeviceId); + dispatch_queue_t queue = dispatch_get_main_queue(); + CHIPTestColorControl * cluster = [[CHIPTestColorControl alloc] initWithDevice:device endpoint:1 queue:queue]; + XCTAssertNotNil(cluster); + + uint8_t hueArgument = 200; + uint8_t directionArgument = 1; + uint16_t transitionTimeArgument = 100U; + uint8_t optionsMaskArgument = 0; + uint8_t optionsOverrideArgument = 0; + [cluster moveToHue:hueArgument + direction:directionArgument + transitionTime:transitionTimeArgument + optionsMask:optionsMaskArgument + optionsOverride:optionsOverrideArgument + responseHandler:^(NSError * err, NSDictionary * values) { + NSLog(@"Move to hue longest distance command Error: %@", err); + + XCTAssertEqual(err.code, 0); + + [expectation fulfill]; + }]; + + [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; +} +- (void)testSendClusterTest_TC_CC_3_1_000004_MoveToHue +{ + XCTestExpectation * expectation = [self expectationWithDescription:@"Move to hue up command"]; + + CHIPDevice * device = GetPairedDevice(kDeviceId); + dispatch_queue_t queue = dispatch_get_main_queue(); + CHIPTestColorControl * cluster = [[CHIPTestColorControl alloc] initWithDevice:device endpoint:1 queue:queue]; + XCTAssertNotNil(cluster); + + uint8_t hueArgument = 250; + uint8_t directionArgument = 2; + uint16_t transitionTimeArgument = 100U; + uint8_t optionsMaskArgument = 0; + uint8_t optionsOverrideArgument = 0; + [cluster moveToHue:hueArgument + direction:directionArgument + transitionTime:transitionTimeArgument + optionsMask:optionsMaskArgument + optionsOverride:optionsOverrideArgument + responseHandler:^(NSError * err, NSDictionary * values) { + NSLog(@"Move to hue up command Error: %@", err); + + XCTAssertEqual(err.code, 0); + + [expectation fulfill]; + }]; + + [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; +} +- (void)testSendClusterTest_TC_CC_3_1_000005_MoveToHue +{ + XCTestExpectation * expectation = [self expectationWithDescription:@"Move to hue down command"]; + + CHIPDevice * device = GetPairedDevice(kDeviceId); + dispatch_queue_t queue = dispatch_get_main_queue(); + CHIPTestColorControl * cluster = [[CHIPTestColorControl alloc] initWithDevice:device endpoint:1 queue:queue]; + XCTAssertNotNil(cluster); + + uint8_t hueArgument = 225; + uint8_t directionArgument = 3; + uint16_t transitionTimeArgument = 100U; + uint8_t optionsMaskArgument = 0; + uint8_t optionsOverrideArgument = 0; + [cluster moveToHue:hueArgument + direction:directionArgument + transitionTime:transitionTimeArgument + optionsMask:optionsMaskArgument + optionsOverride:optionsOverrideArgument + responseHandler:^(NSError * err, NSDictionary * values) { + NSLog(@"Move to hue down command Error: %@", err); + + XCTAssertEqual(err.code, 0); + + [expectation fulfill]; + }]; + + [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; +} +- (void)testSendClusterTest_TC_CC_3_1_000006_Off +{ + XCTestExpectation * expectation = [self expectationWithDescription:@"Turn off light that we turned on"]; + + CHIPDevice * device = GetPairedDevice(kDeviceId); + dispatch_queue_t queue = dispatch_get_main_queue(); + CHIPTestOnOff * cluster = [[CHIPTestOnOff alloc] initWithDevice:device endpoint:1 queue:queue]; + XCTAssertNotNil(cluster); + + [cluster off:^(NSError * err, NSDictionary * values) { + NSLog(@"Turn off light that we turned on Error: %@", err); + + XCTAssertEqual(err.code, 0); + + [expectation fulfill]; + }]; + + [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; +} +- (void)testSendClusterTest_TC_CC_3_1_000007_ReadAttribute +{ + XCTestExpectation * expectation = [self expectationWithDescription:@"Check on/off attribute value is false after off command"]; + + CHIPDevice * device = GetPairedDevice(kDeviceId); + dispatch_queue_t queue = dispatch_get_main_queue(); + CHIPTestOnOff * cluster = [[CHIPTestOnOff alloc] initWithDevice:device endpoint:1 queue:queue]; + XCTAssertNotNil(cluster); + + [cluster readAttributeOnOffWithResponseHandler:^(NSError * err, NSDictionary * values) { + NSLog(@"Check on/off attribute value is false after off command Error: %@", err); + + XCTAssertEqual(err.code, 0); + + XCTAssertEqual([values[@"value"] boolValue], 0); + + [expectation fulfill]; + }]; + + [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; +} + +- (void)testSendClusterTest_TC_CC_3_2_000000_On +{ + XCTestExpectation * expectation = [self expectationWithDescription:@"Turn on light for color control tests"]; + + CHIPDevice * device = GetPairedDevice(kDeviceId); + dispatch_queue_t queue = dispatch_get_main_queue(); + CHIPTestOnOff * cluster = [[CHIPTestOnOff alloc] initWithDevice:device endpoint:1 queue:queue]; + XCTAssertNotNil(cluster); + + [cluster on:^(NSError * err, NSDictionary * values) { + NSLog(@"Turn on light for color control tests Error: %@", err); + + XCTAssertEqual(err.code, 0); + + [expectation fulfill]; + }]; + + [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; +} +- (void)testSendClusterTest_TC_CC_3_2_000001_ReadAttribute +{ + XCTestExpectation * expectation = [self expectationWithDescription:@"Check on/off attribute value is true after on command"]; + + CHIPDevice * device = GetPairedDevice(kDeviceId); + dispatch_queue_t queue = dispatch_get_main_queue(); + CHIPTestOnOff * cluster = [[CHIPTestOnOff alloc] initWithDevice:device endpoint:1 queue:queue]; + XCTAssertNotNil(cluster); + + [cluster readAttributeOnOffWithResponseHandler:^(NSError * err, NSDictionary * values) { + NSLog(@"Check on/off attribute value is true after on command Error: %@", err); + + XCTAssertEqual(err.code, 0); + + XCTAssertEqual([values[@"value"] boolValue], 1); + + [expectation fulfill]; + }]; + + [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; +} +- (void)testSendClusterTest_TC_CC_3_2_000002_MoveHue +{ + XCTestExpectation * expectation = [self expectationWithDescription:@"Move hue up command"]; + + CHIPDevice * device = GetPairedDevice(kDeviceId); + dispatch_queue_t queue = dispatch_get_main_queue(); + CHIPTestColorControl * cluster = [[CHIPTestColorControl alloc] initWithDevice:device endpoint:1 queue:queue]; + XCTAssertNotNil(cluster); + + uint8_t moveModeArgument = 1; + uint8_t rateArgument = 50; + uint8_t optionsMaskArgument = 0; + uint8_t optionsOverrideArgument = 0; + [cluster moveHue:moveModeArgument + rate:rateArgument + optionsMask:optionsMaskArgument + optionsOverride:optionsOverrideArgument + responseHandler:^(NSError * err, NSDictionary * values) { + NSLog(@"Move hue up command Error: %@", err); + + XCTAssertEqual(err.code, 0); + + [expectation fulfill]; + }]; + + [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; +} +- (void)testSendClusterTest_TC_CC_3_2_000003_MoveHue +{ + XCTestExpectation * expectation = [self expectationWithDescription:@"Move hue stop command"]; + + CHIPDevice * device = GetPairedDevice(kDeviceId); + dispatch_queue_t queue = dispatch_get_main_queue(); + CHIPTestColorControl * cluster = [[CHIPTestColorControl alloc] initWithDevice:device endpoint:1 queue:queue]; + XCTAssertNotNil(cluster); + + uint8_t moveModeArgument = 0; + uint8_t rateArgument = 50; + uint8_t optionsMaskArgument = 0; + uint8_t optionsOverrideArgument = 0; + [cluster moveHue:moveModeArgument + rate:rateArgument + optionsMask:optionsMaskArgument + optionsOverride:optionsOverrideArgument + responseHandler:^(NSError * err, NSDictionary * values) { + NSLog(@"Move hue stop command Error: %@", err); + + XCTAssertEqual(err.code, 0); + + [expectation fulfill]; + }]; + + [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; +} +- (void)testSendClusterTest_TC_CC_3_2_000004_MoveHue +{ + XCTestExpectation * expectation = [self expectationWithDescription:@"Move hue down command"]; + + CHIPDevice * device = GetPairedDevice(kDeviceId); + dispatch_queue_t queue = dispatch_get_main_queue(); + CHIPTestColorControl * cluster = [[CHIPTestColorControl alloc] initWithDevice:device endpoint:1 queue:queue]; + XCTAssertNotNil(cluster); + + uint8_t moveModeArgument = 3; + uint8_t rateArgument = 50; + uint8_t optionsMaskArgument = 0; + uint8_t optionsOverrideArgument = 0; + [cluster moveHue:moveModeArgument + rate:rateArgument + optionsMask:optionsMaskArgument + optionsOverride:optionsOverrideArgument + responseHandler:^(NSError * err, NSDictionary * values) { + NSLog(@"Move hue down command Error: %@", err); + + XCTAssertEqual(err.code, 0); + + [expectation fulfill]; + }]; + + [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; +} +- (void)testSendClusterTest_TC_CC_3_2_000005_MoveHue +{ + XCTestExpectation * expectation = [self expectationWithDescription:@"Move hue stop command"]; + + CHIPDevice * device = GetPairedDevice(kDeviceId); + dispatch_queue_t queue = dispatch_get_main_queue(); + CHIPTestColorControl * cluster = [[CHIPTestColorControl alloc] initWithDevice:device endpoint:1 queue:queue]; + XCTAssertNotNil(cluster); + + uint8_t moveModeArgument = 0; + uint8_t rateArgument = 50; + uint8_t optionsMaskArgument = 0; + uint8_t optionsOverrideArgument = 0; + [cluster moveHue:moveModeArgument + rate:rateArgument + optionsMask:optionsMaskArgument + optionsOverride:optionsOverrideArgument + responseHandler:^(NSError * err, NSDictionary * values) { + NSLog(@"Move hue stop command Error: %@", err); + + XCTAssertEqual(err.code, 0); + + [expectation fulfill]; + }]; + + [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; +} +- (void)testSendClusterTest_TC_CC_3_2_000006_Off +{ + XCTestExpectation * expectation = [self expectationWithDescription:@"Turn off light that we turned on"]; + + CHIPDevice * device = GetPairedDevice(kDeviceId); + dispatch_queue_t queue = dispatch_get_main_queue(); + CHIPTestOnOff * cluster = [[CHIPTestOnOff alloc] initWithDevice:device endpoint:1 queue:queue]; + XCTAssertNotNil(cluster); + + [cluster off:^(NSError * err, NSDictionary * values) { + NSLog(@"Turn off light that we turned on Error: %@", err); + + XCTAssertEqual(err.code, 0); + + [expectation fulfill]; + }]; + + [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; +} +- (void)testSendClusterTest_TC_CC_3_2_000007_ReadAttribute +{ + XCTestExpectation * expectation = [self expectationWithDescription:@"Check on/off attribute value is false after off command"]; + + CHIPDevice * device = GetPairedDevice(kDeviceId); + dispatch_queue_t queue = dispatch_get_main_queue(); + CHIPTestOnOff * cluster = [[CHIPTestOnOff alloc] initWithDevice:device endpoint:1 queue:queue]; + XCTAssertNotNil(cluster); + + [cluster readAttributeOnOffWithResponseHandler:^(NSError * err, NSDictionary * values) { + NSLog(@"Check on/off attribute value is false after off command Error: %@", err); + + XCTAssertEqual(err.code, 0); + + XCTAssertEqual([values[@"value"] boolValue], 0); + + [expectation fulfill]; + }]; + + [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; +} + +- (void)testSendClusterTest_TC_CC_3_3_000000_On +{ + XCTestExpectation * expectation = [self expectationWithDescription:@"Turn on light for color control tests"]; + + CHIPDevice * device = GetPairedDevice(kDeviceId); + dispatch_queue_t queue = dispatch_get_main_queue(); + CHIPTestOnOff * cluster = [[CHIPTestOnOff alloc] initWithDevice:device endpoint:1 queue:queue]; + XCTAssertNotNil(cluster); + + [cluster on:^(NSError * err, NSDictionary * values) { + NSLog(@"Turn on light for color control tests Error: %@", err); + + XCTAssertEqual(err.code, 0); + + [expectation fulfill]; + }]; + + [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; +} +- (void)testSendClusterTest_TC_CC_3_3_000001_ReadAttribute +{ + XCTestExpectation * expectation = [self expectationWithDescription:@"Check on/off attribute value is true after on command"]; + + CHIPDevice * device = GetPairedDevice(kDeviceId); + dispatch_queue_t queue = dispatch_get_main_queue(); + CHIPTestOnOff * cluster = [[CHIPTestOnOff alloc] initWithDevice:device endpoint:1 queue:queue]; + XCTAssertNotNil(cluster); + + [cluster readAttributeOnOffWithResponseHandler:^(NSError * err, NSDictionary * values) { + NSLog(@"Check on/off attribute value is true after on command Error: %@", err); + + XCTAssertEqual(err.code, 0); + + XCTAssertEqual([values[@"value"] boolValue], 1); + + [expectation fulfill]; + }]; + + [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; +} +- (void)testSendClusterTest_TC_CC_3_3_000002_StepHue +{ + XCTestExpectation * expectation = [self expectationWithDescription:@"Step hue up command"]; + + CHIPDevice * device = GetPairedDevice(kDeviceId); + dispatch_queue_t queue = dispatch_get_main_queue(); + CHIPTestColorControl * cluster = [[CHIPTestColorControl alloc] initWithDevice:device endpoint:1 queue:queue]; + XCTAssertNotNil(cluster); + + uint8_t stepModeArgument = 1; + uint8_t stepSizeArgument = 5; + uint8_t transitionTimeArgument = 25; + uint8_t optionsMaskArgument = 0; + uint8_t optionsOverrideArgument = 0; + [cluster stepHue:stepModeArgument + stepSize:stepSizeArgument + transitionTime:transitionTimeArgument + optionsMask:optionsMaskArgument + optionsOverride:optionsOverrideArgument + responseHandler:^(NSError * err, NSDictionary * values) { + NSLog(@"Step hue up command Error: %@", err); + + XCTAssertEqual(err.code, 0); + + [expectation fulfill]; + }]; + + [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; +} +- (void)testSendClusterTest_TC_CC_3_3_000003_StepHue +{ + XCTestExpectation * expectation = [self expectationWithDescription:@"Step hue down command"]; + + CHIPDevice * device = GetPairedDevice(kDeviceId); + dispatch_queue_t queue = dispatch_get_main_queue(); + CHIPTestColorControl * cluster = [[CHIPTestColorControl alloc] initWithDevice:device endpoint:1 queue:queue]; + XCTAssertNotNil(cluster); + + uint8_t stepModeArgument = 3; + uint8_t stepSizeArgument = 5; + uint8_t transitionTimeArgument = 25; + uint8_t optionsMaskArgument = 0; + uint8_t optionsOverrideArgument = 0; + [cluster stepHue:stepModeArgument + stepSize:stepSizeArgument + transitionTime:transitionTimeArgument + optionsMask:optionsMaskArgument + optionsOverride:optionsOverrideArgument + responseHandler:^(NSError * err, NSDictionary * values) { + NSLog(@"Step hue down command Error: %@", err); + + XCTAssertEqual(err.code, 0); + + [expectation fulfill]; + }]; + + [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; +} +- (void)testSendClusterTest_TC_CC_3_3_000004_Off +{ + XCTestExpectation * expectation = [self expectationWithDescription:@"Turn off light that we turned on"]; + + CHIPDevice * device = GetPairedDevice(kDeviceId); + dispatch_queue_t queue = dispatch_get_main_queue(); + CHIPTestOnOff * cluster = [[CHIPTestOnOff alloc] initWithDevice:device endpoint:1 queue:queue]; + XCTAssertNotNil(cluster); + + [cluster off:^(NSError * err, NSDictionary * values) { + NSLog(@"Turn off light that we turned on Error: %@", err); + + XCTAssertEqual(err.code, 0); + + [expectation fulfill]; + }]; + + [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; +} +- (void)testSendClusterTest_TC_CC_3_3_000005_ReadAttribute +{ + XCTestExpectation * expectation = [self expectationWithDescription:@"Check on/off attribute value is false after off command"]; + + CHIPDevice * device = GetPairedDevice(kDeviceId); + dispatch_queue_t queue = dispatch_get_main_queue(); + CHIPTestOnOff * cluster = [[CHIPTestOnOff alloc] initWithDevice:device endpoint:1 queue:queue]; + XCTAssertNotNil(cluster); + + [cluster readAttributeOnOffWithResponseHandler:^(NSError * err, NSDictionary * values) { + NSLog(@"Check on/off attribute value is false after off command Error: %@", err); + + XCTAssertEqual(err.code, 0); + + XCTAssertEqual([values[@"value"] boolValue], 0); + + [expectation fulfill]; + }]; + + [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; +} + +- (void)testSendClusterTest_TC_CC_4_1_000000_On +{ + XCTestExpectation * expectation = [self expectationWithDescription:@"Turn on light for color control tests"]; + + CHIPDevice * device = GetPairedDevice(kDeviceId); + dispatch_queue_t queue = dispatch_get_main_queue(); + CHIPTestOnOff * cluster = [[CHIPTestOnOff alloc] initWithDevice:device endpoint:1 queue:queue]; + XCTAssertNotNil(cluster); + + [cluster on:^(NSError * err, NSDictionary * values) { + NSLog(@"Turn on light for color control tests Error: %@", err); + + XCTAssertEqual(err.code, 0); + + [expectation fulfill]; + }]; + + [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; +} +- (void)testSendClusterTest_TC_CC_4_1_000001_ReadAttribute +{ + XCTestExpectation * expectation = [self expectationWithDescription:@"Check on/off attribute value is true after on command"]; + + CHIPDevice * device = GetPairedDevice(kDeviceId); + dispatch_queue_t queue = dispatch_get_main_queue(); + CHIPTestOnOff * cluster = [[CHIPTestOnOff alloc] initWithDevice:device endpoint:1 queue:queue]; + XCTAssertNotNil(cluster); + + [cluster readAttributeOnOffWithResponseHandler:^(NSError * err, NSDictionary * values) { + NSLog(@"Check on/off attribute value is true after on command Error: %@", err); + + XCTAssertEqual(err.code, 0); + + XCTAssertEqual([values[@"value"] boolValue], 1); + + [expectation fulfill]; + }]; + + [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; +} +- (void)testSendClusterTest_TC_CC_4_1_000002_MoveToSaturation +{ + XCTestExpectation * expectation = [self expectationWithDescription:@"Move to saturation command"]; + + CHIPDevice * device = GetPairedDevice(kDeviceId); + dispatch_queue_t queue = dispatch_get_main_queue(); + CHIPTestColorControl * cluster = [[CHIPTestColorControl alloc] initWithDevice:device endpoint:1 queue:queue]; + XCTAssertNotNil(cluster); + + uint8_t saturationArgument = 90; + uint16_t transitionTimeArgument = 10U; + uint8_t optionsMaskArgument = 0; + uint8_t optionsOverrideArgument = 0; + [cluster moveToSaturation:saturationArgument + transitionTime:transitionTimeArgument + optionsMask:optionsMaskArgument + optionsOverride:optionsOverrideArgument + responseHandler:^(NSError * err, NSDictionary * values) { + NSLog(@"Move to saturation command Error: %@", err); + + XCTAssertEqual(err.code, 0); + + [expectation fulfill]; + }]; + + [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; +} +- (void)testSendClusterTest_TC_CC_4_1_000003_Off +{ + XCTestExpectation * expectation = [self expectationWithDescription:@"Turn off light that we turned on"]; + + CHIPDevice * device = GetPairedDevice(kDeviceId); + dispatch_queue_t queue = dispatch_get_main_queue(); + CHIPTestOnOff * cluster = [[CHIPTestOnOff alloc] initWithDevice:device endpoint:1 queue:queue]; + XCTAssertNotNil(cluster); + + [cluster off:^(NSError * err, NSDictionary * values) { + NSLog(@"Turn off light that we turned on Error: %@", err); + + XCTAssertEqual(err.code, 0); + + [expectation fulfill]; + }]; + + [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; +} +- (void)testSendClusterTest_TC_CC_4_1_000004_ReadAttribute +{ + XCTestExpectation * expectation = [self expectationWithDescription:@"Check on/off attribute value is false after off command"]; + + CHIPDevice * device = GetPairedDevice(kDeviceId); + dispatch_queue_t queue = dispatch_get_main_queue(); + CHIPTestOnOff * cluster = [[CHIPTestOnOff alloc] initWithDevice:device endpoint:1 queue:queue]; + XCTAssertNotNil(cluster); + + [cluster readAttributeOnOffWithResponseHandler:^(NSError * err, NSDictionary * values) { + NSLog(@"Check on/off attribute value is false after off command Error: %@", err); + + XCTAssertEqual(err.code, 0); + + XCTAssertEqual([values[@"value"] boolValue], 0); + + [expectation fulfill]; + }]; + + [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; +} + +- (void)testSendClusterTest_TC_CC_4_2_000000_On +{ + XCTestExpectation * expectation = [self expectationWithDescription:@"Turn on light for color control tests"]; + + CHIPDevice * device = GetPairedDevice(kDeviceId); + dispatch_queue_t queue = dispatch_get_main_queue(); + CHIPTestOnOff * cluster = [[CHIPTestOnOff alloc] initWithDevice:device endpoint:1 queue:queue]; + XCTAssertNotNil(cluster); + + [cluster on:^(NSError * err, NSDictionary * values) { + NSLog(@"Turn on light for color control tests Error: %@", err); + + XCTAssertEqual(err.code, 0); + + [expectation fulfill]; + }]; + + [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; +} +- (void)testSendClusterTest_TC_CC_4_2_000001_ReadAttribute +{ + XCTestExpectation * expectation = [self expectationWithDescription:@"Check on/off attribute value is true after on command"]; + + CHIPDevice * device = GetPairedDevice(kDeviceId); + dispatch_queue_t queue = dispatch_get_main_queue(); + CHIPTestOnOff * cluster = [[CHIPTestOnOff alloc] initWithDevice:device endpoint:1 queue:queue]; + XCTAssertNotNil(cluster); + + [cluster readAttributeOnOffWithResponseHandler:^(NSError * err, NSDictionary * values) { + NSLog(@"Check on/off attribute value is true after on command Error: %@", err); + + XCTAssertEqual(err.code, 0); + + XCTAssertEqual([values[@"value"] boolValue], 1); + + [expectation fulfill]; + }]; + + [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; +} +- (void)testSendClusterTest_TC_CC_4_2_000002_MoveSaturation +{ + XCTestExpectation * expectation = [self expectationWithDescription:@"Move saturation up command"]; + + CHIPDevice * device = GetPairedDevice(kDeviceId); + dispatch_queue_t queue = dispatch_get_main_queue(); + CHIPTestColorControl * cluster = [[CHIPTestColorControl alloc] initWithDevice:device endpoint:1 queue:queue]; + XCTAssertNotNil(cluster); + + uint8_t moveModeArgument = 1; + uint8_t rateArgument = 5; + uint8_t optionsMaskArgument = 0; + uint8_t optionsOverrideArgument = 0; + [cluster moveSaturation:moveModeArgument + rate:rateArgument + optionsMask:optionsMaskArgument + optionsOverride:optionsOverrideArgument + responseHandler:^(NSError * err, NSDictionary * values) { + NSLog(@"Move saturation up command Error: %@", err); + + XCTAssertEqual(err.code, 0); + + [expectation fulfill]; + }]; + + [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; +} +- (void)testSendClusterTest_TC_CC_4_2_000003_MoveSaturation +{ + XCTestExpectation * expectation = [self expectationWithDescription:@"Move saturation down command"]; + + CHIPDevice * device = GetPairedDevice(kDeviceId); + dispatch_queue_t queue = dispatch_get_main_queue(); + CHIPTestColorControl * cluster = [[CHIPTestColorControl alloc] initWithDevice:device endpoint:1 queue:queue]; + XCTAssertNotNil(cluster); + + uint8_t moveModeArgument = 3; + uint8_t rateArgument = 5; + uint8_t optionsMaskArgument = 0; + uint8_t optionsOverrideArgument = 0; + [cluster moveSaturation:moveModeArgument + rate:rateArgument + optionsMask:optionsMaskArgument + optionsOverride:optionsOverrideArgument + responseHandler:^(NSError * err, NSDictionary * values) { + NSLog(@"Move saturation down command Error: %@", err); + + XCTAssertEqual(err.code, 0); + + [expectation fulfill]; + }]; + + [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; +} +- (void)testSendClusterTest_TC_CC_4_2_000004_Off +{ + XCTestExpectation * expectation = [self expectationWithDescription:@"Turn off light that we turned on"]; + + CHIPDevice * device = GetPairedDevice(kDeviceId); + dispatch_queue_t queue = dispatch_get_main_queue(); + CHIPTestOnOff * cluster = [[CHIPTestOnOff alloc] initWithDevice:device endpoint:1 queue:queue]; + XCTAssertNotNil(cluster); + + [cluster off:^(NSError * err, NSDictionary * values) { + NSLog(@"Turn off light that we turned on Error: %@", err); + + XCTAssertEqual(err.code, 0); + + [expectation fulfill]; + }]; + + [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; +} +- (void)testSendClusterTest_TC_CC_4_2_000005_ReadAttribute +{ + XCTestExpectation * expectation = [self expectationWithDescription:@"Check on/off attribute value is false after off command"]; + + CHIPDevice * device = GetPairedDevice(kDeviceId); + dispatch_queue_t queue = dispatch_get_main_queue(); + CHIPTestOnOff * cluster = [[CHIPTestOnOff alloc] initWithDevice:device endpoint:1 queue:queue]; + XCTAssertNotNil(cluster); + + [cluster readAttributeOnOffWithResponseHandler:^(NSError * err, NSDictionary * values) { + NSLog(@"Check on/off attribute value is false after off command Error: %@", err); + + XCTAssertEqual(err.code, 0); + + XCTAssertEqual([values[@"value"] boolValue], 0); + + [expectation fulfill]; + }]; + + [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; +} + +- (void)testSendClusterTest_TC_CC_4_3_000000_On +{ + XCTestExpectation * expectation = [self expectationWithDescription:@"Turn on light for color control tests"]; + + CHIPDevice * device = GetPairedDevice(kDeviceId); + dispatch_queue_t queue = dispatch_get_main_queue(); + CHIPTestOnOff * cluster = [[CHIPTestOnOff alloc] initWithDevice:device endpoint:1 queue:queue]; + XCTAssertNotNil(cluster); - XCTAssertEqual(err.code, 0); + [cluster on:^(NSError * err, NSDictionary * values) { + NSLog(@"Turn on light for color control tests Error: %@", err); - [expectation fulfill]; - }]; + XCTAssertEqual(err.code, 0); + + [expectation fulfill]; + }]; [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; } -- (void)testSendClusterTest_TC_CC_6_000006_StepColorTemperature +- (void)testSendClusterTest_TC_CC_4_3_000001_ReadAttribute { - XCTestExpectation * expectation = [self expectationWithDescription:@"Step up color temperature command"]; + XCTestExpectation * expectation = [self expectationWithDescription:@"Check on/off attribute value is true after on command"]; + + CHIPDevice * device = GetPairedDevice(kDeviceId); + dispatch_queue_t queue = dispatch_get_main_queue(); + CHIPTestOnOff * cluster = [[CHIPTestOnOff alloc] initWithDevice:device endpoint:1 queue:queue]; + XCTAssertNotNil(cluster); + + [cluster readAttributeOnOffWithResponseHandler:^(NSError * err, NSDictionary * values) { + NSLog(@"Check on/off attribute value is true after on command Error: %@", err); + + XCTAssertEqual(err.code, 0); + + XCTAssertEqual([values[@"value"] boolValue], 1); + + [expectation fulfill]; + }]; + + [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; +} +- (void)testSendClusterTest_TC_CC_4_3_000002_StepSaturation +{ + XCTestExpectation * expectation = [self expectationWithDescription:@"Step saturation up command"]; CHIPDevice * device = GetPairedDevice(kDeviceId); dispatch_queue_t queue = dispatch_get_main_queue(); @@ -4952,32 +6364,28 @@ - (void)testSendClusterTest_TC_CC_6_000006_StepColorTemperature XCTAssertNotNil(cluster); uint8_t stepModeArgument = 1; - uint16_t stepSizeArgument = 5U; - uint16_t transitionTimeArgument = 50U; - uint16_t colorTemperatureMinimumArgument = 5U; - uint16_t colorTemperatureMaximumArgument = 100U; + uint8_t stepSizeArgument = 15; + uint8_t transitionTimeArgument = 10; uint8_t optionsMaskArgument = 0; uint8_t optionsOverrideArgument = 0; - [cluster stepColorTemperature:stepModeArgument - stepSize:stepSizeArgument - transitionTime:transitionTimeArgument - colorTemperatureMinimum:colorTemperatureMinimumArgument - colorTemperatureMaximum:colorTemperatureMaximumArgument - optionsMask:optionsMaskArgument - optionsOverride:optionsOverrideArgument - responseHandler:^(NSError * err, NSDictionary * values) { - NSLog(@"Step up color temperature command Error: %@", err); + [cluster stepSaturation:stepModeArgument + stepSize:stepSizeArgument + transitionTime:transitionTimeArgument + optionsMask:optionsMaskArgument + optionsOverride:optionsOverrideArgument + responseHandler:^(NSError * err, NSDictionary * values) { + NSLog(@"Step saturation up command Error: %@", err); - XCTAssertEqual(err.code, 0); + XCTAssertEqual(err.code, 0); - [expectation fulfill]; - }]; + [expectation fulfill]; + }]; [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; } -- (void)testSendClusterTest_TC_CC_6_000007_StepColorTemperature +- (void)testSendClusterTest_TC_CC_4_3_000003_StepSaturation { - XCTestExpectation * expectation = [self expectationWithDescription:@"Step down color temperature command"]; + XCTestExpectation * expectation = [self expectationWithDescription:@"Step saturation down command"]; CHIPDevice * device = GetPairedDevice(kDeviceId); dispatch_queue_t queue = dispatch_get_main_queue(); @@ -4985,30 +6393,26 @@ - (void)testSendClusterTest_TC_CC_6_000007_StepColorTemperature XCTAssertNotNil(cluster); uint8_t stepModeArgument = 3; - uint16_t stepSizeArgument = 5U; - uint16_t transitionTimeArgument = 50U; - uint16_t colorTemperatureMinimumArgument = 5U; - uint16_t colorTemperatureMaximumArgument = 100U; + uint8_t stepSizeArgument = 20; + uint8_t transitionTimeArgument = 10; uint8_t optionsMaskArgument = 0; uint8_t optionsOverrideArgument = 0; - [cluster stepColorTemperature:stepModeArgument - stepSize:stepSizeArgument - transitionTime:transitionTimeArgument - colorTemperatureMinimum:colorTemperatureMinimumArgument - colorTemperatureMaximum:colorTemperatureMaximumArgument - optionsMask:optionsMaskArgument - optionsOverride:optionsOverrideArgument - responseHandler:^(NSError * err, NSDictionary * values) { - NSLog(@"Step down color temperature command Error: %@", err); + [cluster stepSaturation:stepModeArgument + stepSize:stepSizeArgument + transitionTime:transitionTimeArgument + optionsMask:optionsMaskArgument + optionsOverride:optionsOverrideArgument + responseHandler:^(NSError * err, NSDictionary * values) { + NSLog(@"Step saturation down command Error: %@", err); - XCTAssertEqual(err.code, 0); + XCTAssertEqual(err.code, 0); - [expectation fulfill]; - }]; + [expectation fulfill]; + }]; [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; } -- (void)testSendClusterTest_TC_CC_6_000008_Off +- (void)testSendClusterTest_TC_CC_4_3_000004_Off { XCTestExpectation * expectation = [self expectationWithDescription:@"Turn off light that we turned on"]; @@ -5027,7 +6431,7 @@ - (void)testSendClusterTest_TC_CC_6_000008_Off [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; } -- (void)testSendClusterTest_TC_CC_6_000009_ReadAttribute +- (void)testSendClusterTest_TC_CC_4_3_000005_ReadAttribute { XCTestExpectation * expectation = [self expectationWithDescription:@"Check on/off attribute value is false after off command"]; @@ -5049,7 +6453,7 @@ - (void)testSendClusterTest_TC_CC_6_000009_ReadAttribute [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; } -- (void)testSendClusterTest_TC_CC_7_000000_On +- (void)testSendClusterTest_TC_CC_4_4_000000_On { XCTestExpectation * expectation = [self expectationWithDescription:@"Turn on light for color control tests"]; @@ -5068,7 +6472,7 @@ - (void)testSendClusterTest_TC_CC_7_000000_On [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; } -- (void)testSendClusterTest_TC_CC_7_000001_ReadAttribute +- (void)testSendClusterTest_TC_CC_4_4_000001_ReadAttribute { XCTestExpectation * expectation = [self expectationWithDescription:@"Check on/off attribute value is true after on command"]; @@ -5089,253 +6493,277 @@ - (void)testSendClusterTest_TC_CC_7_000001_ReadAttribute [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; } -- (void)testSendClusterTest_TC_CC_7_000002_EnhancedMoveToHue +- (void)testSendClusterTest_TC_CC_4_4_000002_MoveToHueAndSaturation { - XCTestExpectation * expectation = [self expectationWithDescription:@"Enhanced Move To Hue command"]; + XCTestExpectation * expectation = [self expectationWithDescription:@"Move To current hue and saturation command"]; CHIPDevice * device = GetPairedDevice(kDeviceId); dispatch_queue_t queue = dispatch_get_main_queue(); CHIPTestColorControl * cluster = [[CHIPTestColorControl alloc] initWithDevice:device endpoint:1 queue:queue]; XCTAssertNotNil(cluster); - uint16_t enhancedHueArgument = 1025U; - uint8_t directionArgument = 0; - uint16_t transitionTimeArgument = 1U; + uint8_t hueArgument = 40; + uint8_t saturationArgument = 160; + uint16_t transitionTimeArgument = 10U; uint8_t optionsMaskArgument = 0; uint8_t optionsOverrideArgument = 0; - [cluster enhancedMoveToHue:enhancedHueArgument - direction:directionArgument - transitionTime:transitionTimeArgument - optionsMask:optionsMaskArgument - optionsOverride:optionsOverrideArgument - responseHandler:^(NSError * err, NSDictionary * values) { - NSLog(@"Enhanced Move To Hue command Error: %@", err); + [cluster moveToHueAndSaturation:hueArgument + saturation:saturationArgument + transitionTime:transitionTimeArgument + optionsMask:optionsMaskArgument + optionsOverride:optionsOverrideArgument + responseHandler:^(NSError * err, NSDictionary * values) { + NSLog(@"Move To current hue and saturation command Error: %@", err); - XCTAssertEqual(err.code, 0); + XCTAssertEqual(err.code, 0); - [expectation fulfill]; - }]; + [expectation fulfill]; + }]; [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; } -- (void)testSendClusterTest_TC_CC_7_000003_ReadAttribute +- (void)testSendClusterTest_TC_CC_4_4_000003_Off { - XCTestExpectation * expectation = - [self expectationWithDescription:@"Check Remaining time attribute value matched the value sent by the last command"]; + XCTestExpectation * expectation = [self expectationWithDescription:@"Turn off light that we turned on"]; CHIPDevice * device = GetPairedDevice(kDeviceId); dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPTestColorControl * cluster = [[CHIPTestColorControl alloc] initWithDevice:device endpoint:1 queue:queue]; + CHIPTestOnOff * cluster = [[CHIPTestOnOff alloc] initWithDevice:device endpoint:1 queue:queue]; XCTAssertNotNil(cluster); - [cluster readAttributeRemainingTimeWithResponseHandler:^(NSError * err, NSDictionary * values) { - NSLog(@"Check Remaining time attribute value matched the value sent by the last command Error: %@", err); + [cluster off:^(NSError * err, NSDictionary * values) { + NSLog(@"Turn off light that we turned on Error: %@", err); XCTAssertEqual(err.code, 0); - XCTAssertEqual([values[@"value"] unsignedShortValue], 1); + [expectation fulfill]; + }]; + + [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; +} +- (void)testSendClusterTest_TC_CC_4_4_000004_ReadAttribute +{ + XCTestExpectation * expectation = [self expectationWithDescription:@"Check on/off attribute value is false after off command"]; + + CHIPDevice * device = GetPairedDevice(kDeviceId); + dispatch_queue_t queue = dispatch_get_main_queue(); + CHIPTestOnOff * cluster = [[CHIPTestOnOff alloc] initWithDevice:device endpoint:1 queue:queue]; + XCTAssertNotNil(cluster); + + [cluster readAttributeOnOffWithResponseHandler:^(NSError * err, NSDictionary * values) { + NSLog(@"Check on/off attribute value is false after off command Error: %@", err); + + XCTAssertEqual(err.code, 0); + + XCTAssertEqual([values[@"value"] boolValue], 0); [expectation fulfill]; }]; [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; } -- (void)testSendClusterTest_TC_CC_7_000004_EnhancedMoveHue + +- (void)testSendClusterTest_TC_CC_5_1_000000_On { - XCTestExpectation * expectation = [self expectationWithDescription:@"Enhanced Move Hue Down command "]; + XCTestExpectation * expectation = [self expectationWithDescription:@"Turn on light for color control tests"]; CHIPDevice * device = GetPairedDevice(kDeviceId); dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPTestColorControl * cluster = [[CHIPTestColorControl alloc] initWithDevice:device endpoint:1 queue:queue]; + CHIPTestOnOff * cluster = [[CHIPTestOnOff alloc] initWithDevice:device endpoint:1 queue:queue]; XCTAssertNotNil(cluster); - uint8_t moveModeArgument = 3; - uint16_t rateArgument = 5U; - uint8_t optionsMaskArgument = 0; - uint8_t optionsOverrideArgument = 0; - [cluster enhancedMoveHue:moveModeArgument - rate:rateArgument - optionsMask:optionsMaskArgument - optionsOverride:optionsOverrideArgument - responseHandler:^(NSError * err, NSDictionary * values) { - NSLog(@"Enhanced Move Hue Down command Error: %@", err); + [cluster on:^(NSError * err, NSDictionary * values) { + NSLog(@"Turn on light for color control tests Error: %@", err); - XCTAssertEqual(err.code, 0); + XCTAssertEqual(err.code, 0); - [expectation fulfill]; - }]; + [expectation fulfill]; + }]; [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; } -- (void)testSendClusterTest_TC_CC_7_000005_EnhancedMoveHue +- (void)testSendClusterTest_TC_CC_5_1_000001_ReadAttribute { - XCTestExpectation * expectation = [self expectationWithDescription:@"Enhanced Move Hue Stop command"]; + XCTestExpectation * expectation = [self expectationWithDescription:@"Check on/off attribute value is true after on command"]; CHIPDevice * device = GetPairedDevice(kDeviceId); dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPTestColorControl * cluster = [[CHIPTestColorControl alloc] initWithDevice:device endpoint:1 queue:queue]; + CHIPTestOnOff * cluster = [[CHIPTestOnOff alloc] initWithDevice:device endpoint:1 queue:queue]; XCTAssertNotNil(cluster); - uint8_t moveModeArgument = 0; - uint16_t rateArgument = 0U; - uint8_t optionsMaskArgument = 0; - uint8_t optionsOverrideArgument = 0; - [cluster enhancedMoveHue:moveModeArgument - rate:rateArgument - optionsMask:optionsMaskArgument - optionsOverride:optionsOverrideArgument - responseHandler:^(NSError * err, NSDictionary * values) { - NSLog(@"Enhanced Move Hue Stop command Error: %@", err); + [cluster readAttributeOnOffWithResponseHandler:^(NSError * err, NSDictionary * values) { + NSLog(@"Check on/off attribute value is true after on command Error: %@", err); - XCTAssertEqual(err.code, 0); + XCTAssertEqual(err.code, 0); - [expectation fulfill]; - }]; + XCTAssertEqual([values[@"value"] boolValue], 1); + + [expectation fulfill]; + }]; [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; } -- (void)testSendClusterTest_TC_CC_7_000006_EnhancedMoveHue +- (void)testSendClusterTest_TC_CC_5_1_000002_MoveToColor { - XCTestExpectation * expectation = [self expectationWithDescription:@"Enhanced Move Hue Up command"]; + XCTestExpectation * expectation = [self expectationWithDescription:@"Move to Color command"]; CHIPDevice * device = GetPairedDevice(kDeviceId); dispatch_queue_t queue = dispatch_get_main_queue(); CHIPTestColorControl * cluster = [[CHIPTestColorControl alloc] initWithDevice:device endpoint:1 queue:queue]; XCTAssertNotNil(cluster); - uint8_t moveModeArgument = 1; - uint16_t rateArgument = 50U; + uint16_t colorXArgument = 200U; + uint16_t colorYArgument = 300U; + uint16_t transitionTimeArgument = 20U; uint8_t optionsMaskArgument = 0; uint8_t optionsOverrideArgument = 0; - [cluster enhancedMoveHue:moveModeArgument - rate:rateArgument - optionsMask:optionsMaskArgument - optionsOverride:optionsOverrideArgument - responseHandler:^(NSError * err, NSDictionary * values) { - NSLog(@"Enhanced Move Hue Up command Error: %@", err); + [cluster moveToColor:colorXArgument + colorY:colorYArgument + transitionTime:transitionTimeArgument + optionsMask:optionsMaskArgument + optionsOverride:optionsOverrideArgument + responseHandler:^(NSError * err, NSDictionary * values) { + NSLog(@"Move to Color command Error: %@", err); - XCTAssertEqual(err.code, 0); + XCTAssertEqual(err.code, 0); - [expectation fulfill]; - }]; + [expectation fulfill]; + }]; + + [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; +} +- (void)testSendClusterTest_TC_CC_5_1_000003_Off +{ + XCTestExpectation * expectation = [self expectationWithDescription:@"Turn off light that we turned on"]; + + CHIPDevice * device = GetPairedDevice(kDeviceId); + dispatch_queue_t queue = dispatch_get_main_queue(); + CHIPTestOnOff * cluster = [[CHIPTestOnOff alloc] initWithDevice:device endpoint:1 queue:queue]; + XCTAssertNotNil(cluster); + + [cluster off:^(NSError * err, NSDictionary * values) { + NSLog(@"Turn off light that we turned on Error: %@", err); + + XCTAssertEqual(err.code, 0); + + [expectation fulfill]; + }]; + + [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; +} +- (void)testSendClusterTest_TC_CC_5_1_000004_ReadAttribute +{ + XCTestExpectation * expectation = [self expectationWithDescription:@"Check on/off attribute value is false after off command"]; + + CHIPDevice * device = GetPairedDevice(kDeviceId); + dispatch_queue_t queue = dispatch_get_main_queue(); + CHIPTestOnOff * cluster = [[CHIPTestOnOff alloc] initWithDevice:device endpoint:1 queue:queue]; + XCTAssertNotNil(cluster); + + [cluster readAttributeOnOffWithResponseHandler:^(NSError * err, NSDictionary * values) { + NSLog(@"Check on/off attribute value is false after off command Error: %@", err); + + XCTAssertEqual(err.code, 0); + + XCTAssertEqual([values[@"value"] boolValue], 0); + + [expectation fulfill]; + }]; [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; } -- (void)testSendClusterTest_TC_CC_7_000007_EnhancedMoveHue + +- (void)testSendClusterTest_TC_CC_5_2_000000_On { - XCTestExpectation * expectation = [self expectationWithDescription:@"Enhanced Move Hue Stop command"]; + XCTestExpectation * expectation = [self expectationWithDescription:@"Turn on light for color control tests"]; CHIPDevice * device = GetPairedDevice(kDeviceId); dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPTestColorControl * cluster = [[CHIPTestColorControl alloc] initWithDevice:device endpoint:1 queue:queue]; + CHIPTestOnOff * cluster = [[CHIPTestOnOff alloc] initWithDevice:device endpoint:1 queue:queue]; XCTAssertNotNil(cluster); - uint8_t moveModeArgument = 0; - uint16_t rateArgument = 0U; - uint8_t optionsMaskArgument = 0; - uint8_t optionsOverrideArgument = 0; - [cluster enhancedMoveHue:moveModeArgument - rate:rateArgument - optionsMask:optionsMaskArgument - optionsOverride:optionsOverrideArgument - responseHandler:^(NSError * err, NSDictionary * values) { - NSLog(@"Enhanced Move Hue Stop command Error: %@", err); + [cluster on:^(NSError * err, NSDictionary * values) { + NSLog(@"Turn on light for color control tests Error: %@", err); - XCTAssertEqual(err.code, 0); + XCTAssertEqual(err.code, 0); - [expectation fulfill]; - }]; + [expectation fulfill]; + }]; [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; } -- (void)testSendClusterTest_TC_CC_7_000008_EnhancedStepHue +- (void)testSendClusterTest_TC_CC_5_2_000001_ReadAttribute { - XCTestExpectation * expectation = [self expectationWithDescription:@"Enhanced Step Hue Up command"]; + XCTestExpectation * expectation = [self expectationWithDescription:@"Check on/off attribute value is true after on command"]; CHIPDevice * device = GetPairedDevice(kDeviceId); dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPTestColorControl * cluster = [[CHIPTestColorControl alloc] initWithDevice:device endpoint:1 queue:queue]; + CHIPTestOnOff * cluster = [[CHIPTestOnOff alloc] initWithDevice:device endpoint:1 queue:queue]; XCTAssertNotNil(cluster); - uint8_t stepModeArgument = 0; - uint16_t stepSizeArgument = 50U; - uint16_t transitionTimeArgument = 1U; - uint8_t optionsMaskArgument = 0; - uint8_t optionsOverrideArgument = 0; - [cluster enhancedStepHue:stepModeArgument - stepSize:stepSizeArgument - transitionTime:transitionTimeArgument - optionsMask:optionsMaskArgument - optionsOverride:optionsOverrideArgument - responseHandler:^(NSError * err, NSDictionary * values) { - NSLog(@"Enhanced Step Hue Up command Error: %@", err); + [cluster readAttributeOnOffWithResponseHandler:^(NSError * err, NSDictionary * values) { + NSLog(@"Check on/off attribute value is true after on command Error: %@", err); - XCTAssertEqual(err.code, 0); + XCTAssertEqual(err.code, 0); - [expectation fulfill]; - }]; + XCTAssertEqual([values[@"value"] boolValue], 1); + + [expectation fulfill]; + }]; [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; } -- (void)testSendClusterTest_TC_CC_7_000009_EnhancedStepHue +- (void)testSendClusterTest_TC_CC_5_2_000002_MoveColor { - XCTestExpectation * expectation = [self expectationWithDescription:@"Enhanced Step Hue Down command"]; + XCTestExpectation * expectation = [self expectationWithDescription:@"Move Color command"]; CHIPDevice * device = GetPairedDevice(kDeviceId); dispatch_queue_t queue = dispatch_get_main_queue(); CHIPTestColorControl * cluster = [[CHIPTestColorControl alloc] initWithDevice:device endpoint:1 queue:queue]; XCTAssertNotNil(cluster); - uint8_t stepModeArgument = 1; - uint16_t stepSizeArgument = 75U; - uint16_t transitionTimeArgument = 1U; + int16_t rateXArgument = 15; + int16_t rateYArgument = 20; uint8_t optionsMaskArgument = 0; uint8_t optionsOverrideArgument = 0; - [cluster enhancedStepHue:stepModeArgument - stepSize:stepSizeArgument - transitionTime:transitionTimeArgument - optionsMask:optionsMaskArgument - optionsOverride:optionsOverrideArgument - responseHandler:^(NSError * err, NSDictionary * values) { - NSLog(@"Enhanced Step Hue Down command Error: %@", err); + [cluster moveColor:rateXArgument + rateY:rateYArgument + optionsMask:optionsMaskArgument + optionsOverride:optionsOverrideArgument + responseHandler:^(NSError * err, NSDictionary * values) { + NSLog(@"Move Color command Error: %@", err); - XCTAssertEqual(err.code, 0); + XCTAssertEqual(err.code, 0); - [expectation fulfill]; - }]; + [expectation fulfill]; + }]; [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; } -- (void)testSendClusterTest_TC_CC_7_000010_EnhancedMoveToHueAndSaturation +- (void)testSendClusterTest_TC_CC_5_2_000003_StopMoveStep { - XCTestExpectation * expectation = [self expectationWithDescription:@"Enhanced move to hue and saturation command"]; + XCTestExpectation * expectation = [self expectationWithDescription:@"Stop Move Step command"]; CHIPDevice * device = GetPairedDevice(kDeviceId); dispatch_queue_t queue = dispatch_get_main_queue(); CHIPTestColorControl * cluster = [[CHIPTestColorControl alloc] initWithDevice:device endpoint:1 queue:queue]; XCTAssertNotNil(cluster); - uint16_t enhancedHueArgument = 1200U; - uint8_t saturationArgument = 90; - uint16_t transitionTimeArgument = 10U; uint8_t optionsMaskArgument = 0; uint8_t optionsOverrideArgument = 0; - [cluster enhancedMoveToHueAndSaturation:enhancedHueArgument - saturation:saturationArgument - transitionTime:transitionTimeArgument - optionsMask:optionsMaskArgument - optionsOverride:optionsOverrideArgument - responseHandler:^(NSError * err, NSDictionary * values) { - NSLog(@"Enhanced move to hue and saturation command Error: %@", err); + [cluster stopMoveStep:optionsMaskArgument + optionsOverride:optionsOverrideArgument + responseHandler:^(NSError * err, NSDictionary * values) { + NSLog(@"Stop Move Step command Error: %@", err); - XCTAssertEqual(err.code, 0); + XCTAssertEqual(err.code, 0); - [expectation fulfill]; - }]; + [expectation fulfill]; + }]; [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; } -- (void)testSendClusterTest_TC_CC_7_000011_Off +- (void)testSendClusterTest_TC_CC_5_2_000004_Off { XCTestExpectation * expectation = [self expectationWithDescription:@"Turn off light that we turned on"]; @@ -5354,7 +6782,7 @@ - (void)testSendClusterTest_TC_CC_7_000011_Off [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; } -- (void)testSendClusterTest_TC_CC_7_000012_ReadAttribute +- (void)testSendClusterTest_TC_CC_5_2_000005_ReadAttribute { XCTestExpectation * expectation = [self expectationWithDescription:@"Check on/off attribute value is false after off command"]; @@ -5376,7 +6804,7 @@ - (void)testSendClusterTest_TC_CC_7_000012_ReadAttribute [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; } -- (void)testSendClusterTest_TC_CC_8_000000_On +- (void)testSendClusterTest_TC_CC_5_3_000000_On { XCTestExpectation * expectation = [self expectationWithDescription:@"Turn on light for color control tests"]; @@ -5395,7 +6823,7 @@ - (void)testSendClusterTest_TC_CC_8_000000_On [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; } -- (void)testSendClusterTest_TC_CC_8_000001_ReadAttribute +- (void)testSendClusterTest_TC_CC_5_3_000001_ReadAttribute { XCTestExpectation * expectation = [self expectationWithDescription:@"Check on/off attribute value is true after on command"]; @@ -5416,318 +6844,369 @@ - (void)testSendClusterTest_TC_CC_8_000001_ReadAttribute [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; } -- (void)testSendClusterTest_TC_CC_8_000002_ColorLoopSet +- (void)testSendClusterTest_TC_CC_5_3_000002_StepColor { - XCTestExpectation * expectation = [self expectationWithDescription:@"Color Loop Set Command - Set all Attributs"]; + XCTestExpectation * expectation = [self expectationWithDescription:@"Step Color command"]; CHIPDevice * device = GetPairedDevice(kDeviceId); dispatch_queue_t queue = dispatch_get_main_queue(); CHIPTestColorControl * cluster = [[CHIPTestColorControl alloc] initWithDevice:device endpoint:1 queue:queue]; XCTAssertNotNil(cluster); - uint8_t updateFlagsArgument = 14; - uint8_t actionArgument = 0; - uint8_t directionArgument = 1; - uint16_t timeArgument = 100U; - uint16_t startHueArgument = 500U; + int16_t stepXArgument = 15; + int16_t stepYArgument = 20; + uint16_t transitionTimeArgument = 50U; uint8_t optionsMaskArgument = 0; uint8_t optionsOverrideArgument = 0; - [cluster colorLoopSet:updateFlagsArgument - action:actionArgument - direction:directionArgument - time:timeArgument - startHue:startHueArgument - optionsMask:optionsMaskArgument - optionsOverride:optionsOverrideArgument - responseHandler:^(NSError * err, NSDictionary * values) { - NSLog(@"Color Loop Set Command - Set all Attributs Error: %@", err); + [cluster stepColor:stepXArgument + stepY:stepYArgument + transitionTime:transitionTimeArgument + optionsMask:optionsMaskArgument + optionsOverride:optionsOverrideArgument + responseHandler:^(NSError * err, NSDictionary * values) { + NSLog(@"Step Color command Error: %@", err); - XCTAssertEqual(err.code, 0); + XCTAssertEqual(err.code, 0); - [expectation fulfill]; - }]; + [expectation fulfill]; + }]; [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; } -- (void)testSendClusterTest_TC_CC_8_000003_ReadAttribute +- (void)testSendClusterTest_TC_CC_5_3_000003_Off { - XCTestExpectation * expectation = [self expectationWithDescription:@"Check ColorLoopDirection Value"]; + XCTestExpectation * expectation = [self expectationWithDescription:@"Turn off light that we turned on"]; CHIPDevice * device = GetPairedDevice(kDeviceId); dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPTestColorControl * cluster = [[CHIPTestColorControl alloc] initWithDevice:device endpoint:1 queue:queue]; + CHIPTestOnOff * cluster = [[CHIPTestOnOff alloc] initWithDevice:device endpoint:1 queue:queue]; XCTAssertNotNil(cluster); - [cluster readAttributeColorLoopDirectionWithResponseHandler:^(NSError * err, NSDictionary * values) { - NSLog(@"Check ColorLoopDirection Value Error: %@", err); + [cluster off:^(NSError * err, NSDictionary * values) { + NSLog(@"Turn off light that we turned on Error: %@", err); XCTAssertEqual(err.code, 0); - XCTAssertEqual([values[@"value"] unsignedCharValue], 1); - [expectation fulfill]; }]; [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; } -- (void)testSendClusterTest_TC_CC_8_000004_ReadAttribute +- (void)testSendClusterTest_TC_CC_5_3_000004_ReadAttribute { - XCTestExpectation * expectation = [self expectationWithDescription:@"Check ColorLoopTime Value"]; + XCTestExpectation * expectation = [self expectationWithDescription:@"Check on/off attribute value is false after off command"]; CHIPDevice * device = GetPairedDevice(kDeviceId); dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPTestColorControl * cluster = [[CHIPTestColorControl alloc] initWithDevice:device endpoint:1 queue:queue]; + CHIPTestOnOff * cluster = [[CHIPTestOnOff alloc] initWithDevice:device endpoint:1 queue:queue]; XCTAssertNotNil(cluster); - [cluster readAttributeColorLoopTimeWithResponseHandler:^(NSError * err, NSDictionary * values) { - NSLog(@"Check ColorLoopTime Value Error: %@", err); + [cluster readAttributeOnOffWithResponseHandler:^(NSError * err, NSDictionary * values) { + NSLog(@"Check on/off attribute value is false after off command Error: %@", err); XCTAssertEqual(err.code, 0); - XCTAssertEqual([values[@"value"] unsignedShortValue], 100); + XCTAssertEqual([values[@"value"] boolValue], 0); [expectation fulfill]; }]; [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; } -- (void)testSendClusterTest_TC_CC_8_000005_ReadAttribute + +- (void)testSendClusterTest_TC_CC_6_1_000000_On { - XCTestExpectation * expectation = [self expectationWithDescription:@"Check ColorLoopStartEnhancedHue Value"]; + XCTestExpectation * expectation = [self expectationWithDescription:@"Turn on light for color control tests"]; CHIPDevice * device = GetPairedDevice(kDeviceId); dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPTestColorControl * cluster = [[CHIPTestColorControl alloc] initWithDevice:device endpoint:1 queue:queue]; + CHIPTestOnOff * cluster = [[CHIPTestOnOff alloc] initWithDevice:device endpoint:1 queue:queue]; XCTAssertNotNil(cluster); - [cluster readAttributeColorLoopStartEnhancedHueWithResponseHandler:^(NSError * err, NSDictionary * values) { - NSLog(@"Check ColorLoopStartEnhancedHue Value Error: %@", err); + [cluster on:^(NSError * err, NSDictionary * values) { + NSLog(@"Turn on light for color control tests Error: %@", err); XCTAssertEqual(err.code, 0); - XCTAssertEqual([values[@"value"] unsignedShortValue], 500); - [expectation fulfill]; }]; [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; } -- (void)testSendClusterTest_TC_CC_8_000006_ReadAttribute +- (void)testSendClusterTest_TC_CC_6_1_000001_ReadAttribute { - XCTestExpectation * expectation = [self expectationWithDescription:@"Check ColorLoopActive Value"]; + XCTestExpectation * expectation = [self expectationWithDescription:@"Check on/off attribute value is true after on command"]; CHIPDevice * device = GetPairedDevice(kDeviceId); dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPTestColorControl * cluster = [[CHIPTestColorControl alloc] initWithDevice:device endpoint:1 queue:queue]; + CHIPTestOnOff * cluster = [[CHIPTestOnOff alloc] initWithDevice:device endpoint:1 queue:queue]; XCTAssertNotNil(cluster); - [cluster readAttributeColorLoopActiveWithResponseHandler:^(NSError * err, NSDictionary * values) { - NSLog(@"Check ColorLoopActive Value Error: %@", err); + [cluster readAttributeOnOffWithResponseHandler:^(NSError * err, NSDictionary * values) { + NSLog(@"Check on/off attribute value is true after on command Error: %@", err); XCTAssertEqual(err.code, 0); - XCTAssertEqual([values[@"value"] unsignedCharValue], 0); + XCTAssertEqual([values[@"value"] boolValue], 1); [expectation fulfill]; }]; [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; } -- (void)testSendClusterTest_TC_CC_8_000007_ColorLoopSet +- (void)testSendClusterTest_TC_CC_6_1_000002_MoveToColorTemperature { - XCTestExpectation * expectation = [self expectationWithDescription:@"Color Loop Set Command - Start Color Loop"]; + XCTestExpectation * expectation = [self expectationWithDescription:@"Move To Color Temperature command"]; CHIPDevice * device = GetPairedDevice(kDeviceId); dispatch_queue_t queue = dispatch_get_main_queue(); CHIPTestColorControl * cluster = [[CHIPTestColorControl alloc] initWithDevice:device endpoint:1 queue:queue]; XCTAssertNotNil(cluster); - uint8_t updateFlagsArgument = 1; - uint8_t actionArgument = 1; - uint8_t directionArgument = 0; - uint16_t timeArgument = 0U; - uint16_t startHueArgument = 0U; + uint16_t colorTemperatureArgument = 100U; + uint16_t transitionTimeArgument = 10U; uint8_t optionsMaskArgument = 0; uint8_t optionsOverrideArgument = 0; - [cluster colorLoopSet:updateFlagsArgument - action:actionArgument - direction:directionArgument - time:timeArgument - startHue:startHueArgument - optionsMask:optionsMaskArgument - optionsOverride:optionsOverrideArgument - responseHandler:^(NSError * err, NSDictionary * values) { - NSLog(@"Color Loop Set Command - Start Color Loop Error: %@", err); + [cluster moveToColorTemperature:colorTemperatureArgument + transitionTime:transitionTimeArgument + optionsMask:optionsMaskArgument + optionsOverride:optionsOverrideArgument + responseHandler:^(NSError * err, NSDictionary * values) { + NSLog(@"Move To Color Temperature command Error: %@", err); - XCTAssertEqual(err.code, 0); + XCTAssertEqual(err.code, 0); - [expectation fulfill]; - }]; + [expectation fulfill]; + }]; + + [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; +} +- (void)testSendClusterTest_TC_CC_6_1_000003_Off +{ + XCTestExpectation * expectation = [self expectationWithDescription:@"Turn off light that we turned on"]; + + CHIPDevice * device = GetPairedDevice(kDeviceId); + dispatch_queue_t queue = dispatch_get_main_queue(); + CHIPTestOnOff * cluster = [[CHIPTestOnOff alloc] initWithDevice:device endpoint:1 queue:queue]; + XCTAssertNotNil(cluster); + + [cluster off:^(NSError * err, NSDictionary * values) { + NSLog(@"Turn off light that we turned on Error: %@", err); + + XCTAssertEqual(err.code, 0); + + [expectation fulfill]; + }]; + + [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; +} +- (void)testSendClusterTest_TC_CC_6_1_000004_ReadAttribute +{ + XCTestExpectation * expectation = [self expectationWithDescription:@"Check on/off attribute value is false after off command"]; + + CHIPDevice * device = GetPairedDevice(kDeviceId); + dispatch_queue_t queue = dispatch_get_main_queue(); + CHIPTestOnOff * cluster = [[CHIPTestOnOff alloc] initWithDevice:device endpoint:1 queue:queue]; + XCTAssertNotNil(cluster); + + [cluster readAttributeOnOffWithResponseHandler:^(NSError * err, NSDictionary * values) { + NSLog(@"Check on/off attribute value is false after off command Error: %@", err); + + XCTAssertEqual(err.code, 0); + + XCTAssertEqual([values[@"value"] boolValue], 0); + + [expectation fulfill]; + }]; + + [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; +} + +- (void)testSendClusterTest_TC_CC_6_2_000000_On +{ + XCTestExpectation * expectation = [self expectationWithDescription:@"Turn on light for color control tests"]; + + CHIPDevice * device = GetPairedDevice(kDeviceId); + dispatch_queue_t queue = dispatch_get_main_queue(); + CHIPTestOnOff * cluster = [[CHIPTestOnOff alloc] initWithDevice:device endpoint:1 queue:queue]; + XCTAssertNotNil(cluster); + + [cluster on:^(NSError * err, NSDictionary * values) { + NSLog(@"Turn on light for color control tests Error: %@", err); + + XCTAssertEqual(err.code, 0); + + [expectation fulfill]; + }]; [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; } -- (void)testSendClusterTest_TC_CC_8_000008_ReadAttribute +- (void)testSendClusterTest_TC_CC_6_2_000001_ReadAttribute { - XCTestExpectation * expectation = [self expectationWithDescription:@"Check ColorLoopActive Value"]; + XCTestExpectation * expectation = [self expectationWithDescription:@"Check on/off attribute value is true after on command"]; CHIPDevice * device = GetPairedDevice(kDeviceId); dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPTestColorControl * cluster = [[CHIPTestColorControl alloc] initWithDevice:device endpoint:1 queue:queue]; + CHIPTestOnOff * cluster = [[CHIPTestOnOff alloc] initWithDevice:device endpoint:1 queue:queue]; XCTAssertNotNil(cluster); - [cluster readAttributeColorLoopActiveWithResponseHandler:^(NSError * err, NSDictionary * values) { - NSLog(@"Check ColorLoopActive Value Error: %@", err); + [cluster readAttributeOnOffWithResponseHandler:^(NSError * err, NSDictionary * values) { + NSLog(@"Check on/off attribute value is true after on command Error: %@", err); XCTAssertEqual(err.code, 0); - XCTAssertEqual([values[@"value"] unsignedCharValue], 1); + XCTAssertEqual([values[@"value"] boolValue], 1); [expectation fulfill]; }]; [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; } -- (void)testSendClusterTest_TC_CC_8_000009_ColorLoopSet +- (void)testSendClusterTest_TC_CC_6_2_000002_MoveColorTemperature { - XCTestExpectation * expectation = - [self expectationWithDescription:@"Color Loop Set Command - Set direction and time while running"]; + XCTestExpectation * expectation = [self expectationWithDescription:@"Move up color temperature command"]; CHIPDevice * device = GetPairedDevice(kDeviceId); dispatch_queue_t queue = dispatch_get_main_queue(); CHIPTestColorControl * cluster = [[CHIPTestColorControl alloc] initWithDevice:device endpoint:1 queue:queue]; XCTAssertNotNil(cluster); - uint8_t updateFlagsArgument = 6; - uint8_t actionArgument = 0; - uint8_t directionArgument = 0; - uint16_t timeArgument = 3500U; - uint16_t startHueArgument = 0U; + uint8_t moveModeArgument = 1; + uint16_t rateArgument = 10U; + uint16_t colorTemperatureMinimumArgument = 1U; + uint16_t colorTemperatureMaximumArgument = 255U; uint8_t optionsMaskArgument = 0; uint8_t optionsOverrideArgument = 0; - [cluster colorLoopSet:updateFlagsArgument - action:actionArgument - direction:directionArgument - time:timeArgument - startHue:startHueArgument - optionsMask:optionsMaskArgument - optionsOverride:optionsOverrideArgument - responseHandler:^(NSError * err, NSDictionary * values) { - NSLog(@"Color Loop Set Command - Set direction and time while running Error: %@", err); + [cluster moveColorTemperature:moveModeArgument + rate:rateArgument + colorTemperatureMinimum:colorTemperatureMinimumArgument + colorTemperatureMaximum:colorTemperatureMaximumArgument + optionsMask:optionsMaskArgument + optionsOverride:optionsOverrideArgument + responseHandler:^(NSError * err, NSDictionary * values) { + NSLog(@"Move up color temperature command Error: %@", err); - XCTAssertEqual(err.code, 0); + XCTAssertEqual(err.code, 0); - [expectation fulfill]; - }]; + [expectation fulfill]; + }]; [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; } -- (void)testSendClusterTest_TC_CC_8_000010_ReadAttribute +- (void)testSendClusterTest_TC_CC_6_2_000003_MoveColorTemperature { - XCTestExpectation * expectation = [self expectationWithDescription:@"Check ColorLoopDirection Value"]; + XCTestExpectation * expectation = [self expectationWithDescription:@"Stop Color Temperature command"]; CHIPDevice * device = GetPairedDevice(kDeviceId); dispatch_queue_t queue = dispatch_get_main_queue(); CHIPTestColorControl * cluster = [[CHIPTestColorControl alloc] initWithDevice:device endpoint:1 queue:queue]; XCTAssertNotNil(cluster); - [cluster readAttributeColorLoopDirectionWithResponseHandler:^(NSError * err, NSDictionary * values) { - NSLog(@"Check ColorLoopDirection Value Error: %@", err); - - XCTAssertEqual(err.code, 0); + uint8_t moveModeArgument = 0; + uint16_t rateArgument = 10U; + uint16_t colorTemperatureMinimumArgument = 1U; + uint16_t colorTemperatureMaximumArgument = 255U; + uint8_t optionsMaskArgument = 0; + uint8_t optionsOverrideArgument = 0; + [cluster moveColorTemperature:moveModeArgument + rate:rateArgument + colorTemperatureMinimum:colorTemperatureMinimumArgument + colorTemperatureMaximum:colorTemperatureMaximumArgument + optionsMask:optionsMaskArgument + optionsOverride:optionsOverrideArgument + responseHandler:^(NSError * err, NSDictionary * values) { + NSLog(@"Stop Color Temperature command Error: %@", err); - XCTAssertEqual([values[@"value"] unsignedCharValue], 0); + XCTAssertEqual(err.code, 0); - [expectation fulfill]; - }]; + [expectation fulfill]; + }]; [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; } -- (void)testSendClusterTest_TC_CC_8_000011_ReadAttribute +- (void)testSendClusterTest_TC_CC_6_2_000004_MoveColorTemperature { - XCTestExpectation * expectation = [self expectationWithDescription:@"Check ColorLoopTime Value"]; + XCTestExpectation * expectation = [self expectationWithDescription:@"Move down color temperature command"]; CHIPDevice * device = GetPairedDevice(kDeviceId); dispatch_queue_t queue = dispatch_get_main_queue(); CHIPTestColorControl * cluster = [[CHIPTestColorControl alloc] initWithDevice:device endpoint:1 queue:queue]; XCTAssertNotNil(cluster); - [cluster readAttributeColorLoopTimeWithResponseHandler:^(NSError * err, NSDictionary * values) { - NSLog(@"Check ColorLoopTime Value Error: %@", err); - - XCTAssertEqual(err.code, 0); + uint8_t moveModeArgument = 3; + uint16_t rateArgument = 20U; + uint16_t colorTemperatureMinimumArgument = 1U; + uint16_t colorTemperatureMaximumArgument = 255U; + uint8_t optionsMaskArgument = 0; + uint8_t optionsOverrideArgument = 0; + [cluster moveColorTemperature:moveModeArgument + rate:rateArgument + colorTemperatureMinimum:colorTemperatureMinimumArgument + colorTemperatureMaximum:colorTemperatureMaximumArgument + optionsMask:optionsMaskArgument + optionsOverride:optionsOverrideArgument + responseHandler:^(NSError * err, NSDictionary * values) { + NSLog(@"Move down color temperature command Error: %@", err); - XCTAssertEqual([values[@"value"] unsignedShortValue], 3500); + XCTAssertEqual(err.code, 0); - [expectation fulfill]; - }]; + [expectation fulfill]; + }]; [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; } -- (void)testSendClusterTest_TC_CC_8_000012_ColorLoopSet +- (void)testSendClusterTest_TC_CC_6_2_000005_Off { - XCTestExpectation * expectation = [self expectationWithDescription:@"Color Loop Set Command - Set direction while running"]; + XCTestExpectation * expectation = [self expectationWithDescription:@"Turn off light that we turned on"]; CHIPDevice * device = GetPairedDevice(kDeviceId); dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPTestColorControl * cluster = [[CHIPTestColorControl alloc] initWithDevice:device endpoint:1 queue:queue]; + CHIPTestOnOff * cluster = [[CHIPTestOnOff alloc] initWithDevice:device endpoint:1 queue:queue]; XCTAssertNotNil(cluster); - uint8_t updateFlagsArgument = 2; - uint8_t actionArgument = 0; - uint8_t directionArgument = 1; - uint16_t timeArgument = 0U; - uint16_t startHueArgument = 0U; - uint8_t optionsMaskArgument = 0; - uint8_t optionsOverrideArgument = 0; - [cluster colorLoopSet:updateFlagsArgument - action:actionArgument - direction:directionArgument - time:timeArgument - startHue:startHueArgument - optionsMask:optionsMaskArgument - optionsOverride:optionsOverrideArgument - responseHandler:^(NSError * err, NSDictionary * values) { - NSLog(@"Color Loop Set Command - Set direction while running Error: %@", err); + [cluster off:^(NSError * err, NSDictionary * values) { + NSLog(@"Turn off light that we turned on Error: %@", err); - XCTAssertEqual(err.code, 0); + XCTAssertEqual(err.code, 0); - [expectation fulfill]; - }]; + [expectation fulfill]; + }]; [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; } -- (void)testSendClusterTest_TC_CC_8_000013_ReadAttribute +- (void)testSendClusterTest_TC_CC_6_2_000006_ReadAttribute { - XCTestExpectation * expectation = [self expectationWithDescription:@"Check ColorLoopDirection Value"]; + XCTestExpectation * expectation = [self expectationWithDescription:@"Check on/off attribute value is false after off command"]; CHIPDevice * device = GetPairedDevice(kDeviceId); dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPTestColorControl * cluster = [[CHIPTestColorControl alloc] initWithDevice:device endpoint:1 queue:queue]; + CHIPTestOnOff * cluster = [[CHIPTestOnOff alloc] initWithDevice:device endpoint:1 queue:queue]; XCTAssertNotNil(cluster); - [cluster readAttributeColorLoopDirectionWithResponseHandler:^(NSError * err, NSDictionary * values) { - NSLog(@"Check ColorLoopDirection Value Error: %@", err); + [cluster readAttributeOnOffWithResponseHandler:^(NSError * err, NSDictionary * values) { + NSLog(@"Check on/off attribute value is false after off command Error: %@", err); XCTAssertEqual(err.code, 0); - XCTAssertEqual([values[@"value"] unsignedCharValue], 1); + XCTAssertEqual([values[@"value"] boolValue], 0); [expectation fulfill]; }]; [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; } -- (void)testSendClusterTest_TC_CC_8_000014_Off + +- (void)testSendClusterTest_TC_CC_6_3_000000_On { - XCTestExpectation * expectation = [self expectationWithDescription:@"Turn off light that we turned on"]; + XCTestExpectation * expectation = [self expectationWithDescription:@"Turn on light for color control tests"]; CHIPDevice * device = GetPairedDevice(kDeviceId); dispatch_queue_t queue = dispatch_get_main_queue(); CHIPTestOnOff * cluster = [[CHIPTestOnOff alloc] initWithDevice:device endpoint:1 queue:queue]; XCTAssertNotNil(cluster); - [cluster off:^(NSError * err, NSDictionary * values) { - NSLog(@"Turn off light that we turned on Error: %@", err); + [cluster on:^(NSError * err, NSDictionary * values) { + NSLog(@"Turn on light for color control tests Error: %@", err); XCTAssertEqual(err.code, 0); @@ -5736,9 +7215,9 @@ - (void)testSendClusterTest_TC_CC_8_000014_Off [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; } -- (void)testSendClusterTest_TC_CC_8_000015_ReadAttribute +- (void)testSendClusterTest_TC_CC_6_3_000001_ReadAttribute { - XCTestExpectation * expectation = [self expectationWithDescription:@"Check on/off attribute value is false after off command"]; + XCTestExpectation * expectation = [self expectationWithDescription:@"Check on/off attribute value is true after on command"]; CHIPDevice * device = GetPairedDevice(kDeviceId); dispatch_queue_t queue = dispatch_get_main_queue(); @@ -5746,76 +7225,117 @@ - (void)testSendClusterTest_TC_CC_8_000015_ReadAttribute XCTAssertNotNil(cluster); [cluster readAttributeOnOffWithResponseHandler:^(NSError * err, NSDictionary * values) { - NSLog(@"Check on/off attribute value is false after off command Error: %@", err); + NSLog(@"Check on/off attribute value is true after on command Error: %@", err); XCTAssertEqual(err.code, 0); - XCTAssertEqual([values[@"value"] boolValue], 0); + XCTAssertEqual([values[@"value"] boolValue], 1); [expectation fulfill]; }]; [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; } - -- (void)testSendClusterTest_TC_WNCV_1_1_000000_ReadAttribute +- (void)testSendClusterTest_TC_CC_6_3_000002_StepColorTemperature { - XCTestExpectation * expectation = [self expectationWithDescription:@"read the global attribute: ClusterRevision"]; + XCTestExpectation * expectation = [self expectationWithDescription:@"Step up color temperature command"]; CHIPDevice * device = GetPairedDevice(kDeviceId); dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPTestWindowCovering * cluster = [[CHIPTestWindowCovering alloc] initWithDevice:device endpoint:1 queue:queue]; + CHIPTestColorControl * cluster = [[CHIPTestColorControl alloc] initWithDevice:device endpoint:1 queue:queue]; XCTAssertNotNil(cluster); - [cluster readAttributeClusterRevisionWithResponseHandler:^(NSError * err, NSDictionary * values) { - NSLog(@"read the global attribute: ClusterRevision Error: %@", err); + uint8_t stepModeArgument = 1; + uint16_t stepSizeArgument = 5U; + uint16_t transitionTimeArgument = 50U; + uint16_t colorTemperatureMinimumArgument = 5U; + uint16_t colorTemperatureMaximumArgument = 100U; + uint8_t optionsMaskArgument = 0; + uint8_t optionsOverrideArgument = 0; + [cluster stepColorTemperature:stepModeArgument + stepSize:stepSizeArgument + transitionTime:transitionTimeArgument + colorTemperatureMinimum:colorTemperatureMinimumArgument + colorTemperatureMaximum:colorTemperatureMaximumArgument + optionsMask:optionsMaskArgument + optionsOverride:optionsOverrideArgument + responseHandler:^(NSError * err, NSDictionary * values) { + NSLog(@"Step up color temperature command Error: %@", err); - XCTAssertEqual(err.code, 0); + XCTAssertEqual(err.code, 0); - XCTAssertEqual([values[@"value"] unsignedShortValue], 5); + [expectation fulfill]; + }]; - [expectation fulfill]; - }]; + [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; +} +- (void)testSendClusterTest_TC_CC_6_3_000003_StepColorTemperature +{ + XCTestExpectation * expectation = [self expectationWithDescription:@"Step down color temperature command"]; + + CHIPDevice * device = GetPairedDevice(kDeviceId); + dispatch_queue_t queue = dispatch_get_main_queue(); + CHIPTestColorControl * cluster = [[CHIPTestColorControl alloc] initWithDevice:device endpoint:1 queue:queue]; + XCTAssertNotNil(cluster); + + uint8_t stepModeArgument = 3; + uint16_t stepSizeArgument = 5U; + uint16_t transitionTimeArgument = 50U; + uint16_t colorTemperatureMinimumArgument = 5U; + uint16_t colorTemperatureMaximumArgument = 100U; + uint8_t optionsMaskArgument = 0; + uint8_t optionsOverrideArgument = 0; + [cluster stepColorTemperature:stepModeArgument + stepSize:stepSizeArgument + transitionTime:transitionTimeArgument + colorTemperatureMinimum:colorTemperatureMinimumArgument + colorTemperatureMaximum:colorTemperatureMaximumArgument + optionsMask:optionsMaskArgument + optionsOverride:optionsOverrideArgument + responseHandler:^(NSError * err, NSDictionary * values) { + NSLog(@"Step down color temperature command Error: %@", err); + + XCTAssertEqual(err.code, 0); + + [expectation fulfill]; + }]; [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; } -- (void)testSendClusterTest_TC_WNCV_1_1_000001_WriteAttribute +- (void)testSendClusterTest_TC_CC_6_3_000004_Off { - XCTestExpectation * expectation = - [self expectationWithDescription:@"write the default value to mandatory global attribute: ClusterRevision"]; + XCTestExpectation * expectation = [self expectationWithDescription:@"Turn off light that we turned on"]; CHIPDevice * device = GetPairedDevice(kDeviceId); dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPTestWindowCovering * cluster = [[CHIPTestWindowCovering alloc] initWithDevice:device endpoint:1 queue:queue]; + CHIPTestOnOff * cluster = [[CHIPTestOnOff alloc] initWithDevice:device endpoint:1 queue:queue]; XCTAssertNotNil(cluster); - uint16_t clusterRevisionArgument = 5U; - [cluster - writeAttributeClusterRevisionWithValue:clusterRevisionArgument - responseHandler:^(NSError * err, NSDictionary * values) { - NSLog(@"write the default value to mandatory global attribute: ClusterRevision Error: %@", err); + [cluster off:^(NSError * err, NSDictionary * values) { + NSLog(@"Turn off light that we turned on Error: %@", err); - XCTAssertEqual(err.code, 1); - [expectation fulfill]; - }]; + XCTAssertEqual(err.code, 0); + + [expectation fulfill]; + }]; [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; } -- (void)testSendClusterTest_TC_WNCV_1_1_000002_ReadAttribute +- (void)testSendClusterTest_TC_CC_6_3_000005_ReadAttribute { - XCTestExpectation * expectation = [self expectationWithDescription:@"reads back global attribute: ClusterRevision"]; + XCTestExpectation * expectation = [self expectationWithDescription:@"Check on/off attribute value is false after off command"]; CHIPDevice * device = GetPairedDevice(kDeviceId); dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPTestWindowCovering * cluster = [[CHIPTestWindowCovering alloc] initWithDevice:device endpoint:1 queue:queue]; + CHIPTestOnOff * cluster = [[CHIPTestOnOff alloc] initWithDevice:device endpoint:1 queue:queue]; XCTAssertNotNil(cluster); - [cluster readAttributeClusterRevisionWithResponseHandler:^(NSError * err, NSDictionary * values) { - NSLog(@"reads back global attribute: ClusterRevision Error: %@", err); + [cluster readAttributeOnOffWithResponseHandler:^(NSError * err, NSDictionary * values) { + NSLog(@"Check on/off attribute value is false after off command Error: %@", err); XCTAssertEqual(err.code, 0); - XCTAssertEqual([values[@"value"] unsignedShortValue], 5); + XCTAssertEqual([values[@"value"] boolValue], 0); [expectation fulfill]; }]; @@ -5823,269 +7343,297 @@ - (void)testSendClusterTest_TC_WNCV_1_1_000002_ReadAttribute [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; } -- (void)testSendClusterTest_TC_WNCV_2_1_000000_ReadAttribute +- (void)testSendClusterTest_TC_CC_7_1_000000_On { - XCTestExpectation * expectation = [self expectationWithDescription:@"read the RO mandatory attribute default: Type"]; + XCTestExpectation * expectation = [self expectationWithDescription:@"Turn on light for color control tests"]; CHIPDevice * device = GetPairedDevice(kDeviceId); dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPTestWindowCovering * cluster = [[CHIPTestWindowCovering alloc] initWithDevice:device endpoint:1 queue:queue]; + CHIPTestOnOff * cluster = [[CHIPTestOnOff alloc] initWithDevice:device endpoint:1 queue:queue]; XCTAssertNotNil(cluster); - [cluster readAttributeTypeWithResponseHandler:^(NSError * err, NSDictionary * values) { - NSLog(@"read the RO mandatory attribute default: Type Error: %@", err); + [cluster on:^(NSError * err, NSDictionary * values) { + NSLog(@"Turn on light for color control tests Error: %@", err); XCTAssertEqual(err.code, 0); - XCTAssertEqual([values[@"value"] unsignedCharValue], 0); - [expectation fulfill]; }]; [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; } -- (void)testSendClusterTest_TC_WNCV_2_1_000001_ReadAttribute +- (void)testSendClusterTest_TC_CC_7_1_000001_ReadAttribute { - XCTestExpectation * expectation = [self expectationWithDescription:@"reads back the RO mandatory attribute: Type"]; + XCTestExpectation * expectation = [self expectationWithDescription:@"Check on/off attribute value is true after on command"]; CHIPDevice * device = GetPairedDevice(kDeviceId); dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPTestWindowCovering * cluster = [[CHIPTestWindowCovering alloc] initWithDevice:device endpoint:1 queue:queue]; + CHIPTestOnOff * cluster = [[CHIPTestOnOff alloc] initWithDevice:device endpoint:1 queue:queue]; XCTAssertNotNil(cluster); - [cluster readAttributeTypeWithResponseHandler:^(NSError * err, NSDictionary * values) { - NSLog(@"reads back the RO mandatory attribute: Type Error: %@", err); + [cluster readAttributeOnOffWithResponseHandler:^(NSError * err, NSDictionary * values) { + NSLog(@"Check on/off attribute value is true after on command Error: %@", err); XCTAssertEqual(err.code, 0); - XCTAssertEqual([values[@"value"] unsignedCharValue], 0); + XCTAssertEqual([values[@"value"] boolValue], 1); [expectation fulfill]; }]; [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; } -- (void)testSendClusterTest_TC_WNCV_2_1_000002_ReadAttribute +- (void)testSendClusterTest_TC_CC_7_1_000002_EnhancedMoveToHue { - XCTestExpectation * expectation = [self expectationWithDescription:@"read the RO mandatory attribute default: ConfigStatus"]; + XCTestExpectation * expectation = [self expectationWithDescription:@"Enhanced Move To Hue command"]; CHIPDevice * device = GetPairedDevice(kDeviceId); dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPTestWindowCovering * cluster = [[CHIPTestWindowCovering alloc] initWithDevice:device endpoint:1 queue:queue]; + CHIPTestColorControl * cluster = [[CHIPTestColorControl alloc] initWithDevice:device endpoint:1 queue:queue]; XCTAssertNotNil(cluster); - [cluster readAttributeConfigStatusWithResponseHandler:^(NSError * err, NSDictionary * values) { - NSLog(@"read the RO mandatory attribute default: ConfigStatus Error: %@", err); - - XCTAssertEqual(err.code, 0); + uint16_t enhancedHueArgument = 1025U; + uint8_t directionArgument = 0; + uint16_t transitionTimeArgument = 1U; + uint8_t optionsMaskArgument = 0; + uint8_t optionsOverrideArgument = 0; + [cluster enhancedMoveToHue:enhancedHueArgument + direction:directionArgument + transitionTime:transitionTimeArgument + optionsMask:optionsMaskArgument + optionsOverride:optionsOverrideArgument + responseHandler:^(NSError * err, NSDictionary * values) { + NSLog(@"Enhanced Move To Hue command Error: %@", err); - XCTAssertEqual([values[@"value"] unsignedCharValue], 3); + XCTAssertEqual(err.code, 0); - [expectation fulfill]; - }]; + [expectation fulfill]; + }]; [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; } -- (void)testSendClusterTest_TC_WNCV_2_1_000003_ReadAttribute +- (void)testSendClusterTest_TC_CC_7_1_000003_ReadAttribute { - XCTestExpectation * expectation = [self expectationWithDescription:@"reads back the RO mandatory attribute: ConfigStatus"]; + XCTestExpectation * expectation = + [self expectationWithDescription:@"Check Remaining time attribute value matched the value sent by the last command"]; CHIPDevice * device = GetPairedDevice(kDeviceId); dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPTestWindowCovering * cluster = [[CHIPTestWindowCovering alloc] initWithDevice:device endpoint:1 queue:queue]; + CHIPTestColorControl * cluster = [[CHIPTestColorControl alloc] initWithDevice:device endpoint:1 queue:queue]; XCTAssertNotNil(cluster); - [cluster readAttributeConfigStatusWithResponseHandler:^(NSError * err, NSDictionary * values) { - NSLog(@"reads back the RO mandatory attribute: ConfigStatus Error: %@", err); + [cluster readAttributeRemainingTimeWithResponseHandler:^(NSError * err, NSDictionary * values) { + NSLog(@"Check Remaining time attribute value matched the value sent by the last command Error: %@", err); XCTAssertEqual(err.code, 0); - XCTAssertEqual([values[@"value"] unsignedCharValue], 3); + XCTAssertEqual([values[@"value"] unsignedShortValue], 1); [expectation fulfill]; }]; [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; } -- (void)testSendClusterTest_TC_WNCV_2_1_000004_ReadAttribute +- (void)testSendClusterTest_TC_CC_7_1_000004_Off { - XCTestExpectation * expectation = - [self expectationWithDescription:@"read the RO mandatory attribute default: OperationalStatus"]; + XCTestExpectation * expectation = [self expectationWithDescription:@"Turn off light that we turned on"]; CHIPDevice * device = GetPairedDevice(kDeviceId); dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPTestWindowCovering * cluster = [[CHIPTestWindowCovering alloc] initWithDevice:device endpoint:1 queue:queue]; + CHIPTestOnOff * cluster = [[CHIPTestOnOff alloc] initWithDevice:device endpoint:1 queue:queue]; XCTAssertNotNil(cluster); - [cluster readAttributeOperationalStatusWithResponseHandler:^(NSError * err, NSDictionary * values) { - NSLog(@"read the RO mandatory attribute default: OperationalStatus Error: %@", err); + [cluster off:^(NSError * err, NSDictionary * values) { + NSLog(@"Turn off light that we turned on Error: %@", err); XCTAssertEqual(err.code, 0); - XCTAssertEqual([values[@"value"] unsignedCharValue], 0); - [expectation fulfill]; }]; [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; } -- (void)testSendClusterTest_TC_WNCV_2_1_000005_ReadAttribute +- (void)testSendClusterTest_TC_CC_7_1_000005_ReadAttribute { - XCTestExpectation * expectation = [self expectationWithDescription:@"reads back the RO mandatory attribute: OperationalStatus"]; + XCTestExpectation * expectation = [self expectationWithDescription:@"Check on/off attribute value is false after off command"]; CHIPDevice * device = GetPairedDevice(kDeviceId); dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPTestWindowCovering * cluster = [[CHIPTestWindowCovering alloc] initWithDevice:device endpoint:1 queue:queue]; + CHIPTestOnOff * cluster = [[CHIPTestOnOff alloc] initWithDevice:device endpoint:1 queue:queue]; XCTAssertNotNil(cluster); - [cluster readAttributeOperationalStatusWithResponseHandler:^(NSError * err, NSDictionary * values) { - NSLog(@"reads back the RO mandatory attribute: OperationalStatus Error: %@", err); + [cluster readAttributeOnOffWithResponseHandler:^(NSError * err, NSDictionary * values) { + NSLog(@"Check on/off attribute value is false after off command Error: %@", err); XCTAssertEqual(err.code, 0); - XCTAssertEqual([values[@"value"] unsignedCharValue], 0); + XCTAssertEqual([values[@"value"] boolValue], 0); [expectation fulfill]; }]; [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; } -- (void)testSendClusterTest_TC_WNCV_2_1_000006_ReadAttribute + +- (void)testSendClusterTest_TC_CC_7_2_000000_On { - XCTestExpectation * expectation = [self expectationWithDescription:@"read the RO mandatory attribute default: EndProductType"]; + XCTestExpectation * expectation = [self expectationWithDescription:@"Turn on light for color control tests"]; CHIPDevice * device = GetPairedDevice(kDeviceId); dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPTestWindowCovering * cluster = [[CHIPTestWindowCovering alloc] initWithDevice:device endpoint:1 queue:queue]; + CHIPTestOnOff * cluster = [[CHIPTestOnOff alloc] initWithDevice:device endpoint:1 queue:queue]; XCTAssertNotNil(cluster); - [cluster readAttributeEndProductTypeWithResponseHandler:^(NSError * err, NSDictionary * values) { - NSLog(@"read the RO mandatory attribute default: EndProductType Error: %@", err); + [cluster on:^(NSError * err, NSDictionary * values) { + NSLog(@"Turn on light for color control tests Error: %@", err); XCTAssertEqual(err.code, 0); - XCTAssertEqual([values[@"value"] unsignedCharValue], 0); - [expectation fulfill]; }]; [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; } -- (void)testSendClusterTest_TC_WNCV_2_1_000007_ReadAttribute +- (void)testSendClusterTest_TC_CC_7_2_000001_ReadAttribute { - XCTestExpectation * expectation = [self expectationWithDescription:@"reads back the RO mandatory attribute: EndProductType"]; + XCTestExpectation * expectation = [self expectationWithDescription:@"Check on/off attribute value is true after on command"]; CHIPDevice * device = GetPairedDevice(kDeviceId); dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPTestWindowCovering * cluster = [[CHIPTestWindowCovering alloc] initWithDevice:device endpoint:1 queue:queue]; + CHIPTestOnOff * cluster = [[CHIPTestOnOff alloc] initWithDevice:device endpoint:1 queue:queue]; XCTAssertNotNil(cluster); - [cluster readAttributeEndProductTypeWithResponseHandler:^(NSError * err, NSDictionary * values) { - NSLog(@"reads back the RO mandatory attribute: EndProductType Error: %@", err); + [cluster readAttributeOnOffWithResponseHandler:^(NSError * err, NSDictionary * values) { + NSLog(@"Check on/off attribute value is true after on command Error: %@", err); XCTAssertEqual(err.code, 0); - XCTAssertEqual([values[@"value"] unsignedCharValue], 0); + XCTAssertEqual([values[@"value"] boolValue], 1); [expectation fulfill]; }]; [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; } -- (void)testSendClusterTest_TC_WNCV_2_1_000008_ReadAttribute +- (void)testSendClusterTest_TC_CC_7_2_000002_EnhancedMoveHue { - XCTestExpectation * expectation = [self expectationWithDescription:@"read the RW mandatory attribute default: Mode"]; + XCTestExpectation * expectation = [self expectationWithDescription:@"Enhanced Move Hue Down command "]; CHIPDevice * device = GetPairedDevice(kDeviceId); dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPTestWindowCovering * cluster = [[CHIPTestWindowCovering alloc] initWithDevice:device endpoint:1 queue:queue]; + CHIPTestColorControl * cluster = [[CHIPTestColorControl alloc] initWithDevice:device endpoint:1 queue:queue]; XCTAssertNotNil(cluster); - [cluster readAttributeModeWithResponseHandler:^(NSError * err, NSDictionary * values) { - NSLog(@"read the RW mandatory attribute default: Mode Error: %@", err); - - XCTAssertEqual(err.code, 0); + uint8_t moveModeArgument = 3; + uint16_t rateArgument = 5U; + uint8_t optionsMaskArgument = 0; + uint8_t optionsOverrideArgument = 0; + [cluster enhancedMoveHue:moveModeArgument + rate:rateArgument + optionsMask:optionsMaskArgument + optionsOverride:optionsOverrideArgument + responseHandler:^(NSError * err, NSDictionary * values) { + NSLog(@"Enhanced Move Hue Down command Error: %@", err); - XCTAssertEqual([values[@"value"] unsignedCharValue], 0); + XCTAssertEqual(err.code, 0); - [expectation fulfill]; - }]; + [expectation fulfill]; + }]; [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; } -- (void)testSendClusterTest_TC_WNCV_2_1_000009_WriteAttribute +- (void)testSendClusterTest_TC_CC_7_2_000003_EnhancedMoveHue { - XCTestExpectation * expectation = [self expectationWithDescription:@"write a value into the RW mandatory attribute:: Mode"]; + XCTestExpectation * expectation = [self expectationWithDescription:@"Enhanced Move Hue Stop command"]; CHIPDevice * device = GetPairedDevice(kDeviceId); dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPTestWindowCovering * cluster = [[CHIPTestWindowCovering alloc] initWithDevice:device endpoint:1 queue:queue]; + CHIPTestColorControl * cluster = [[CHIPTestColorControl alloc] initWithDevice:device endpoint:1 queue:queue]; XCTAssertNotNil(cluster); - uint8_t modeArgument = 7; - [cluster writeAttributeModeWithValue:modeArgument - responseHandler:^(NSError * err, NSDictionary * values) { - NSLog(@"write a value into the RW mandatory attribute:: Mode Error: %@", err); + uint8_t moveModeArgument = 0; + uint16_t rateArgument = 0U; + uint8_t optionsMaskArgument = 0; + uint8_t optionsOverrideArgument = 0; + [cluster enhancedMoveHue:moveModeArgument + rate:rateArgument + optionsMask:optionsMaskArgument + optionsOverride:optionsOverrideArgument + responseHandler:^(NSError * err, NSDictionary * values) { + NSLog(@"Enhanced Move Hue Stop command Error: %@", err); - XCTAssertEqual(err.code, 0); + XCTAssertEqual(err.code, 0); - [expectation fulfill]; - }]; + [expectation fulfill]; + }]; [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; } -- (void)testSendClusterTest_TC_WNCV_2_1_000010_ReadAttribute +- (void)testSendClusterTest_TC_CC_7_2_000004_EnhancedMoveHue { - XCTestExpectation * expectation = [self expectationWithDescription:@"reads back the RW mandatory attribute: Mode"]; + XCTestExpectation * expectation = [self expectationWithDescription:@"Enhanced Move Hue Up command"]; CHIPDevice * device = GetPairedDevice(kDeviceId); dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPTestWindowCovering * cluster = [[CHIPTestWindowCovering alloc] initWithDevice:device endpoint:1 queue:queue]; + CHIPTestColorControl * cluster = [[CHIPTestColorControl alloc] initWithDevice:device endpoint:1 queue:queue]; XCTAssertNotNil(cluster); - [cluster readAttributeModeWithResponseHandler:^(NSError * err, NSDictionary * values) { - NSLog(@"reads back the RW mandatory attribute: Mode Error: %@", err); - - XCTAssertEqual(err.code, 0); + uint8_t moveModeArgument = 1; + uint16_t rateArgument = 50U; + uint8_t optionsMaskArgument = 0; + uint8_t optionsOverrideArgument = 0; + [cluster enhancedMoveHue:moveModeArgument + rate:rateArgument + optionsMask:optionsMaskArgument + optionsOverride:optionsOverrideArgument + responseHandler:^(NSError * err, NSDictionary * values) { + NSLog(@"Enhanced Move Hue Up command Error: %@", err); - XCTAssertEqual([values[@"value"] unsignedCharValue], 7); + XCTAssertEqual(err.code, 0); - [expectation fulfill]; - }]; + [expectation fulfill]; + }]; [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; } - -- (void)testSendClusterTest_TC_WNCV_3_1_000000_DownOrClose +- (void)testSendClusterTest_TC_CC_7_2_000005_EnhancedMoveHue { - XCTestExpectation * expectation = [self expectationWithDescription:@"1a: TH adjusts the the DUT to a non-open position"]; + XCTestExpectation * expectation = [self expectationWithDescription:@"Enhanced Move Hue Stop command"]; CHIPDevice * device = GetPairedDevice(kDeviceId); dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPTestWindowCovering * cluster = [[CHIPTestWindowCovering alloc] initWithDevice:device endpoint:1 queue:queue]; + CHIPTestColorControl * cluster = [[CHIPTestColorControl alloc] initWithDevice:device endpoint:1 queue:queue]; XCTAssertNotNil(cluster); - [cluster downOrClose:^(NSError * err, NSDictionary * values) { - NSLog(@"1a: TH adjusts the the DUT to a non-open position Error: %@", err); + uint8_t moveModeArgument = 0; + uint16_t rateArgument = 0U; + uint8_t optionsMaskArgument = 0; + uint8_t optionsOverrideArgument = 0; + [cluster enhancedMoveHue:moveModeArgument + rate:rateArgument + optionsMask:optionsMaskArgument + optionsOverride:optionsOverrideArgument + responseHandler:^(NSError * err, NSDictionary * values) { + NSLog(@"Enhanced Move Hue Stop command Error: %@", err); - XCTAssertEqual(err.code, 0); + XCTAssertEqual(err.code, 0); - [expectation fulfill]; - }]; + [expectation fulfill]; + }]; [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; } -- (void)testSendClusterTest_TC_WNCV_3_1_000001_UpOrOpen +- (void)testSendClusterTest_TC_CC_7_2_000006_Off { - XCTestExpectation * expectation = [self expectationWithDescription:@"2a: TH sends UpOrOpen command to DUT"]; + XCTestExpectation * expectation = [self expectationWithDescription:@"Turn off light that we turned on"]; CHIPDevice * device = GetPairedDevice(kDeviceId); dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPTestWindowCovering * cluster = [[CHIPTestWindowCovering alloc] initWithDevice:device endpoint:1 queue:queue]; + CHIPTestOnOff * cluster = [[CHIPTestOnOff alloc] initWithDevice:device endpoint:1 queue:queue]; XCTAssertNotNil(cluster); - [cluster upOrOpen:^(NSError * err, NSDictionary * values) { - NSLog(@"2a: TH sends UpOrOpen command to DUT Error: %@", err); + [cluster off:^(NSError * err, NSDictionary * values) { + NSLog(@"Turn off light that we turned on Error: %@", err); XCTAssertEqual(err.code, 0); @@ -6094,21 +7642,21 @@ - (void)testSendClusterTest_TC_WNCV_3_1_000001_UpOrOpen [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; } -- (void)testSendClusterTest_TC_WNCV_3_1_000002_ReadAttribute +- (void)testSendClusterTest_TC_CC_7_2_000007_ReadAttribute { - XCTestExpectation * expectation = [self expectationWithDescription:@"3a: TH reads OperationalStatus attribute from DUT"]; + XCTestExpectation * expectation = [self expectationWithDescription:@"Check on/off attribute value is false after off command"]; CHIPDevice * device = GetPairedDevice(kDeviceId); dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPTestWindowCovering * cluster = [[CHIPTestWindowCovering alloc] initWithDevice:device endpoint:1 queue:queue]; + CHIPTestOnOff * cluster = [[CHIPTestOnOff alloc] initWithDevice:device endpoint:1 queue:queue]; XCTAssertNotNil(cluster); - [cluster readAttributeOperationalStatusWithResponseHandler:^(NSError * err, NSDictionary * values) { - NSLog(@"3a: TH reads OperationalStatus attribute from DUT Error: %@", err); + [cluster readAttributeOnOffWithResponseHandler:^(NSError * err, NSDictionary * values) { + NSLog(@"Check on/off attribute value is false after off command Error: %@", err); XCTAssertEqual(err.code, 0); - XCTAssertEqual([values[@"value"] unsignedCharValue], 0); + XCTAssertEqual([values[@"value"] boolValue], 0); [expectation fulfill]; }]; @@ -6116,17 +7664,17 @@ - (void)testSendClusterTest_TC_WNCV_3_1_000002_ReadAttribute [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; } -- (void)testSendClusterTest_TC_WNCV_3_2_000000_UpOrOpen +- (void)testSendClusterTest_TC_CC_7_3_000000_On { - XCTestExpectation * expectation = [self expectationWithDescription:@"1a: TH adjusts the the DUT to a non-closed position"]; + XCTestExpectation * expectation = [self expectationWithDescription:@"Turn on light for color control tests"]; CHIPDevice * device = GetPairedDevice(kDeviceId); dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPTestWindowCovering * cluster = [[CHIPTestWindowCovering alloc] initWithDevice:device endpoint:1 queue:queue]; + CHIPTestOnOff * cluster = [[CHIPTestOnOff alloc] initWithDevice:device endpoint:1 queue:queue]; XCTAssertNotNil(cluster); - [cluster upOrOpen:^(NSError * err, NSDictionary * values) { - NSLog(@"1a: TH adjusts the the DUT to a non-closed position Error: %@", err); + [cluster on:^(NSError * err, NSDictionary * values) { + NSLog(@"Turn on light for color control tests Error: %@", err); XCTAssertEqual(err.code, 0); @@ -6135,77 +7683,96 @@ - (void)testSendClusterTest_TC_WNCV_3_2_000000_UpOrOpen [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; } -- (void)testSendClusterTest_TC_WNCV_3_2_000001_DownOrClose +- (void)testSendClusterTest_TC_CC_7_3_000001_ReadAttribute { - XCTestExpectation * expectation = [self expectationWithDescription:@"2a: TH sends DownOrClose command to DUT"]; + XCTestExpectation * expectation = [self expectationWithDescription:@"Check on/off attribute value is true after on command"]; CHIPDevice * device = GetPairedDevice(kDeviceId); dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPTestWindowCovering * cluster = [[CHIPTestWindowCovering alloc] initWithDevice:device endpoint:1 queue:queue]; + CHIPTestOnOff * cluster = [[CHIPTestOnOff alloc] initWithDevice:device endpoint:1 queue:queue]; XCTAssertNotNil(cluster); - [cluster downOrClose:^(NSError * err, NSDictionary * values) { - NSLog(@"2a: TH sends DownOrClose command to DUT Error: %@", err); + [cluster readAttributeOnOffWithResponseHandler:^(NSError * err, NSDictionary * values) { + NSLog(@"Check on/off attribute value is true after on command Error: %@", err); XCTAssertEqual(err.code, 0); + XCTAssertEqual([values[@"value"] boolValue], 1); + [expectation fulfill]; }]; [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; } -- (void)testSendClusterTest_TC_WNCV_3_2_000002_ReadAttribute +- (void)testSendClusterTest_TC_CC_7_3_000002_EnhancedStepHue { - XCTestExpectation * expectation = [self expectationWithDescription:@"3a: TH reads OperationalStatus attribute from DUT"]; + XCTestExpectation * expectation = [self expectationWithDescription:@"Enhanced Step Hue Up command"]; CHIPDevice * device = GetPairedDevice(kDeviceId); dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPTestWindowCovering * cluster = [[CHIPTestWindowCovering alloc] initWithDevice:device endpoint:1 queue:queue]; + CHIPTestColorControl * cluster = [[CHIPTestColorControl alloc] initWithDevice:device endpoint:1 queue:queue]; XCTAssertNotNil(cluster); - [cluster readAttributeOperationalStatusWithResponseHandler:^(NSError * err, NSDictionary * values) { - NSLog(@"3a: TH reads OperationalStatus attribute from DUT Error: %@", err); - - XCTAssertEqual(err.code, 0); + uint8_t stepModeArgument = 0; + uint16_t stepSizeArgument = 50U; + uint16_t transitionTimeArgument = 1U; + uint8_t optionsMaskArgument = 0; + uint8_t optionsOverrideArgument = 0; + [cluster enhancedStepHue:stepModeArgument + stepSize:stepSizeArgument + transitionTime:transitionTimeArgument + optionsMask:optionsMaskArgument + optionsOverride:optionsOverrideArgument + responseHandler:^(NSError * err, NSDictionary * values) { + NSLog(@"Enhanced Step Hue Up command Error: %@", err); - XCTAssertEqual([values[@"value"] unsignedCharValue], 0); + XCTAssertEqual(err.code, 0); - [expectation fulfill]; - }]; + [expectation fulfill]; + }]; [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; } - -- (void)testSendClusterTest_TC_WNCV_3_3_000000_UpOrOpen +- (void)testSendClusterTest_TC_CC_7_3_000003_EnhancedStepHue { - XCTestExpectation * expectation = [self expectationWithDescription:@"1a: TH adjusts the the DUT to a non-open position"]; + XCTestExpectation * expectation = [self expectationWithDescription:@"Enhanced Step Hue Down command"]; CHIPDevice * device = GetPairedDevice(kDeviceId); dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPTestWindowCovering * cluster = [[CHIPTestWindowCovering alloc] initWithDevice:device endpoint:1 queue:queue]; + CHIPTestColorControl * cluster = [[CHIPTestColorControl alloc] initWithDevice:device endpoint:1 queue:queue]; XCTAssertNotNil(cluster); - [cluster upOrOpen:^(NSError * err, NSDictionary * values) { - NSLog(@"1a: TH adjusts the the DUT to a non-open position Error: %@", err); + uint8_t stepModeArgument = 1; + uint16_t stepSizeArgument = 75U; + uint16_t transitionTimeArgument = 1U; + uint8_t optionsMaskArgument = 0; + uint8_t optionsOverrideArgument = 0; + [cluster enhancedStepHue:stepModeArgument + stepSize:stepSizeArgument + transitionTime:transitionTimeArgument + optionsMask:optionsMaskArgument + optionsOverride:optionsOverrideArgument + responseHandler:^(NSError * err, NSDictionary * values) { + NSLog(@"Enhanced Step Hue Down command Error: %@", err); - XCTAssertEqual(err.code, 0); + XCTAssertEqual(err.code, 0); - [expectation fulfill]; - }]; + [expectation fulfill]; + }]; [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; } -- (void)testSendClusterTest_TC_WNCV_3_3_000001_StopMotion +- (void)testSendClusterTest_TC_CC_7_3_000004_Off { - XCTestExpectation * expectation = [self expectationWithDescription:@"2a: TH sends StopMotion command to DUT"]; + XCTestExpectation * expectation = [self expectationWithDescription:@"Turn off light that we turned on"]; CHIPDevice * device = GetPairedDevice(kDeviceId); dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPTestWindowCovering * cluster = [[CHIPTestWindowCovering alloc] initWithDevice:device endpoint:1 queue:queue]; + CHIPTestOnOff * cluster = [[CHIPTestOnOff alloc] initWithDevice:device endpoint:1 queue:queue]; XCTAssertNotNil(cluster); - [cluster stopMotion:^(NSError * err, NSDictionary * values) { - NSLog(@"2a: TH sends StopMotion command to DUT Error: %@", err); + [cluster off:^(NSError * err, NSDictionary * values) { + NSLog(@"Turn off light that we turned on Error: %@", err); XCTAssertEqual(err.code, 0); @@ -6214,21 +7781,21 @@ - (void)testSendClusterTest_TC_WNCV_3_3_000001_StopMotion [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; } -- (void)testSendClusterTest_TC_WNCV_3_3_000002_ReadAttribute +- (void)testSendClusterTest_TC_CC_7_3_000005_ReadAttribute { - XCTestExpectation * expectation = [self expectationWithDescription:@"2b: TH reads OperationalStatus attribute from DUT"]; + XCTestExpectation * expectation = [self expectationWithDescription:@"Check on/off attribute value is false after off command"]; CHIPDevice * device = GetPairedDevice(kDeviceId); dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPTestWindowCovering * cluster = [[CHIPTestWindowCovering alloc] initWithDevice:device endpoint:1 queue:queue]; + CHIPTestOnOff * cluster = [[CHIPTestOnOff alloc] initWithDevice:device endpoint:1 queue:queue]; XCTAssertNotNil(cluster); - [cluster readAttributeOperationalStatusWithResponseHandler:^(NSError * err, NSDictionary * values) { - NSLog(@"2b: TH reads OperationalStatus attribute from DUT Error: %@", err); + [cluster readAttributeOnOffWithResponseHandler:^(NSError * err, NSDictionary * values) { + NSLog(@"Check on/off attribute value is false after off command Error: %@", err); XCTAssertEqual(err.code, 0); - XCTAssertEqual([values[@"value"] unsignedCharValue], 0); + XCTAssertEqual([values[@"value"] boolValue], 0); [expectation fulfill]; }]; @@ -6236,488 +7803,491 @@ - (void)testSendClusterTest_TC_WNCV_3_3_000002_ReadAttribute [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; } -- (void)testSendClusterTest_TC_BI_1_1_000000_ReadAttribute +- (void)testSendClusterTest_TC_CC_7_4_000000_On { - XCTestExpectation * expectation = [self expectationWithDescription:@"read the global attribute: ClusterRevision"]; + XCTestExpectation * expectation = [self expectationWithDescription:@"Turn on light for color control tests"]; CHIPDevice * device = GetPairedDevice(kDeviceId); dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPTestBinaryInputBasic * cluster = [[CHIPTestBinaryInputBasic alloc] initWithDevice:device endpoint:1 queue:queue]; + CHIPTestOnOff * cluster = [[CHIPTestOnOff alloc] initWithDevice:device endpoint:1 queue:queue]; XCTAssertNotNil(cluster); - [cluster readAttributeClusterRevisionWithResponseHandler:^(NSError * err, NSDictionary * values) { - NSLog(@"read the global attribute: ClusterRevision Error: %@", err); + [cluster on:^(NSError * err, NSDictionary * values) { + NSLog(@"Turn on light for color control tests Error: %@", err); XCTAssertEqual(err.code, 0); - XCTAssertEqual([values[@"value"] unsignedShortValue], 1); - [expectation fulfill]; }]; [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; } -- (void)testSendClusterTest_TC_BI_1_1_000001_WriteAttribute +- (void)testSendClusterTest_TC_CC_7_4_000001_ReadAttribute { - XCTestExpectation * expectation = - [self expectationWithDescription:@"write the default values to mandatory global attribute: ClusterRevision"]; + XCTestExpectation * expectation = [self expectationWithDescription:@"Check on/off attribute value is true after on command"]; CHIPDevice * device = GetPairedDevice(kDeviceId); dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPTestBinaryInputBasic * cluster = [[CHIPTestBinaryInputBasic alloc] initWithDevice:device endpoint:1 queue:queue]; + CHIPTestOnOff * cluster = [[CHIPTestOnOff alloc] initWithDevice:device endpoint:1 queue:queue]; XCTAssertNotNil(cluster); - uint16_t clusterRevisionArgument = 1U; - [cluster - writeAttributeClusterRevisionWithValue:clusterRevisionArgument - responseHandler:^(NSError * err, NSDictionary * values) { - NSLog(@"write the default values to mandatory global attribute: ClusterRevision Error: %@", err); + [cluster readAttributeOnOffWithResponseHandler:^(NSError * err, NSDictionary * values) { + NSLog(@"Check on/off attribute value is true after on command Error: %@", err); - XCTAssertEqual(err.code, 1); - [expectation fulfill]; - }]; + XCTAssertEqual(err.code, 0); + + XCTAssertEqual([values[@"value"] boolValue], 1); + + [expectation fulfill]; + }]; [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; } -- (void)testSendClusterTest_TC_BI_1_1_000002_ReadAttribute +- (void)testSendClusterTest_TC_CC_7_4_000002_EnhancedMoveToHueAndSaturation { - XCTestExpectation * expectation = [self expectationWithDescription:@"reads back global attribute: ClusterRevision"]; + XCTestExpectation * expectation = [self expectationWithDescription:@"Enhanced move to hue and saturation command"]; CHIPDevice * device = GetPairedDevice(kDeviceId); dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPTestBinaryInputBasic * cluster = [[CHIPTestBinaryInputBasic alloc] initWithDevice:device endpoint:1 queue:queue]; + CHIPTestColorControl * cluster = [[CHIPTestColorControl alloc] initWithDevice:device endpoint:1 queue:queue]; XCTAssertNotNil(cluster); - [cluster readAttributeClusterRevisionWithResponseHandler:^(NSError * err, NSDictionary * values) { - NSLog(@"reads back global attribute: ClusterRevision Error: %@", err); - - XCTAssertEqual(err.code, 0); + uint16_t enhancedHueArgument = 1200U; + uint8_t saturationArgument = 90; + uint16_t transitionTimeArgument = 10U; + uint8_t optionsMaskArgument = 0; + uint8_t optionsOverrideArgument = 0; + [cluster enhancedMoveToHueAndSaturation:enhancedHueArgument + saturation:saturationArgument + transitionTime:transitionTimeArgument + optionsMask:optionsMaskArgument + optionsOverride:optionsOverrideArgument + responseHandler:^(NSError * err, NSDictionary * values) { + NSLog(@"Enhanced move to hue and saturation command Error: %@", err); - XCTAssertEqual([values[@"value"] unsignedShortValue], 1); + XCTAssertEqual(err.code, 0); - [expectation fulfill]; - }]; + [expectation fulfill]; + }]; [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; } - -- (void)testSendClusterTest_TC_FLW_1_1_000000_WriteAttribute +- (void)testSendClusterTest_TC_CC_7_4_000003_Off { - XCTestExpectation * expectation = - [self expectationWithDescription:@"write the default values to mandatory global attribute: ClusterRevision"]; + XCTestExpectation * expectation = [self expectationWithDescription:@"Turn off light that we turned on"]; CHIPDevice * device = GetPairedDevice(kDeviceId); dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPTestFlowMeasurement * cluster = [[CHIPTestFlowMeasurement alloc] initWithDevice:device endpoint:1 queue:queue]; + CHIPTestOnOff * cluster = [[CHIPTestOnOff alloc] initWithDevice:device endpoint:1 queue:queue]; XCTAssertNotNil(cluster); - uint16_t clusterRevisionArgument = 2U; - [cluster - writeAttributeClusterRevisionWithValue:clusterRevisionArgument - responseHandler:^(NSError * err, NSDictionary * values) { - NSLog(@"write the default values to mandatory global attribute: ClusterRevision Error: %@", err); + [cluster off:^(NSError * err, NSDictionary * values) { + NSLog(@"Turn off light that we turned on Error: %@", err); - XCTAssertEqual(err.code, 1); - [expectation fulfill]; - }]; + XCTAssertEqual(err.code, 0); + + [expectation fulfill]; + }]; [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; } - -- (void)testSendClusterTest_TC_TM_1_1_000000_ReadAttribute +- (void)testSendClusterTest_TC_CC_7_4_000004_ReadAttribute { - XCTestExpectation * expectation = [self expectationWithDescription:@"read the global attribute: ClusterRevision"]; + XCTestExpectation * expectation = [self expectationWithDescription:@"Check on/off attribute value is false after off command"]; CHIPDevice * device = GetPairedDevice(kDeviceId); dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPTestTemperatureMeasurement * cluster = [[CHIPTestTemperatureMeasurement alloc] initWithDevice:device - endpoint:1 - queue:queue]; + CHIPTestOnOff * cluster = [[CHIPTestOnOff alloc] initWithDevice:device endpoint:1 queue:queue]; XCTAssertNotNil(cluster); - [cluster readAttributeClusterRevisionWithResponseHandler:^(NSError * err, NSDictionary * values) { - NSLog(@"read the global attribute: ClusterRevision Error: %@", err); + [cluster readAttributeOnOffWithResponseHandler:^(NSError * err, NSDictionary * values) { + NSLog(@"Check on/off attribute value is false after off command Error: %@", err); XCTAssertEqual(err.code, 0); - XCTAssertEqual([values[@"value"] unsignedShortValue], 3); + XCTAssertEqual([values[@"value"] boolValue], 0); [expectation fulfill]; }]; [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; } -- (void)testSendClusterTest_TC_TM_1_1_000001_WriteAttribute + +- (void)testSendClusterTest_TC_CC_8_1_000000_On { - XCTestExpectation * expectation = - [self expectationWithDescription:@"write the default values to mandatory global attribute: ClusterRevision"]; + XCTestExpectation * expectation = [self expectationWithDescription:@"Turn on light for color control tests"]; CHIPDevice * device = GetPairedDevice(kDeviceId); dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPTestTemperatureMeasurement * cluster = [[CHIPTestTemperatureMeasurement alloc] initWithDevice:device - endpoint:1 - queue:queue]; + CHIPTestOnOff * cluster = [[CHIPTestOnOff alloc] initWithDevice:device endpoint:1 queue:queue]; XCTAssertNotNil(cluster); - uint16_t clusterRevisionArgument = 3U; - [cluster - writeAttributeClusterRevisionWithValue:clusterRevisionArgument - responseHandler:^(NSError * err, NSDictionary * values) { - NSLog(@"write the default values to mandatory global attribute: ClusterRevision Error: %@", err); + [cluster on:^(NSError * err, NSDictionary * values) { + NSLog(@"Turn on light for color control tests Error: %@", err); - XCTAssertEqual(err.code, 1); - [expectation fulfill]; - }]; + XCTAssertEqual(err.code, 0); + + [expectation fulfill]; + }]; [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; } -- (void)testSendClusterTest_TC_TM_1_1_000002_ReadAttribute +- (void)testSendClusterTest_TC_CC_8_1_000001_ReadAttribute { - XCTestExpectation * expectation = [self expectationWithDescription:@"reads back global attribute: ClusterRevision"]; + XCTestExpectation * expectation = [self expectationWithDescription:@"Check on/off attribute value is true after on command"]; CHIPDevice * device = GetPairedDevice(kDeviceId); dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPTestTemperatureMeasurement * cluster = [[CHIPTestTemperatureMeasurement alloc] initWithDevice:device - endpoint:1 - queue:queue]; + CHIPTestOnOff * cluster = [[CHIPTestOnOff alloc] initWithDevice:device endpoint:1 queue:queue]; XCTAssertNotNil(cluster); - [cluster readAttributeClusterRevisionWithResponseHandler:^(NSError * err, NSDictionary * values) { - NSLog(@"reads back global attribute: ClusterRevision Error: %@", err); + [cluster readAttributeOnOffWithResponseHandler:^(NSError * err, NSDictionary * values) { + NSLog(@"Check on/off attribute value is true after on command Error: %@", err); XCTAssertEqual(err.code, 0); - XCTAssertEqual([values[@"value"] unsignedShortValue], 3); + XCTAssertEqual([values[@"value"] boolValue], 1); [expectation fulfill]; }]; [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; } - -- (void)testSendClusterTest_TC_OCC_1_1_000000_ReadAttribute +- (void)testSendClusterTest_TC_CC_8_1_000002_ColorLoopSet { - XCTestExpectation * expectation = [self expectationWithDescription:@"read the global attribute: ClusterRevision"]; + XCTestExpectation * expectation = [self expectationWithDescription:@"Color Loop Set Command - Set all Attributs"]; CHIPDevice * device = GetPairedDevice(kDeviceId); dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPTestOccupancySensing * cluster = [[CHIPTestOccupancySensing alloc] initWithDevice:device endpoint:1 queue:queue]; + CHIPTestColorControl * cluster = [[CHIPTestColorControl alloc] initWithDevice:device endpoint:1 queue:queue]; XCTAssertNotNil(cluster); - [cluster readAttributeClusterRevisionWithResponseHandler:^(NSError * err, NSDictionary * values) { - NSLog(@"read the global attribute: ClusterRevision Error: %@", err); - - XCTAssertEqual(err.code, 0); + uint8_t updateFlagsArgument = 14; + uint8_t actionArgument = 0; + uint8_t directionArgument = 1; + uint16_t timeArgument = 100U; + uint16_t startHueArgument = 500U; + uint8_t optionsMaskArgument = 0; + uint8_t optionsOverrideArgument = 0; + [cluster colorLoopSet:updateFlagsArgument + action:actionArgument + direction:directionArgument + time:timeArgument + startHue:startHueArgument + optionsMask:optionsMaskArgument + optionsOverride:optionsOverrideArgument + responseHandler:^(NSError * err, NSDictionary * values) { + NSLog(@"Color Loop Set Command - Set all Attributs Error: %@", err); - XCTAssertEqual([values[@"value"] unsignedShortValue], 2); + XCTAssertEqual(err.code, 0); - [expectation fulfill]; - }]; + [expectation fulfill]; + }]; [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; } -- (void)testSendClusterTest_TC_OCC_1_1_000001_WriteAttribute +- (void)testSendClusterTest_TC_CC_8_1_000003_ReadAttribute { - XCTestExpectation * expectation = - [self expectationWithDescription:@"write the default values to mandatory global attribute: ClusterRevision"]; + XCTestExpectation * expectation = [self expectationWithDescription:@"Check ColorLoopDirection Value"]; CHIPDevice * device = GetPairedDevice(kDeviceId); dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPTestOccupancySensing * cluster = [[CHIPTestOccupancySensing alloc] initWithDevice:device endpoint:1 queue:queue]; + CHIPTestColorControl * cluster = [[CHIPTestColorControl alloc] initWithDevice:device endpoint:1 queue:queue]; XCTAssertNotNil(cluster); - uint16_t clusterRevisionArgument = 2U; - [cluster - writeAttributeClusterRevisionWithValue:clusterRevisionArgument - responseHandler:^(NSError * err, NSDictionary * values) { - NSLog(@"write the default values to mandatory global attribute: ClusterRevision Error: %@", err); + [cluster readAttributeColorLoopDirectionWithResponseHandler:^(NSError * err, NSDictionary * values) { + NSLog(@"Check ColorLoopDirection Value Error: %@", err); - XCTAssertEqual(err.code, 1); - [expectation fulfill]; - }]; + XCTAssertEqual(err.code, 0); + + XCTAssertEqual([values[@"value"] unsignedCharValue], 1); + + [expectation fulfill]; + }]; [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; } - -- (void)testSendClusterTestOperationalCredentialsCluster_000000_ReadAttribute +- (void)testSendClusterTest_TC_CC_8_1_000004_ReadAttribute { - XCTestExpectation * expectation = [self expectationWithDescription:@"Read number of supported fabrics"]; + XCTestExpectation * expectation = [self expectationWithDescription:@"Check ColorLoopTime Value"]; CHIPDevice * device = GetPairedDevice(kDeviceId); dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPTestOperationalCredentials * cluster = [[CHIPTestOperationalCredentials alloc] initWithDevice:device - endpoint:0 - queue:queue]; + CHIPTestColorControl * cluster = [[CHIPTestColorControl alloc] initWithDevice:device endpoint:1 queue:queue]; XCTAssertNotNil(cluster); - [cluster readAttributeSupportedFabricsWithResponseHandler:^(NSError * err, NSDictionary * values) { - NSLog(@"Read number of supported fabrics Error: %@", err); + [cluster readAttributeColorLoopTimeWithResponseHandler:^(NSError * err, NSDictionary * values) { + NSLog(@"Check ColorLoopTime Value Error: %@", err); XCTAssertEqual(err.code, 0); - XCTAssertGreaterThanOrEqual([values[@"value"] unsignedCharValue], 4); + XCTAssertEqual([values[@"value"] unsignedShortValue], 100); [expectation fulfill]; }]; [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; } -- (void)testSendClusterTestOperationalCredentialsCluster_000001_ReadAttribute +- (void)testSendClusterTest_TC_CC_8_1_000005_ReadAttribute { - XCTestExpectation * expectation = [self expectationWithDescription:@"Read number of commissioned fabrics"]; + XCTestExpectation * expectation = [self expectationWithDescription:@"Check ColorLoopStartEnhancedHue Value"]; CHIPDevice * device = GetPairedDevice(kDeviceId); dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPTestOperationalCredentials * cluster = [[CHIPTestOperationalCredentials alloc] initWithDevice:device - endpoint:0 - queue:queue]; + CHIPTestColorControl * cluster = [[CHIPTestColorControl alloc] initWithDevice:device endpoint:1 queue:queue]; XCTAssertNotNil(cluster); - [cluster readAttributeCommissionedFabricsWithResponseHandler:^(NSError * err, NSDictionary * values) { - NSLog(@"Read number of commissioned fabrics Error: %@", err); + [cluster readAttributeColorLoopStartEnhancedHueWithResponseHandler:^(NSError * err, NSDictionary * values) { + NSLog(@"Check ColorLoopStartEnhancedHue Value Error: %@", err); XCTAssertEqual(err.code, 0); - XCTAssertGreaterThanOrEqual([values[@"value"] unsignedCharValue], 1); + XCTAssertEqual([values[@"value"] unsignedShortValue], 500); [expectation fulfill]; }]; [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; } - -- (void)testSendClusterTest_TC_LVL_1_1_000000_WriteAttribute +- (void)testSendClusterTest_TC_CC_8_1_000006_ReadAttribute { - XCTestExpectation * expectation = - [self expectationWithDescription:@"write the default values to mandatory global attribute: ClusterRevision"]; + XCTestExpectation * expectation = [self expectationWithDescription:@"Check ColorLoopActive Value"]; CHIPDevice * device = GetPairedDevice(kDeviceId); dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPTestLevelControl * cluster = [[CHIPTestLevelControl alloc] initWithDevice:device endpoint:1 queue:queue]; + CHIPTestColorControl * cluster = [[CHIPTestColorControl alloc] initWithDevice:device endpoint:1 queue:queue]; XCTAssertNotNil(cluster); - uint16_t clusterRevisionArgument = 4U; - [cluster - writeAttributeClusterRevisionWithValue:clusterRevisionArgument - responseHandler:^(NSError * err, NSDictionary * values) { - NSLog(@"write the default values to mandatory global attribute: ClusterRevision Error: %@", err); + [cluster readAttributeColorLoopActiveWithResponseHandler:^(NSError * err, NSDictionary * values) { + NSLog(@"Check ColorLoopActive Value Error: %@", err); - XCTAssertEqual(err.code, 1); - [expectation fulfill]; - }]; + XCTAssertEqual(err.code, 0); + + XCTAssertEqual([values[@"value"] unsignedCharValue], 0); + + [expectation fulfill]; + }]; [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; } - -- (void)testSendClusterTest_TC_CC_1_1_000000_WriteAttribute +- (void)testSendClusterTest_TC_CC_8_1_000007_ColorLoopSet { - XCTestExpectation * expectation = - [self expectationWithDescription:@"write the default values to mandatory global attribute: ClusterRevision"]; + XCTestExpectation * expectation = [self expectationWithDescription:@"Color Loop Set Command - Start Color Loop"]; CHIPDevice * device = GetPairedDevice(kDeviceId); dispatch_queue_t queue = dispatch_get_main_queue(); CHIPTestColorControl * cluster = [[CHIPTestColorControl alloc] initWithDevice:device endpoint:1 queue:queue]; XCTAssertNotNil(cluster); - uint16_t clusterRevisionArgument = 4U; - [cluster - writeAttributeClusterRevisionWithValue:clusterRevisionArgument - responseHandler:^(NSError * err, NSDictionary * values) { - NSLog(@"write the default values to mandatory global attribute: ClusterRevision Error: %@", err); + uint8_t updateFlagsArgument = 1; + uint8_t actionArgument = 1; + uint8_t directionArgument = 0; + uint16_t timeArgument = 0U; + uint16_t startHueArgument = 0U; + uint8_t optionsMaskArgument = 0; + uint8_t optionsOverrideArgument = 0; + [cluster colorLoopSet:updateFlagsArgument + action:actionArgument + direction:directionArgument + time:timeArgument + startHue:startHueArgument + optionsMask:optionsMaskArgument + optionsOverride:optionsOverrideArgument + responseHandler:^(NSError * err, NSDictionary * values) { + NSLog(@"Color Loop Set Command - Start Color Loop Error: %@", err); - XCTAssertEqual(err.code, 1); - [expectation fulfill]; - }]; + XCTAssertEqual(err.code, 0); + + [expectation fulfill]; + }]; [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; } - -- (void)testSendClusterTest_TC_RH_1_1_000000_WriteAttribute +- (void)testSendClusterTest_TC_CC_8_1_000008_ReadAttribute { - XCTestExpectation * expectation = - [self expectationWithDescription:@"write the default values to mandatory global attribute: ClusterRevision"]; + XCTestExpectation * expectation = [self expectationWithDescription:@"Check ColorLoopActive Value"]; CHIPDevice * device = GetPairedDevice(kDeviceId); dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPTestRelativeHumidityMeasurement * cluster = [[CHIPTestRelativeHumidityMeasurement alloc] initWithDevice:device - endpoint:1 - queue:queue]; + CHIPTestColorControl * cluster = [[CHIPTestColorControl alloc] initWithDevice:device endpoint:1 queue:queue]; XCTAssertNotNil(cluster); - uint16_t clusterRevisionArgument = 1U; - [cluster - writeAttributeClusterRevisionWithValue:clusterRevisionArgument - responseHandler:^(NSError * err, NSDictionary * values) { - NSLog(@"write the default values to mandatory global attribute: ClusterRevision Error: %@", err); + [cluster readAttributeColorLoopActiveWithResponseHandler:^(NSError * err, NSDictionary * values) { + NSLog(@"Check ColorLoopActive Value Error: %@", err); - XCTAssertEqual(err.code, 1); - [expectation fulfill]; - }]; + XCTAssertEqual(err.code, 0); + + XCTAssertEqual([values[@"value"] unsignedCharValue], 1); + + [expectation fulfill]; + }]; [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; } - -- (void)testSendClusterTest_TC_MC_1_1_000000_WriteAttribute +- (void)testSendClusterTest_TC_CC_8_1_000009_ColorLoopSet { XCTestExpectation * expectation = - [self expectationWithDescription:@"write the default values to mandatory global attribute: ClusterRevision"]; + [self expectationWithDescription:@"Color Loop Set Command - Set direction and time while running"]; CHIPDevice * device = GetPairedDevice(kDeviceId); dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPTestRelativeHumidityMeasurement * cluster = [[CHIPTestRelativeHumidityMeasurement alloc] initWithDevice:device - endpoint:1 - queue:queue]; + CHIPTestColorControl * cluster = [[CHIPTestColorControl alloc] initWithDevice:device endpoint:1 queue:queue]; XCTAssertNotNil(cluster); - uint16_t clusterRevisionArgument = 1U; - [cluster - writeAttributeClusterRevisionWithValue:clusterRevisionArgument - responseHandler:^(NSError * err, NSDictionary * values) { - NSLog(@"write the default values to mandatory global attribute: ClusterRevision Error: %@", err); + uint8_t updateFlagsArgument = 6; + uint8_t actionArgument = 0; + uint8_t directionArgument = 0; + uint16_t timeArgument = 3500U; + uint16_t startHueArgument = 0U; + uint8_t optionsMaskArgument = 0; + uint8_t optionsOverrideArgument = 0; + [cluster colorLoopSet:updateFlagsArgument + action:actionArgument + direction:directionArgument + time:timeArgument + startHue:startHueArgument + optionsMask:optionsMaskArgument + optionsOverride:optionsOverrideArgument + responseHandler:^(NSError * err, NSDictionary * values) { + NSLog(@"Color Loop Set Command - Set direction and time while running Error: %@", err); - XCTAssertEqual(err.code, 1); - [expectation fulfill]; - }]; + XCTAssertEqual(err.code, 0); + + [expectation fulfill]; + }]; [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; } - -- (void)testSendClusterTest_TC_TSTAT_1_1_000000_WriteAttribute +- (void)testSendClusterTest_TC_CC_8_1_000010_ReadAttribute { - XCTestExpectation * expectation = - [self expectationWithDescription:@"write the default values to mandatory global attribute: ClusterRevision"]; + XCTestExpectation * expectation = [self expectationWithDescription:@"Check ColorLoopDirection Value"]; CHIPDevice * device = GetPairedDevice(kDeviceId); dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPTestThermostat * cluster = [[CHIPTestThermostat alloc] initWithDevice:device endpoint:1 queue:queue]; + CHIPTestColorControl * cluster = [[CHIPTestColorControl alloc] initWithDevice:device endpoint:1 queue:queue]; XCTAssertNotNil(cluster); - uint16_t clusterRevisionArgument = 5U; - [cluster - writeAttributeClusterRevisionWithValue:clusterRevisionArgument - responseHandler:^(NSError * err, NSDictionary * values) { - NSLog(@"write the default values to mandatory global attribute: ClusterRevision Error: %@", err); + [cluster readAttributeColorLoopDirectionWithResponseHandler:^(NSError * err, NSDictionary * values) { + NSLog(@"Check ColorLoopDirection Value Error: %@", err); - XCTAssertEqual(err.code, 1); - [expectation fulfill]; - }]; + XCTAssertEqual(err.code, 0); + + XCTAssertEqual([values[@"value"] unsignedCharValue], 0); + + [expectation fulfill]; + }]; [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; } - -- (void)testSendClusterTest_TC_PCC_1_1_000000_WriteAttribute +- (void)testSendClusterTest_TC_CC_8_1_000011_ReadAttribute { - XCTestExpectation * expectation = - [self expectationWithDescription:@"write the default values to mandatory global attribute: ClusterRevision"]; + XCTestExpectation * expectation = [self expectationWithDescription:@"Check ColorLoopTime Value"]; CHIPDevice * device = GetPairedDevice(kDeviceId); dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPTestPumpConfigurationAndControl * cluster = [[CHIPTestPumpConfigurationAndControl alloc] initWithDevice:device - endpoint:1 - queue:queue]; + CHIPTestColorControl * cluster = [[CHIPTestColorControl alloc] initWithDevice:device endpoint:1 queue:queue]; XCTAssertNotNil(cluster); - uint16_t clusterRevisionArgument = 3U; - [cluster - writeAttributeClusterRevisionWithValue:clusterRevisionArgument - responseHandler:^(NSError * err, NSDictionary * values) { - NSLog(@"write the default values to mandatory global attribute: ClusterRevision Error: %@", err); + [cluster readAttributeColorLoopTimeWithResponseHandler:^(NSError * err, NSDictionary * values) { + NSLog(@"Check ColorLoopTime Value Error: %@", err); - XCTAssertEqual(err.code, 1); - [expectation fulfill]; - }]; + XCTAssertEqual(err.code, 0); + + XCTAssertEqual([values[@"value"] unsignedShortValue], 3500); + + [expectation fulfill]; + }]; [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; } - -- (void)testSendClusterTest_TC_TSUIC_1_1_000000_WriteAttribute +- (void)testSendClusterTest_TC_CC_8_1_000012_ColorLoopSet { - XCTestExpectation * expectation = - [self expectationWithDescription:@"write the default values to mandatory global attribute: ClusterRevision"]; + XCTestExpectation * expectation = [self expectationWithDescription:@"Color Loop Set Command - Set direction while running"]; CHIPDevice * device = GetPairedDevice(kDeviceId); dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPTestThermostatUserInterfaceConfiguration * cluster = - [[CHIPTestThermostatUserInterfaceConfiguration alloc] initWithDevice:device endpoint:1 queue:queue]; + CHIPTestColorControl * cluster = [[CHIPTestColorControl alloc] initWithDevice:device endpoint:1 queue:queue]; XCTAssertNotNil(cluster); - uint16_t clusterRevisionArgument = 2U; - [cluster - writeAttributeClusterRevisionWithValue:clusterRevisionArgument - responseHandler:^(NSError * err, NSDictionary * values) { - NSLog(@"write the default values to mandatory global attribute: ClusterRevision Error: %@", err); + uint8_t updateFlagsArgument = 2; + uint8_t actionArgument = 0; + uint8_t directionArgument = 1; + uint16_t timeArgument = 0U; + uint16_t startHueArgument = 0U; + uint8_t optionsMaskArgument = 0; + uint8_t optionsOverrideArgument = 0; + [cluster colorLoopSet:updateFlagsArgument + action:actionArgument + direction:directionArgument + time:timeArgument + startHue:startHueArgument + optionsMask:optionsMaskArgument + optionsOverride:optionsOverrideArgument + responseHandler:^(NSError * err, NSDictionary * values) { + NSLog(@"Color Loop Set Command - Set direction while running Error: %@", err); - XCTAssertEqual(err.code, 1); - [expectation fulfill]; - }]; + XCTAssertEqual(err.code, 0); + + [expectation fulfill]; + }]; [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; } - -- (void)testSendClusterTest_TC_DIAGTH_1_1_000000_ReadAttribute +- (void)testSendClusterTest_TC_CC_8_1_000013_ReadAttribute { - XCTestExpectation * expectation = [self expectationWithDescription:@"read the global attribute: ClusterRevision"]; + XCTestExpectation * expectation = [self expectationWithDescription:@"Check ColorLoopDirection Value"]; CHIPDevice * device = GetPairedDevice(kDeviceId); dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPTestThreadNetworkDiagnostics * cluster = [[CHIPTestThreadNetworkDiagnostics alloc] initWithDevice:device - endpoint:0 - queue:queue]; + CHIPTestColorControl * cluster = [[CHIPTestColorControl alloc] initWithDevice:device endpoint:1 queue:queue]; XCTAssertNotNil(cluster); - [cluster readAttributeClusterRevisionWithResponseHandler:^(NSError * err, NSDictionary * values) { - NSLog(@"read the global attribute: ClusterRevision Error: %@", err); + [cluster readAttributeColorLoopDirectionWithResponseHandler:^(NSError * err, NSDictionary * values) { + NSLog(@"Check ColorLoopDirection Value Error: %@", err); XCTAssertEqual(err.code, 0); - XCTAssertEqual([values[@"value"] unsignedShortValue], 1); + XCTAssertEqual([values[@"value"] unsignedCharValue], 1); [expectation fulfill]; }]; [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; } -- (void)testSendClusterTest_TC_DIAGTH_1_1_000001_WriteAttribute +- (void)testSendClusterTest_TC_CC_8_1_000014_Off { - XCTestExpectation * expectation = - [self expectationWithDescription:@"write the default values to mandatory global attribute: ClusterRevision"]; + XCTestExpectation * expectation = [self expectationWithDescription:@"Turn off light that we turned on"]; CHIPDevice * device = GetPairedDevice(kDeviceId); dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPTestThreadNetworkDiagnostics * cluster = [[CHIPTestThreadNetworkDiagnostics alloc] initWithDevice:device - endpoint:0 - queue:queue]; + CHIPTestOnOff * cluster = [[CHIPTestOnOff alloc] initWithDevice:device endpoint:1 queue:queue]; XCTAssertNotNil(cluster); - uint16_t clusterRevisionArgument = 1U; - [cluster - writeAttributeClusterRevisionWithValue:clusterRevisionArgument - responseHandler:^(NSError * err, NSDictionary * values) { - NSLog(@"write the default values to mandatory global attribute: ClusterRevision Error: %@", err); + [cluster off:^(NSError * err, NSDictionary * values) { + NSLog(@"Turn off light that we turned on Error: %@", err); - XCTAssertEqual(err.code, 1); - [expectation fulfill]; - }]; + XCTAssertEqual(err.code, 0); + + [expectation fulfill]; + }]; [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; } -- (void)testSendClusterTest_TC_DIAGTH_1_1_000002_ReadAttribute +- (void)testSendClusterTest_TC_CC_8_1_000015_ReadAttribute { - XCTestExpectation * expectation = [self expectationWithDescription:@"reads back global attribute: ClusterRevision"]; + XCTestExpectation * expectation = [self expectationWithDescription:@"Check on/off attribute value is false after off command"]; CHIPDevice * device = GetPairedDevice(kDeviceId); dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPTestThreadNetworkDiagnostics * cluster = [[CHIPTestThreadNetworkDiagnostics alloc] initWithDevice:device - endpoint:0 - queue:queue]; + CHIPTestOnOff * cluster = [[CHIPTestOnOff alloc] initWithDevice:device endpoint:1 queue:queue]; XCTAssertNotNil(cluster); - [cluster readAttributeClusterRevisionWithResponseHandler:^(NSError * err, NSDictionary * values) { - NSLog(@"reads back global attribute: ClusterRevision Error: %@", err); + [cluster readAttributeOnOffWithResponseHandler:^(NSError * err, NSDictionary * values) { + NSLog(@"Check on/off attribute value is false after off command Error: %@", err); XCTAssertEqual(err.code, 0); - XCTAssertEqual([values[@"value"] unsignedShortValue], 1); + XCTAssertEqual([values[@"value"] boolValue], 0); [expectation fulfill]; }]; diff --git a/zzz_generated/chip-tool/zap-generated/test/Commands.h b/zzz_generated/chip-tool/zap-generated/test/Commands.h index 2280f79a46dec2..ab66b0d3810459 100644 --- a/zzz_generated/chip-tool/zap-generated/test/Commands.h +++ b/zzz_generated/chip-tool/zap-generated/test/Commands.h @@ -7951,10 +7951,10 @@ class Test_TC_DM_3_1 : public TestCommand // }; -class Test_TC_CC_3_4 : public TestCommand +class Test_TC_WNCV_1_1 : public TestCommand { public: - Test_TC_CC_3_4() : TestCommand("Test_TC_CC_3_4"), mTestIndex(0) {} + Test_TC_WNCV_1_1() : TestCommand("Test_TC_WNCV_1_1"), mTestIndex(0) {} /////////// TestCommand Interface ///////// void NextTest() override @@ -7963,12 +7963,12 @@ class Test_TC_CC_3_4 : public TestCommand if (0 == mTestIndex) { - ChipLogProgress(chipTool, " **** Test Start: Test_TC_CC_3_4\n"); + ChipLogProgress(chipTool, " **** Test Start: Test_TC_WNCV_1_1\n"); } if (mTestCount == mTestIndex) { - ChipLogProgress(chipTool, " **** Test Complete: Test_TC_CC_3_4\n"); + ChipLogProgress(chipTool, " **** Test Complete: Test_TC_WNCV_1_1\n"); SetCommandExitStatus(CHIP_NO_ERROR); return; } @@ -7980,84 +7980,17 @@ class Test_TC_CC_3_4 : public TestCommand switch (mTestIndex++) { case 0: - ChipLogProgress(chipTool, " ***** Test Step 0 : Turn on light for color control tests\n"); - err = TestTurnOnLightForColorControlTests_0(); + ChipLogProgress(chipTool, " ***** Test Step 0 : read the global attribute: ClusterRevision\n"); + err = TestReadTheGlobalAttributeClusterRevision_0(); break; case 1: - ChipLogProgress(chipTool, " ***** Test Step 1 : Check on/off attribute value is true after on command\n"); - err = TestCheckOnOffAttributeValueIsTrueAfterOnCommand_1(); + ChipLogProgress(chipTool, + " ***** Test Step 1 : write the default value to mandatory global attribute: ClusterRevision\n"); + err = TestWriteTheDefaultValueToMandatoryGlobalAttributeClusterRevision_1(); break; case 2: - ChipLogProgress(chipTool, " ***** Test Step 2 : Move to hue shortest distance command\n"); - err = TestMoveToHueShortestDistanceCommand_2(); - break; - case 3: - ChipLogProgress(chipTool, " ***** Test Step 3 : Move to hue longest distance command\n"); - err = TestMoveToHueLongestDistanceCommand_3(); - break; - case 4: - ChipLogProgress(chipTool, " ***** Test Step 4 : Move to hue up command\n"); - err = TestMoveToHueUpCommand_4(); - break; - case 5: - ChipLogProgress(chipTool, " ***** Test Step 5 : Move to hue down command\n"); - err = TestMoveToHueDownCommand_5(); - break; - case 6: - ChipLogProgress(chipTool, " ***** Test Step 6 : Move hue up command\n"); - err = TestMoveHueUpCommand_6(); - break; - case 7: - ChipLogProgress(chipTool, " ***** Test Step 7 : Move hue stop command\n"); - err = TestMoveHueStopCommand_7(); - break; - case 8: - ChipLogProgress(chipTool, " ***** Test Step 8 : Move hue down command\n"); - err = TestMoveHueDownCommand_8(); - break; - case 9: - ChipLogProgress(chipTool, " ***** Test Step 9 : Move hue stop command\n"); - err = TestMoveHueStopCommand_9(); - break; - case 10: - ChipLogProgress(chipTool, " ***** Test Step 10 : Step hue up command\n"); - err = TestStepHueUpCommand_10(); - break; - case 11: - ChipLogProgress(chipTool, " ***** Test Step 11 : Step hue down command\n"); - err = TestStepHueDownCommand_11(); - break; - case 12: - ChipLogProgress(chipTool, " ***** Test Step 12 : Move to saturation command\n"); - err = TestMoveToSaturationCommand_12(); - break; - case 13: - ChipLogProgress(chipTool, " ***** Test Step 13 : Move saturation up command\n"); - err = TestMoveSaturationUpCommand_13(); - break; - case 14: - ChipLogProgress(chipTool, " ***** Test Step 14 : Move saturation down command\n"); - err = TestMoveSaturationDownCommand_14(); - break; - case 15: - ChipLogProgress(chipTool, " ***** Test Step 15 : Step saturation up command\n"); - err = TestStepSaturationUpCommand_15(); - break; - case 16: - ChipLogProgress(chipTool, " ***** Test Step 16 : Step saturation down command\n"); - err = TestStepSaturationDownCommand_16(); - break; - case 17: - ChipLogProgress(chipTool, " ***** Test Step 17 : Move To current hue and saturation command\n"); - err = TestMoveToCurrentHueAndSaturationCommand_17(); - break; - case 18: - ChipLogProgress(chipTool, " ***** Test Step 18 : Turn off light that we turned on\n"); - err = TestTurnOffLightThatWeTurnedOn_18(); - break; - case 19: - ChipLogProgress(chipTool, " ***** Test Step 19 : Check on/off attribute value is false after off command\n"); - err = TestCheckOnOffAttributeValueIsFalseAfterOffCommand_19(); + ChipLogProgress(chipTool, " ***** Test Step 2 : reads back global attribute: ClusterRevision\n"); + err = TestReadsBackGlobalAttributeClusterRevision_2(); break; } @@ -8070,558 +8003,498 @@ class Test_TC_CC_3_4 : public TestCommand private: std::atomic_uint16_t mTestIndex; - const uint16_t mTestCount = 20; + const uint16_t mTestCount = 3; chip::Callback::Callback mOnFailureCallback_0{ OnFailureCallback_0, this }; - chip::Callback::Callback mOnSuccessCallback_0{ OnSuccessCallback_0, this }; + chip::Callback::Callback mOnSuccessCallback_0{ OnSuccessCallback_0, this }; chip::Callback::Callback mOnFailureCallback_1{ OnFailureCallback_1, this }; - chip::Callback::Callback mOnSuccessCallback_1{ OnSuccessCallback_1, this }; + chip::Callback::Callback mOnSuccessCallback_1{ OnSuccessCallback_1, this }; chip::Callback::Callback mOnFailureCallback_2{ OnFailureCallback_2, this }; - chip::Callback::Callback mOnSuccessCallback_2{ OnSuccessCallback_2, this }; - chip::Callback::Callback mOnFailureCallback_3{ OnFailureCallback_3, this }; - chip::Callback::Callback mOnSuccessCallback_3{ OnSuccessCallback_3, this }; - chip::Callback::Callback mOnFailureCallback_4{ OnFailureCallback_4, this }; - chip::Callback::Callback mOnSuccessCallback_4{ OnSuccessCallback_4, this }; - chip::Callback::Callback mOnFailureCallback_5{ OnFailureCallback_5, this }; - chip::Callback::Callback mOnSuccessCallback_5{ OnSuccessCallback_5, this }; - chip::Callback::Callback mOnFailureCallback_6{ OnFailureCallback_6, this }; - chip::Callback::Callback mOnSuccessCallback_6{ OnSuccessCallback_6, this }; - chip::Callback::Callback mOnFailureCallback_7{ OnFailureCallback_7, this }; - chip::Callback::Callback mOnSuccessCallback_7{ OnSuccessCallback_7, this }; - chip::Callback::Callback mOnFailureCallback_8{ OnFailureCallback_8, this }; - chip::Callback::Callback mOnSuccessCallback_8{ OnSuccessCallback_8, this }; - chip::Callback::Callback mOnFailureCallback_9{ OnFailureCallback_9, this }; - chip::Callback::Callback mOnSuccessCallback_9{ OnSuccessCallback_9, this }; - chip::Callback::Callback mOnFailureCallback_10{ OnFailureCallback_10, this }; - chip::Callback::Callback mOnSuccessCallback_10{ OnSuccessCallback_10, this }; - chip::Callback::Callback mOnFailureCallback_11{ OnFailureCallback_11, this }; - chip::Callback::Callback mOnSuccessCallback_11{ OnSuccessCallback_11, this }; - chip::Callback::Callback mOnFailureCallback_12{ OnFailureCallback_12, this }; - chip::Callback::Callback mOnSuccessCallback_12{ OnSuccessCallback_12, this }; - chip::Callback::Callback mOnFailureCallback_13{ OnFailureCallback_13, this }; - chip::Callback::Callback mOnSuccessCallback_13{ OnSuccessCallback_13, this }; - chip::Callback::Callback mOnFailureCallback_14{ OnFailureCallback_14, this }; - chip::Callback::Callback mOnSuccessCallback_14{ OnSuccessCallback_14, this }; - chip::Callback::Callback mOnFailureCallback_15{ OnFailureCallback_15, this }; - chip::Callback::Callback mOnSuccessCallback_15{ OnSuccessCallback_15, this }; - chip::Callback::Callback mOnFailureCallback_16{ OnFailureCallback_16, this }; - chip::Callback::Callback mOnSuccessCallback_16{ OnSuccessCallback_16, this }; - chip::Callback::Callback mOnFailureCallback_17{ OnFailureCallback_17, this }; - chip::Callback::Callback mOnSuccessCallback_17{ OnSuccessCallback_17, this }; - chip::Callback::Callback mOnFailureCallback_18{ OnFailureCallback_18, this }; - chip::Callback::Callback mOnSuccessCallback_18{ OnSuccessCallback_18, this }; - chip::Callback::Callback mOnFailureCallback_19{ OnFailureCallback_19, this }; - chip::Callback::Callback mOnSuccessCallback_19{ OnSuccessCallback_19, this }; + chip::Callback::Callback mOnSuccessCallback_2{ OnSuccessCallback_2, this }; static void OnFailureCallback_0(void * context, uint8_t status) { - (static_cast(context))->OnFailureResponse_0(status); - } - - static void OnSuccessCallback_0(void * context) { (static_cast(context))->OnSuccessResponse_0(); } - - static void OnFailureCallback_1(void * context, uint8_t status) - { - (static_cast(context))->OnFailureResponse_1(status); - } - - static void OnSuccessCallback_1(void * context, bool onOff) - { - (static_cast(context))->OnSuccessResponse_1(onOff); + (static_cast(context))->OnFailureResponse_0(status); } - static void OnFailureCallback_2(void * context, uint8_t status) + static void OnSuccessCallback_0(void * context, uint16_t clusterRevision) { - (static_cast(context))->OnFailureResponse_2(status); + (static_cast(context))->OnSuccessResponse_0(clusterRevision); } - static void OnSuccessCallback_2(void * context) { (static_cast(context))->OnSuccessResponse_2(); } - - static void OnFailureCallback_3(void * context, uint8_t status) + static void OnFailureCallback_1(void * context, uint8_t status) { - (static_cast(context))->OnFailureResponse_3(status); + (static_cast(context))->OnFailureResponse_1(status); } - static void OnSuccessCallback_3(void * context) { (static_cast(context))->OnSuccessResponse_3(); } - - static void OnFailureCallback_4(void * context, uint8_t status) + static void OnSuccessCallback_1(void * context, uint16_t clusterRevision) { - (static_cast(context))->OnFailureResponse_4(status); + (static_cast(context))->OnSuccessResponse_1(clusterRevision); } - static void OnSuccessCallback_4(void * context) { (static_cast(context))->OnSuccessResponse_4(); } - - static void OnFailureCallback_5(void * context, uint8_t status) + static void OnFailureCallback_2(void * context, uint8_t status) { - (static_cast(context))->OnFailureResponse_5(status); + (static_cast(context))->OnFailureResponse_2(status); } - static void OnSuccessCallback_5(void * context) { (static_cast(context))->OnSuccessResponse_5(); } - - static void OnFailureCallback_6(void * context, uint8_t status) + static void OnSuccessCallback_2(void * context, uint16_t clusterRevision) { - (static_cast(context))->OnFailureResponse_6(status); + (static_cast(context))->OnSuccessResponse_2(clusterRevision); } - static void OnSuccessCallback_6(void * context) { (static_cast(context))->OnSuccessResponse_6(); } + // + // Tests methods + // - static void OnFailureCallback_7(void * context, uint8_t status) + CHIP_ERROR TestReadTheGlobalAttributeClusterRevision_0() { - (static_cast(context))->OnFailureResponse_7(status); - } - - static void OnSuccessCallback_7(void * context) { (static_cast(context))->OnSuccessResponse_7(); } + chip::Controller::WindowCoveringClusterTest cluster; + cluster.Associate(mDevice, 1); - static void OnFailureCallback_8(void * context, uint8_t status) - { - (static_cast(context))->OnFailureResponse_8(status); + return cluster.ReadAttributeClusterRevision(mOnSuccessCallback_0.Cancel(), mOnFailureCallback_0.Cancel()); } - static void OnSuccessCallback_8(void * context) { (static_cast(context))->OnSuccessResponse_8(); } + void OnFailureResponse_0(uint8_t status) { ThrowFailureResponse(); } - static void OnFailureCallback_9(void * context, uint8_t status) + void OnSuccessResponse_0(uint16_t clusterRevision) { - (static_cast(context))->OnFailureResponse_9(status); + VerifyOrReturn(CheckValue("clusterRevision", clusterRevision, 5U)); + NextTest(); } - static void OnSuccessCallback_9(void * context) { (static_cast(context))->OnSuccessResponse_9(); } - - static void OnFailureCallback_10(void * context, uint8_t status) + CHIP_ERROR TestWriteTheDefaultValueToMandatoryGlobalAttributeClusterRevision_1() { - (static_cast(context))->OnFailureResponse_10(status); - } + chip::Controller::WindowCoveringClusterTest cluster; + cluster.Associate(mDevice, 1); - static void OnSuccessCallback_10(void * context) { (static_cast(context))->OnSuccessResponse_10(); } + uint16_t clusterRevisionArgument = 5U; - static void OnFailureCallback_11(void * context, uint8_t status) - { - (static_cast(context))->OnFailureResponse_11(status); + return cluster.WriteAttributeClusterRevision(mOnSuccessCallback_1.Cancel(), mOnFailureCallback_1.Cancel(), + clusterRevisionArgument); } - static void OnSuccessCallback_11(void * context) { (static_cast(context))->OnSuccessResponse_11(); } - - static void OnFailureCallback_12(void * context, uint8_t status) - { - (static_cast(context))->OnFailureResponse_12(status); - } + void OnFailureResponse_1(uint8_t status) { NextTest(); } - static void OnSuccessCallback_12(void * context) { (static_cast(context))->OnSuccessResponse_12(); } + void OnSuccessResponse_1(uint16_t clusterRevision) { ThrowSuccessResponse(); } - static void OnFailureCallback_13(void * context, uint8_t status) + CHIP_ERROR TestReadsBackGlobalAttributeClusterRevision_2() { - (static_cast(context))->OnFailureResponse_13(status); - } - - static void OnSuccessCallback_13(void * context) { (static_cast(context))->OnSuccessResponse_13(); } + chip::Controller::WindowCoveringClusterTest cluster; + cluster.Associate(mDevice, 1); - static void OnFailureCallback_14(void * context, uint8_t status) - { - (static_cast(context))->OnFailureResponse_14(status); + return cluster.ReadAttributeClusterRevision(mOnSuccessCallback_2.Cancel(), mOnFailureCallback_2.Cancel()); } - static void OnSuccessCallback_14(void * context) { (static_cast(context))->OnSuccessResponse_14(); } + void OnFailureResponse_2(uint8_t status) { ThrowFailureResponse(); } - static void OnFailureCallback_15(void * context, uint8_t status) + void OnSuccessResponse_2(uint16_t clusterRevision) { - (static_cast(context))->OnFailureResponse_15(status); + VerifyOrReturn(CheckValue("clusterRevision", clusterRevision, 5U)); + NextTest(); } +}; - static void OnSuccessCallback_15(void * context) { (static_cast(context))->OnSuccessResponse_15(); } +class Test_TC_WNCV_2_1 : public TestCommand +{ +public: + Test_TC_WNCV_2_1() : TestCommand("Test_TC_WNCV_2_1"), mTestIndex(0) {} - static void OnFailureCallback_16(void * context, uint8_t status) + /////////// TestCommand Interface ///////// + void NextTest() override { - (static_cast(context))->OnFailureResponse_16(status); - } + CHIP_ERROR err = CHIP_NO_ERROR; - static void OnSuccessCallback_16(void * context) { (static_cast(context))->OnSuccessResponse_16(); } + if (0 == mTestIndex) + { + ChipLogProgress(chipTool, " **** Test Start: Test_TC_WNCV_2_1\n"); + } - static void OnFailureCallback_17(void * context, uint8_t status) - { - (static_cast(context))->OnFailureResponse_17(status); - } + if (mTestCount == mTestIndex) + { + ChipLogProgress(chipTool, " **** Test Complete: Test_TC_WNCV_2_1\n"); + SetCommandExitStatus(CHIP_NO_ERROR); + return; + } - static void OnSuccessCallback_17(void * context) { (static_cast(context))->OnSuccessResponse_17(); } + // Ensure we increment mTestIndex before we start running the relevant + // command. That way if we lose the timeslice after we send the message + // but before our function call returns, we won't end up with an + // incorrect mTestIndex value observed when we get the response. + switch (mTestIndex++) + { + case 0: + ChipLogProgress(chipTool, " ***** Test Step 0 : read the RO mandatory attribute default: Type\n"); + err = TestReadTheRoMandatoryAttributeDefaultType_0(); + break; + case 1: + ChipLogProgress(chipTool, " ***** Test Step 1 : reads back the RO mandatory attribute: Type\n"); + err = TestReadsBackTheRoMandatoryAttributeType_1(); + break; + case 2: + ChipLogProgress(chipTool, " ***** Test Step 2 : read the RO mandatory attribute default: ConfigStatus\n"); + err = TestReadTheRoMandatoryAttributeDefaultConfigStatus_2(); + break; + case 3: + ChipLogProgress(chipTool, " ***** Test Step 3 : reads back the RO mandatory attribute: ConfigStatus\n"); + err = TestReadsBackTheRoMandatoryAttributeConfigStatus_3(); + break; + case 4: + ChipLogProgress(chipTool, " ***** Test Step 4 : read the RO mandatory attribute default: OperationalStatus\n"); + err = TestReadTheRoMandatoryAttributeDefaultOperationalStatus_4(); + break; + case 5: + ChipLogProgress(chipTool, " ***** Test Step 5 : reads back the RO mandatory attribute: OperationalStatus\n"); + err = TestReadsBackTheRoMandatoryAttributeOperationalStatus_5(); + break; + case 6: + ChipLogProgress(chipTool, " ***** Test Step 6 : read the RO mandatory attribute default: EndProductType\n"); + err = TestReadTheRoMandatoryAttributeDefaultEndProductType_6(); + break; + case 7: + ChipLogProgress(chipTool, " ***** Test Step 7 : reads back the RO mandatory attribute: EndProductType\n"); + err = TestReadsBackTheRoMandatoryAttributeEndProductType_7(); + break; + case 8: + ChipLogProgress(chipTool, " ***** Test Step 8 : read the RW mandatory attribute default: Mode\n"); + err = TestReadTheRwMandatoryAttributeDefaultMode_8(); + break; + case 9: + ChipLogProgress(chipTool, " ***** Test Step 9 : write a value into the RW mandatory attribute:: Mode\n"); + err = TestWriteAValueIntoTheRwMandatoryAttributeMode_9(); + break; + case 10: + ChipLogProgress(chipTool, " ***** Test Step 10 : reads back the RW mandatory attribute: Mode\n"); + err = TestReadsBackTheRwMandatoryAttributeMode_10(); + break; + } - static void OnFailureCallback_18(void * context, uint8_t status) - { - (static_cast(context))->OnFailureResponse_18(status); + if (CHIP_NO_ERROR != err) + { + ChipLogError(chipTool, " ***** Test Failure: %s\n", chip::ErrorStr(err)); + SetCommandExitStatus(err); + } } - static void OnSuccessCallback_18(void * context) { (static_cast(context))->OnSuccessResponse_18(); } - - static void OnFailureCallback_19(void * context, uint8_t status) - { - (static_cast(context))->OnFailureResponse_19(status); - } +private: + std::atomic_uint16_t mTestIndex; + const uint16_t mTestCount = 11; - static void OnSuccessCallback_19(void * context, bool onOff) + chip::Callback::Callback mOnFailureCallback_0{ OnFailureCallback_0, this }; + chip::Callback::Callback mOnSuccessCallback_0{ OnSuccessCallback_0, this }; + chip::Callback::Callback mOnFailureCallback_1{ OnFailureCallback_1, this }; + chip::Callback::Callback mOnSuccessCallback_1{ OnSuccessCallback_1, this }; + chip::Callback::Callback mOnFailureCallback_2{ OnFailureCallback_2, this }; + chip::Callback::Callback mOnSuccessCallback_2{ OnSuccessCallback_2, this }; + chip::Callback::Callback mOnFailureCallback_3{ OnFailureCallback_3, this }; + chip::Callback::Callback mOnSuccessCallback_3{ OnSuccessCallback_3, this }; + chip::Callback::Callback mOnFailureCallback_4{ OnFailureCallback_4, this }; + chip::Callback::Callback mOnSuccessCallback_4{ OnSuccessCallback_4, this }; + chip::Callback::Callback mOnFailureCallback_5{ OnFailureCallback_5, this }; + chip::Callback::Callback mOnSuccessCallback_5{ OnSuccessCallback_5, this }; + chip::Callback::Callback mOnFailureCallback_6{ OnFailureCallback_6, this }; + chip::Callback::Callback mOnSuccessCallback_6{ OnSuccessCallback_6, this }; + chip::Callback::Callback mOnFailureCallback_7{ OnFailureCallback_7, this }; + chip::Callback::Callback mOnSuccessCallback_7{ OnSuccessCallback_7, this }; + chip::Callback::Callback mOnFailureCallback_8{ OnFailureCallback_8, this }; + chip::Callback::Callback mOnSuccessCallback_8{ OnSuccessCallback_8, this }; + chip::Callback::Callback mOnFailureCallback_9{ OnFailureCallback_9, this }; + chip::Callback::Callback mOnSuccessCallback_9{ OnSuccessCallback_9, this }; + chip::Callback::Callback mOnFailureCallback_10{ OnFailureCallback_10, this }; + chip::Callback::Callback mOnSuccessCallback_10{ OnSuccessCallback_10, this }; + + static void OnFailureCallback_0(void * context, uint8_t status) { - (static_cast(context))->OnSuccessResponse_19(onOff); + (static_cast(context))->OnFailureResponse_0(status); } - // - // Tests methods - // - - CHIP_ERROR TestTurnOnLightForColorControlTests_0() + static void OnSuccessCallback_0(void * context, uint8_t type) { - chip::Controller::OnOffClusterTest cluster; - cluster.Associate(mDevice, 1); - - return cluster.On(mOnSuccessCallback_0.Cancel(), mOnFailureCallback_0.Cancel()); + (static_cast(context))->OnSuccessResponse_0(type); } - void OnFailureResponse_0(uint8_t status) { ThrowFailureResponse(); } + static void OnFailureCallback_1(void * context, uint8_t status) + { + (static_cast(context))->OnFailureResponse_1(status); + } - void OnSuccessResponse_0() { NextTest(); } + static void OnSuccessCallback_1(void * context, uint8_t type) + { + (static_cast(context))->OnSuccessResponse_1(type); + } - CHIP_ERROR TestCheckOnOffAttributeValueIsTrueAfterOnCommand_1() + static void OnFailureCallback_2(void * context, uint8_t status) { - chip::Controller::OnOffClusterTest cluster; - cluster.Associate(mDevice, 1); + (static_cast(context))->OnFailureResponse_2(status); + } - return cluster.ReadAttributeOnOff(mOnSuccessCallback_1.Cancel(), mOnFailureCallback_1.Cancel()); + static void OnSuccessCallback_2(void * context, uint8_t configStatus) + { + (static_cast(context))->OnSuccessResponse_2(configStatus); } - void OnFailureResponse_1(uint8_t status) { ThrowFailureResponse(); } + static void OnFailureCallback_3(void * context, uint8_t status) + { + (static_cast(context))->OnFailureResponse_3(status); + } - void OnSuccessResponse_1(bool onOff) + static void OnSuccessCallback_3(void * context, uint8_t configStatus) { - VerifyOrReturn(CheckValue("onOff", onOff, 1)); - NextTest(); + (static_cast(context))->OnSuccessResponse_3(configStatus); } - CHIP_ERROR TestMoveToHueShortestDistanceCommand_2() + static void OnFailureCallback_4(void * context, uint8_t status) { - chip::Controller::ColorControlClusterTest cluster; - cluster.Associate(mDevice, 1); + (static_cast(context))->OnFailureResponse_4(status); + } - uint8_t hueArgument = 150; - uint8_t directionArgument = 0; - uint16_t transitionTimeArgument = 100U; - uint8_t optionsMaskArgument = 0; - uint8_t optionsOverrideArgument = 0; + static void OnSuccessCallback_4(void * context, uint8_t operationalStatus) + { + (static_cast(context))->OnSuccessResponse_4(operationalStatus); + } - return cluster.MoveToHue(mOnSuccessCallback_2.Cancel(), mOnFailureCallback_2.Cancel(), hueArgument, directionArgument, - transitionTimeArgument, optionsMaskArgument, optionsOverrideArgument); + static void OnFailureCallback_5(void * context, uint8_t status) + { + (static_cast(context))->OnFailureResponse_5(status); } - void OnFailureResponse_2(uint8_t status) { ThrowFailureResponse(); } + static void OnSuccessCallback_5(void * context, uint8_t operationalStatus) + { + (static_cast(context))->OnSuccessResponse_5(operationalStatus); + } - void OnSuccessResponse_2() { NextTest(); } + static void OnFailureCallback_6(void * context, uint8_t status) + { + (static_cast(context))->OnFailureResponse_6(status); + } - CHIP_ERROR TestMoveToHueLongestDistanceCommand_3() + static void OnSuccessCallback_6(void * context, uint8_t endProductType) { - chip::Controller::ColorControlClusterTest cluster; - cluster.Associate(mDevice, 1); + (static_cast(context))->OnSuccessResponse_6(endProductType); + } - uint8_t hueArgument = 200; - uint8_t directionArgument = 1; - uint16_t transitionTimeArgument = 100U; - uint8_t optionsMaskArgument = 0; - uint8_t optionsOverrideArgument = 0; + static void OnFailureCallback_7(void * context, uint8_t status) + { + (static_cast(context))->OnFailureResponse_7(status); + } - return cluster.MoveToHue(mOnSuccessCallback_3.Cancel(), mOnFailureCallback_3.Cancel(), hueArgument, directionArgument, - transitionTimeArgument, optionsMaskArgument, optionsOverrideArgument); + static void OnSuccessCallback_7(void * context, uint8_t endProductType) + { + (static_cast(context))->OnSuccessResponse_7(endProductType); } - void OnFailureResponse_3(uint8_t status) { ThrowFailureResponse(); } + static void OnFailureCallback_8(void * context, uint8_t status) + { + (static_cast(context))->OnFailureResponse_8(status); + } - void OnSuccessResponse_3() { NextTest(); } + static void OnSuccessCallback_8(void * context, uint8_t mode) + { + (static_cast(context))->OnSuccessResponse_8(mode); + } - CHIP_ERROR TestMoveToHueUpCommand_4() + static void OnFailureCallback_9(void * context, uint8_t status) { - chip::Controller::ColorControlClusterTest cluster; - cluster.Associate(mDevice, 1); + (static_cast(context))->OnFailureResponse_9(status); + } - uint8_t hueArgument = 250; - uint8_t directionArgument = 2; - uint16_t transitionTimeArgument = 100U; - uint8_t optionsMaskArgument = 0; - uint8_t optionsOverrideArgument = 0; + static void OnSuccessCallback_9(void * context, uint8_t mode) + { + (static_cast(context))->OnSuccessResponse_9(mode); + } - return cluster.MoveToHue(mOnSuccessCallback_4.Cancel(), mOnFailureCallback_4.Cancel(), hueArgument, directionArgument, - transitionTimeArgument, optionsMaskArgument, optionsOverrideArgument); + static void OnFailureCallback_10(void * context, uint8_t status) + { + (static_cast(context))->OnFailureResponse_10(status); } - void OnFailureResponse_4(uint8_t status) { ThrowFailureResponse(); } + static void OnSuccessCallback_10(void * context, uint8_t mode) + { + (static_cast(context))->OnSuccessResponse_10(mode); + } - void OnSuccessResponse_4() { NextTest(); } + // + // Tests methods + // - CHIP_ERROR TestMoveToHueDownCommand_5() + CHIP_ERROR TestReadTheRoMandatoryAttributeDefaultType_0() { - chip::Controller::ColorControlClusterTest cluster; + chip::Controller::WindowCoveringClusterTest cluster; cluster.Associate(mDevice, 1); - uint8_t hueArgument = 225; - uint8_t directionArgument = 3; - uint16_t transitionTimeArgument = 100U; - uint8_t optionsMaskArgument = 0; - uint8_t optionsOverrideArgument = 0; - - return cluster.MoveToHue(mOnSuccessCallback_5.Cancel(), mOnFailureCallback_5.Cancel(), hueArgument, directionArgument, - transitionTimeArgument, optionsMaskArgument, optionsOverrideArgument); + return cluster.ReadAttributeType(mOnSuccessCallback_0.Cancel(), mOnFailureCallback_0.Cancel()); } - void OnFailureResponse_5(uint8_t status) { ThrowFailureResponse(); } + void OnFailureResponse_0(uint8_t status) { ThrowFailureResponse(); } - void OnSuccessResponse_5() { NextTest(); } + void OnSuccessResponse_0(uint8_t type) + { + VerifyOrReturn(CheckValue("type", type, 0)); + NextTest(); + } - CHIP_ERROR TestMoveHueUpCommand_6() + CHIP_ERROR TestReadsBackTheRoMandatoryAttributeType_1() { - chip::Controller::ColorControlClusterTest cluster; + chip::Controller::WindowCoveringClusterTest cluster; cluster.Associate(mDevice, 1); - uint8_t moveModeArgument = 1; - uint8_t rateArgument = 50; - uint8_t optionsMaskArgument = 0; - uint8_t optionsOverrideArgument = 0; - - return cluster.MoveHue(mOnSuccessCallback_6.Cancel(), mOnFailureCallback_6.Cancel(), moveModeArgument, rateArgument, - optionsMaskArgument, optionsOverrideArgument); + return cluster.ReadAttributeType(mOnSuccessCallback_1.Cancel(), mOnFailureCallback_1.Cancel()); } - void OnFailureResponse_6(uint8_t status) { ThrowFailureResponse(); } + void OnFailureResponse_1(uint8_t status) { ThrowFailureResponse(); } - void OnSuccessResponse_6() { NextTest(); } + void OnSuccessResponse_1(uint8_t type) + { + VerifyOrReturn(CheckValue("type", type, 0)); + NextTest(); + } - CHIP_ERROR TestMoveHueStopCommand_7() + CHIP_ERROR TestReadTheRoMandatoryAttributeDefaultConfigStatus_2() { - chip::Controller::ColorControlClusterTest cluster; + chip::Controller::WindowCoveringClusterTest cluster; cluster.Associate(mDevice, 1); - uint8_t moveModeArgument = 0; - uint8_t rateArgument = 50; - uint8_t optionsMaskArgument = 0; - uint8_t optionsOverrideArgument = 0; - - return cluster.MoveHue(mOnSuccessCallback_7.Cancel(), mOnFailureCallback_7.Cancel(), moveModeArgument, rateArgument, - optionsMaskArgument, optionsOverrideArgument); + return cluster.ReadAttributeConfigStatus(mOnSuccessCallback_2.Cancel(), mOnFailureCallback_2.Cancel()); } - void OnFailureResponse_7(uint8_t status) { ThrowFailureResponse(); } + void OnFailureResponse_2(uint8_t status) { ThrowFailureResponse(); } - void OnSuccessResponse_7() { NextTest(); } + void OnSuccessResponse_2(uint8_t configStatus) + { + VerifyOrReturn(CheckValue("configStatus", configStatus, 3)); + NextTest(); + } - CHIP_ERROR TestMoveHueDownCommand_8() + CHIP_ERROR TestReadsBackTheRoMandatoryAttributeConfigStatus_3() { - chip::Controller::ColorControlClusterTest cluster; + chip::Controller::WindowCoveringClusterTest cluster; cluster.Associate(mDevice, 1); - uint8_t moveModeArgument = 3; - uint8_t rateArgument = 50; - uint8_t optionsMaskArgument = 0; - uint8_t optionsOverrideArgument = 0; - - return cluster.MoveHue(mOnSuccessCallback_8.Cancel(), mOnFailureCallback_8.Cancel(), moveModeArgument, rateArgument, - optionsMaskArgument, optionsOverrideArgument); + return cluster.ReadAttributeConfigStatus(mOnSuccessCallback_3.Cancel(), mOnFailureCallback_3.Cancel()); } - void OnFailureResponse_8(uint8_t status) { ThrowFailureResponse(); } + void OnFailureResponse_3(uint8_t status) { ThrowFailureResponse(); } - void OnSuccessResponse_8() { NextTest(); } + void OnSuccessResponse_3(uint8_t configStatus) + { + VerifyOrReturn(CheckValue("configStatus", configStatus, 3)); + NextTest(); + } - CHIP_ERROR TestMoveHueStopCommand_9() + CHIP_ERROR TestReadTheRoMandatoryAttributeDefaultOperationalStatus_4() { - chip::Controller::ColorControlClusterTest cluster; + chip::Controller::WindowCoveringClusterTest cluster; cluster.Associate(mDevice, 1); - uint8_t moveModeArgument = 0; - uint8_t rateArgument = 50; - uint8_t optionsMaskArgument = 0; - uint8_t optionsOverrideArgument = 0; - - return cluster.MoveHue(mOnSuccessCallback_9.Cancel(), mOnFailureCallback_9.Cancel(), moveModeArgument, rateArgument, - optionsMaskArgument, optionsOverrideArgument); + return cluster.ReadAttributeOperationalStatus(mOnSuccessCallback_4.Cancel(), mOnFailureCallback_4.Cancel()); } - void OnFailureResponse_9(uint8_t status) { ThrowFailureResponse(); } + void OnFailureResponse_4(uint8_t status) { ThrowFailureResponse(); } - void OnSuccessResponse_9() { NextTest(); } + void OnSuccessResponse_4(uint8_t operationalStatus) + { + VerifyOrReturn(CheckValue("operationalStatus", operationalStatus, 0)); + NextTest(); + } - CHIP_ERROR TestStepHueUpCommand_10() + CHIP_ERROR TestReadsBackTheRoMandatoryAttributeOperationalStatus_5() { - chip::Controller::ColorControlClusterTest cluster; + chip::Controller::WindowCoveringClusterTest cluster; cluster.Associate(mDevice, 1); - uint8_t stepModeArgument = 1; - uint8_t stepSizeArgument = 5; - uint8_t transitionTimeArgument = 25; - uint8_t optionsMaskArgument = 0; - uint8_t optionsOverrideArgument = 0; - - return cluster.StepHue(mOnSuccessCallback_10.Cancel(), mOnFailureCallback_10.Cancel(), stepModeArgument, stepSizeArgument, - transitionTimeArgument, optionsMaskArgument, optionsOverrideArgument); + return cluster.ReadAttributeOperationalStatus(mOnSuccessCallback_5.Cancel(), mOnFailureCallback_5.Cancel()); } - void OnFailureResponse_10(uint8_t status) { ThrowFailureResponse(); } - - void OnSuccessResponse_10() { NextTest(); } + void OnFailureResponse_5(uint8_t status) { ThrowFailureResponse(); } - CHIP_ERROR TestStepHueDownCommand_11() + void OnSuccessResponse_5(uint8_t operationalStatus) { - chip::Controller::ColorControlClusterTest cluster; - cluster.Associate(mDevice, 1); - - uint8_t stepModeArgument = 3; - uint8_t stepSizeArgument = 5; - uint8_t transitionTimeArgument = 25; - uint8_t optionsMaskArgument = 0; - uint8_t optionsOverrideArgument = 0; - - return cluster.StepHue(mOnSuccessCallback_11.Cancel(), mOnFailureCallback_11.Cancel(), stepModeArgument, stepSizeArgument, - transitionTimeArgument, optionsMaskArgument, optionsOverrideArgument); + VerifyOrReturn(CheckValue("operationalStatus", operationalStatus, 0)); + NextTest(); } - void OnFailureResponse_11(uint8_t status) { ThrowFailureResponse(); } - - void OnSuccessResponse_11() { NextTest(); } - - CHIP_ERROR TestMoveToSaturationCommand_12() + CHIP_ERROR TestReadTheRoMandatoryAttributeDefaultEndProductType_6() { - chip::Controller::ColorControlClusterTest cluster; + chip::Controller::WindowCoveringClusterTest cluster; cluster.Associate(mDevice, 1); - uint8_t saturationArgument = 90; - uint16_t transitionTimeArgument = 10U; - uint8_t optionsMaskArgument = 0; - uint8_t optionsOverrideArgument = 0; - - return cluster.MoveToSaturation(mOnSuccessCallback_12.Cancel(), mOnFailureCallback_12.Cancel(), saturationArgument, - transitionTimeArgument, optionsMaskArgument, optionsOverrideArgument); + return cluster.ReadAttributeEndProductType(mOnSuccessCallback_6.Cancel(), mOnFailureCallback_6.Cancel()); } - void OnFailureResponse_12(uint8_t status) { ThrowFailureResponse(); } - - void OnSuccessResponse_12() { NextTest(); } + void OnFailureResponse_6(uint8_t status) { ThrowFailureResponse(); } - CHIP_ERROR TestMoveSaturationUpCommand_13() + void OnSuccessResponse_6(uint8_t endProductType) { - chip::Controller::ColorControlClusterTest cluster; - cluster.Associate(mDevice, 1); - - uint8_t moveModeArgument = 1; - uint8_t rateArgument = 5; - uint8_t optionsMaskArgument = 0; - uint8_t optionsOverrideArgument = 0; - - return cluster.MoveSaturation(mOnSuccessCallback_13.Cancel(), mOnFailureCallback_13.Cancel(), moveModeArgument, - rateArgument, optionsMaskArgument, optionsOverrideArgument); + VerifyOrReturn(CheckValue("endProductType", endProductType, 0)); + NextTest(); } - void OnFailureResponse_13(uint8_t status) { ThrowFailureResponse(); } - - void OnSuccessResponse_13() { NextTest(); } - - CHIP_ERROR TestMoveSaturationDownCommand_14() + CHIP_ERROR TestReadsBackTheRoMandatoryAttributeEndProductType_7() { - chip::Controller::ColorControlClusterTest cluster; + chip::Controller::WindowCoveringClusterTest cluster; cluster.Associate(mDevice, 1); - uint8_t moveModeArgument = 3; - uint8_t rateArgument = 5; - uint8_t optionsMaskArgument = 0; - uint8_t optionsOverrideArgument = 0; - - return cluster.MoveSaturation(mOnSuccessCallback_14.Cancel(), mOnFailureCallback_14.Cancel(), moveModeArgument, - rateArgument, optionsMaskArgument, optionsOverrideArgument); + return cluster.ReadAttributeEndProductType(mOnSuccessCallback_7.Cancel(), mOnFailureCallback_7.Cancel()); } - void OnFailureResponse_14(uint8_t status) { ThrowFailureResponse(); } - - void OnSuccessResponse_14() { NextTest(); } + void OnFailureResponse_7(uint8_t status) { ThrowFailureResponse(); } - CHIP_ERROR TestStepSaturationUpCommand_15() + void OnSuccessResponse_7(uint8_t endProductType) { - chip::Controller::ColorControlClusterTest cluster; - cluster.Associate(mDevice, 1); - - uint8_t stepModeArgument = 1; - uint8_t stepSizeArgument = 15; - uint8_t transitionTimeArgument = 10; - uint8_t optionsMaskArgument = 0; - uint8_t optionsOverrideArgument = 0; - - return cluster.StepSaturation(mOnSuccessCallback_15.Cancel(), mOnFailureCallback_15.Cancel(), stepModeArgument, - stepSizeArgument, transitionTimeArgument, optionsMaskArgument, optionsOverrideArgument); + VerifyOrReturn(CheckValue("endProductType", endProductType, 0)); + NextTest(); } - void OnFailureResponse_15(uint8_t status) { ThrowFailureResponse(); } - - void OnSuccessResponse_15() { NextTest(); } - - CHIP_ERROR TestStepSaturationDownCommand_16() + CHIP_ERROR TestReadTheRwMandatoryAttributeDefaultMode_8() { - chip::Controller::ColorControlClusterTest cluster; + chip::Controller::WindowCoveringClusterTest cluster; cluster.Associate(mDevice, 1); - uint8_t stepModeArgument = 3; - uint8_t stepSizeArgument = 20; - uint8_t transitionTimeArgument = 10; - uint8_t optionsMaskArgument = 0; - uint8_t optionsOverrideArgument = 0; - - return cluster.StepSaturation(mOnSuccessCallback_16.Cancel(), mOnFailureCallback_16.Cancel(), stepModeArgument, - stepSizeArgument, transitionTimeArgument, optionsMaskArgument, optionsOverrideArgument); + return cluster.ReadAttributeMode(mOnSuccessCallback_8.Cancel(), mOnFailureCallback_8.Cancel()); } - void OnFailureResponse_16(uint8_t status) { ThrowFailureResponse(); } - - void OnSuccessResponse_16() { NextTest(); } + void OnFailureResponse_8(uint8_t status) { ThrowFailureResponse(); } - CHIP_ERROR TestMoveToCurrentHueAndSaturationCommand_17() + void OnSuccessResponse_8(uint8_t mode) { - chip::Controller::ColorControlClusterTest cluster; - cluster.Associate(mDevice, 1); - - uint8_t hueArgument = 40; - uint8_t saturationArgument = 160; - uint16_t transitionTimeArgument = 10U; - uint8_t optionsMaskArgument = 0; - uint8_t optionsOverrideArgument = 0; - - return cluster.MoveToHueAndSaturation(mOnSuccessCallback_17.Cancel(), mOnFailureCallback_17.Cancel(), hueArgument, - saturationArgument, transitionTimeArgument, optionsMaskArgument, - optionsOverrideArgument); + VerifyOrReturn(CheckValue("mode", mode, 0)); + NextTest(); } - void OnFailureResponse_17(uint8_t status) { ThrowFailureResponse(); } - - void OnSuccessResponse_17() { NextTest(); } - - CHIP_ERROR TestTurnOffLightThatWeTurnedOn_18() + CHIP_ERROR TestWriteAValueIntoTheRwMandatoryAttributeMode_9() { - chip::Controller::OnOffClusterTest cluster; + chip::Controller::WindowCoveringClusterTest cluster; cluster.Associate(mDevice, 1); - return cluster.Off(mOnSuccessCallback_18.Cancel(), mOnFailureCallback_18.Cancel()); + uint8_t modeArgument = 7; + + return cluster.WriteAttributeMode(mOnSuccessCallback_9.Cancel(), mOnFailureCallback_9.Cancel(), modeArgument); } - void OnFailureResponse_18(uint8_t status) { ThrowFailureResponse(); } + void OnFailureResponse_9(uint8_t status) { ThrowFailureResponse(); } - void OnSuccessResponse_18() { NextTest(); } + void OnSuccessResponse_9(uint8_t mode) { NextTest(); } - CHIP_ERROR TestCheckOnOffAttributeValueIsFalseAfterOffCommand_19() + CHIP_ERROR TestReadsBackTheRwMandatoryAttributeMode_10() { - chip::Controller::OnOffClusterTest cluster; + chip::Controller::WindowCoveringClusterTest cluster; cluster.Associate(mDevice, 1); - return cluster.ReadAttributeOnOff(mOnSuccessCallback_19.Cancel(), mOnFailureCallback_19.Cancel()); + return cluster.ReadAttributeMode(mOnSuccessCallback_10.Cancel(), mOnFailureCallback_10.Cancel()); } - void OnFailureResponse_19(uint8_t status) { ThrowFailureResponse(); } + void OnFailureResponse_10(uint8_t status) { ThrowFailureResponse(); } - void OnSuccessResponse_19(bool onOff) + void OnSuccessResponse_10(uint8_t mode) { - VerifyOrReturn(CheckValue("onOff", onOff, 0)); + VerifyOrReturn(CheckValue("mode", mode, 7)); NextTest(); } }; -class Test_TC_CC_5 : public TestCommand +class Test_TC_WNCV_3_1 : public TestCommand { public: - Test_TC_CC_5() : TestCommand("Test_TC_CC_5"), mTestIndex(0) {} + Test_TC_WNCV_3_1() : TestCommand("Test_TC_WNCV_3_1"), mTestIndex(0) {} /////////// TestCommand Interface ///////// void NextTest() override @@ -8630,12 +8503,12 @@ class Test_TC_CC_5 : public TestCommand if (0 == mTestIndex) { - ChipLogProgress(chipTool, " **** Test Start: Test_TC_CC_5\n"); + ChipLogProgress(chipTool, " **** Test Start: Test_TC_WNCV_3_1\n"); } if (mTestCount == mTestIndex) { - ChipLogProgress(chipTool, " **** Test Complete: Test_TC_CC_5\n"); + ChipLogProgress(chipTool, " **** Test Complete: Test_TC_WNCV_3_1\n"); SetCommandExitStatus(CHIP_NO_ERROR); return; } @@ -8647,36 +8520,16 @@ class Test_TC_CC_5 : public TestCommand switch (mTestIndex++) { case 0: - ChipLogProgress(chipTool, " ***** Test Step 0 : Turn on light for color control tests\n"); - err = TestTurnOnLightForColorControlTests_0(); + ChipLogProgress(chipTool, " ***** Test Step 0 : 1a: TH adjusts the the DUT to a non-open position\n"); + err = Test1aThAdjustsTheTheDutToANonOpenPosition_0(); break; case 1: - ChipLogProgress(chipTool, " ***** Test Step 1 : Check on/off attribute value is true after on command\n"); - err = TestCheckOnOffAttributeValueIsTrueAfterOnCommand_1(); + ChipLogProgress(chipTool, " ***** Test Step 1 : 2a: TH sends UpOrOpen command to DUT\n"); + err = Test2aThSendsUpOrOpenCommandToDut_1(); break; case 2: - ChipLogProgress(chipTool, " ***** Test Step 2 : Move to Color command\n"); - err = TestMoveToColorCommand_2(); - break; - case 3: - ChipLogProgress(chipTool, " ***** Test Step 3 : Move Color command\n"); - err = TestMoveColorCommand_3(); - break; - case 4: - ChipLogProgress(chipTool, " ***** Test Step 4 : Stop Move Step command\n"); - err = TestStopMoveStepCommand_4(); - break; - case 5: - ChipLogProgress(chipTool, " ***** Test Step 5 : Step Color command\n"); - err = TestStepColorCommand_5(); - break; - case 6: - ChipLogProgress(chipTool, " ***** Test Step 6 : Turn off light that we turned on\n"); - err = TestTurnOffLightThatWeTurnedOn_6(); - break; - case 7: - ChipLogProgress(chipTool, " ***** Test Step 7 : Check on/off attribute value is false after off command\n"); - err = TestCheckOnOffAttributeValueIsFalseAfterOffCommand_7(); + ChipLogProgress(chipTool, " ***** Test Step 2 : 3a: TH reads OperationalStatus attribute from DUT\n"); + err = Test3aThReadsOperationalStatusAttributeFromDut_2(); break; } @@ -8689,224 +8542,217 @@ class Test_TC_CC_5 : public TestCommand private: std::atomic_uint16_t mTestIndex; - const uint16_t mTestCount = 8; + const uint16_t mTestCount = 3; chip::Callback::Callback mOnFailureCallback_0{ OnFailureCallback_0, this }; chip::Callback::Callback mOnSuccessCallback_0{ OnSuccessCallback_0, this }; chip::Callback::Callback mOnFailureCallback_1{ OnFailureCallback_1, this }; - chip::Callback::Callback mOnSuccessCallback_1{ OnSuccessCallback_1, this }; + chip::Callback::Callback mOnSuccessCallback_1{ OnSuccessCallback_1, this }; chip::Callback::Callback mOnFailureCallback_2{ OnFailureCallback_2, this }; - chip::Callback::Callback mOnSuccessCallback_2{ OnSuccessCallback_2, this }; - chip::Callback::Callback mOnFailureCallback_3{ OnFailureCallback_3, this }; - chip::Callback::Callback mOnSuccessCallback_3{ OnSuccessCallback_3, this }; - chip::Callback::Callback mOnFailureCallback_4{ OnFailureCallback_4, this }; - chip::Callback::Callback mOnSuccessCallback_4{ OnSuccessCallback_4, this }; - chip::Callback::Callback mOnFailureCallback_5{ OnFailureCallback_5, this }; - chip::Callback::Callback mOnSuccessCallback_5{ OnSuccessCallback_5, this }; - chip::Callback::Callback mOnFailureCallback_6{ OnFailureCallback_6, this }; - chip::Callback::Callback mOnSuccessCallback_6{ OnSuccessCallback_6, this }; - chip::Callback::Callback mOnFailureCallback_7{ OnFailureCallback_7, this }; - chip::Callback::Callback mOnSuccessCallback_7{ OnSuccessCallback_7, this }; + chip::Callback::Callback mOnSuccessCallback_2{ OnSuccessCallback_2, this }; static void OnFailureCallback_0(void * context, uint8_t status) { - (static_cast(context))->OnFailureResponse_0(status); + (static_cast(context))->OnFailureResponse_0(status); } - static void OnSuccessCallback_0(void * context) { (static_cast(context))->OnSuccessResponse_0(); } + static void OnSuccessCallback_0(void * context) { (static_cast(context))->OnSuccessResponse_0(); } static void OnFailureCallback_1(void * context, uint8_t status) { - (static_cast(context))->OnFailureResponse_1(status); + (static_cast(context))->OnFailureResponse_1(status); } - static void OnSuccessCallback_1(void * context, bool onOff) - { - (static_cast(context))->OnSuccessResponse_1(onOff); - } + static void OnSuccessCallback_1(void * context) { (static_cast(context))->OnSuccessResponse_1(); } static void OnFailureCallback_2(void * context, uint8_t status) { - (static_cast(context))->OnFailureResponse_2(status); - } - - static void OnSuccessCallback_2(void * context) { (static_cast(context))->OnSuccessResponse_2(); } - - static void OnFailureCallback_3(void * context, uint8_t status) - { - (static_cast(context))->OnFailureResponse_3(status); - } - - static void OnSuccessCallback_3(void * context) { (static_cast(context))->OnSuccessResponse_3(); } - - static void OnFailureCallback_4(void * context, uint8_t status) - { - (static_cast(context))->OnFailureResponse_4(status); - } - - static void OnSuccessCallback_4(void * context) { (static_cast(context))->OnSuccessResponse_4(); } - - static void OnFailureCallback_5(void * context, uint8_t status) - { - (static_cast(context))->OnFailureResponse_5(status); - } - - static void OnSuccessCallback_5(void * context) { (static_cast(context))->OnSuccessResponse_5(); } - - static void OnFailureCallback_6(void * context, uint8_t status) - { - (static_cast(context))->OnFailureResponse_6(status); - } - - static void OnSuccessCallback_6(void * context) { (static_cast(context))->OnSuccessResponse_6(); } - - static void OnFailureCallback_7(void * context, uint8_t status) - { - (static_cast(context))->OnFailureResponse_7(status); + (static_cast(context))->OnFailureResponse_2(status); } - static void OnSuccessCallback_7(void * context, bool onOff) + static void OnSuccessCallback_2(void * context, uint8_t operationalStatus) { - (static_cast(context))->OnSuccessResponse_7(onOff); + (static_cast(context))->OnSuccessResponse_2(operationalStatus); } // // Tests methods // - CHIP_ERROR TestTurnOnLightForColorControlTests_0() + CHIP_ERROR Test1aThAdjustsTheTheDutToANonOpenPosition_0() { - chip::Controller::OnOffClusterTest cluster; + chip::Controller::WindowCoveringClusterTest cluster; cluster.Associate(mDevice, 1); - return cluster.On(mOnSuccessCallback_0.Cancel(), mOnFailureCallback_0.Cancel()); + return cluster.DownOrClose(mOnSuccessCallback_0.Cancel(), mOnFailureCallback_0.Cancel()); } void OnFailureResponse_0(uint8_t status) { ThrowFailureResponse(); } void OnSuccessResponse_0() { NextTest(); } - CHIP_ERROR TestCheckOnOffAttributeValueIsTrueAfterOnCommand_1() + CHIP_ERROR Test2aThSendsUpOrOpenCommandToDut_1() { - chip::Controller::OnOffClusterTest cluster; + chip::Controller::WindowCoveringClusterTest cluster; cluster.Associate(mDevice, 1); - return cluster.ReadAttributeOnOff(mOnSuccessCallback_1.Cancel(), mOnFailureCallback_1.Cancel()); + return cluster.UpOrOpen(mOnSuccessCallback_1.Cancel(), mOnFailureCallback_1.Cancel()); } void OnFailureResponse_1(uint8_t status) { ThrowFailureResponse(); } - void OnSuccessResponse_1(bool onOff) - { - VerifyOrReturn(CheckValue("onOff", onOff, 1)); - NextTest(); - } + void OnSuccessResponse_1() { NextTest(); } - CHIP_ERROR TestMoveToColorCommand_2() + CHIP_ERROR Test3aThReadsOperationalStatusAttributeFromDut_2() { - chip::Controller::ColorControlClusterTest cluster; + chip::Controller::WindowCoveringClusterTest cluster; cluster.Associate(mDevice, 1); - uint16_t colorXArgument = 200U; - uint16_t colorYArgument = 300U; - uint16_t transitionTimeArgument = 20U; - uint8_t optionsMaskArgument = 0; - uint8_t optionsOverrideArgument = 0; - - return cluster.MoveToColor(mOnSuccessCallback_2.Cancel(), mOnFailureCallback_2.Cancel(), colorXArgument, colorYArgument, - transitionTimeArgument, optionsMaskArgument, optionsOverrideArgument); + return cluster.ReadAttributeOperationalStatus(mOnSuccessCallback_2.Cancel(), mOnFailureCallback_2.Cancel()); } void OnFailureResponse_2(uint8_t status) { ThrowFailureResponse(); } - void OnSuccessResponse_2() { NextTest(); } - - CHIP_ERROR TestMoveColorCommand_3() + void OnSuccessResponse_2(uint8_t operationalStatus) { - chip::Controller::ColorControlClusterTest cluster; - cluster.Associate(mDevice, 1); - - int16_t rateXArgument = 15; - int16_t rateYArgument = 20; - uint8_t optionsMaskArgument = 0; - uint8_t optionsOverrideArgument = 0; - - return cluster.MoveColor(mOnSuccessCallback_3.Cancel(), mOnFailureCallback_3.Cancel(), rateXArgument, rateYArgument, - optionsMaskArgument, optionsOverrideArgument); + VerifyOrReturn(CheckValue("operationalStatus", operationalStatus, 0)); + NextTest(); } +}; - void OnFailureResponse_3(uint8_t status) { ThrowFailureResponse(); } +class Test_TC_WNCV_3_2 : public TestCommand +{ +public: + Test_TC_WNCV_3_2() : TestCommand("Test_TC_WNCV_3_2"), mTestIndex(0) {} - void OnSuccessResponse_3() { NextTest(); } + /////////// TestCommand Interface ///////// + void NextTest() override + { + CHIP_ERROR err = CHIP_NO_ERROR; + + if (0 == mTestIndex) + { + ChipLogProgress(chipTool, " **** Test Start: Test_TC_WNCV_3_2\n"); + } + + if (mTestCount == mTestIndex) + { + ChipLogProgress(chipTool, " **** Test Complete: Test_TC_WNCV_3_2\n"); + SetCommandExitStatus(CHIP_NO_ERROR); + return; + } + + // Ensure we increment mTestIndex before we start running the relevant + // command. That way if we lose the timeslice after we send the message + // but before our function call returns, we won't end up with an + // incorrect mTestIndex value observed when we get the response. + switch (mTestIndex++) + { + case 0: + ChipLogProgress(chipTool, " ***** Test Step 0 : 1a: TH adjusts the the DUT to a non-closed position\n"); + err = Test1aThAdjustsTheTheDutToANonClosedPosition_0(); + break; + case 1: + ChipLogProgress(chipTool, " ***** Test Step 1 : 2a: TH sends DownOrClose command to DUT\n"); + err = Test2aThSendsDownOrCloseCommandToDut_1(); + break; + case 2: + ChipLogProgress(chipTool, " ***** Test Step 2 : 3a: TH reads OperationalStatus attribute from DUT\n"); + err = Test3aThReadsOperationalStatusAttributeFromDut_2(); + break; + } + + if (CHIP_NO_ERROR != err) + { + ChipLogError(chipTool, " ***** Test Failure: %s\n", chip::ErrorStr(err)); + SetCommandExitStatus(err); + } + } + +private: + std::atomic_uint16_t mTestIndex; + const uint16_t mTestCount = 3; + + chip::Callback::Callback mOnFailureCallback_0{ OnFailureCallback_0, this }; + chip::Callback::Callback mOnSuccessCallback_0{ OnSuccessCallback_0, this }; + chip::Callback::Callback mOnFailureCallback_1{ OnFailureCallback_1, this }; + chip::Callback::Callback mOnSuccessCallback_1{ OnSuccessCallback_1, this }; + chip::Callback::Callback mOnFailureCallback_2{ OnFailureCallback_2, this }; + chip::Callback::Callback mOnSuccessCallback_2{ OnSuccessCallback_2, this }; - CHIP_ERROR TestStopMoveStepCommand_4() + static void OnFailureCallback_0(void * context, uint8_t status) { - chip::Controller::ColorControlClusterTest cluster; - cluster.Associate(mDevice, 1); + (static_cast(context))->OnFailureResponse_0(status); + } - uint8_t optionsMaskArgument = 0; - uint8_t optionsOverrideArgument = 0; + static void OnSuccessCallback_0(void * context) { (static_cast(context))->OnSuccessResponse_0(); } - return cluster.StopMoveStep(mOnSuccessCallback_4.Cancel(), mOnFailureCallback_4.Cancel(), optionsMaskArgument, - optionsOverrideArgument); + static void OnFailureCallback_1(void * context, uint8_t status) + { + (static_cast(context))->OnFailureResponse_1(status); } - void OnFailureResponse_4(uint8_t status) { ThrowFailureResponse(); } + static void OnSuccessCallback_1(void * context) { (static_cast(context))->OnSuccessResponse_1(); } - void OnSuccessResponse_4() { NextTest(); } + static void OnFailureCallback_2(void * context, uint8_t status) + { + (static_cast(context))->OnFailureResponse_2(status); + } - CHIP_ERROR TestStepColorCommand_5() + static void OnSuccessCallback_2(void * context, uint8_t operationalStatus) { - chip::Controller::ColorControlClusterTest cluster; - cluster.Associate(mDevice, 1); + (static_cast(context))->OnSuccessResponse_2(operationalStatus); + } - int16_t stepXArgument = 15; - int16_t stepYArgument = 20; - uint16_t transitionTimeArgument = 50U; - uint8_t optionsMaskArgument = 0; - uint8_t optionsOverrideArgument = 0; + // + // Tests methods + // - return cluster.StepColor(mOnSuccessCallback_5.Cancel(), mOnFailureCallback_5.Cancel(), stepXArgument, stepYArgument, - transitionTimeArgument, optionsMaskArgument, optionsOverrideArgument); + CHIP_ERROR Test1aThAdjustsTheTheDutToANonClosedPosition_0() + { + chip::Controller::WindowCoveringClusterTest cluster; + cluster.Associate(mDevice, 1); + + return cluster.UpOrOpen(mOnSuccessCallback_0.Cancel(), mOnFailureCallback_0.Cancel()); } - void OnFailureResponse_5(uint8_t status) { ThrowFailureResponse(); } + void OnFailureResponse_0(uint8_t status) { ThrowFailureResponse(); } - void OnSuccessResponse_5() { NextTest(); } + void OnSuccessResponse_0() { NextTest(); } - CHIP_ERROR TestTurnOffLightThatWeTurnedOn_6() + CHIP_ERROR Test2aThSendsDownOrCloseCommandToDut_1() { - chip::Controller::OnOffClusterTest cluster; + chip::Controller::WindowCoveringClusterTest cluster; cluster.Associate(mDevice, 1); - return cluster.Off(mOnSuccessCallback_6.Cancel(), mOnFailureCallback_6.Cancel()); + return cluster.DownOrClose(mOnSuccessCallback_1.Cancel(), mOnFailureCallback_1.Cancel()); } - void OnFailureResponse_6(uint8_t status) { ThrowFailureResponse(); } + void OnFailureResponse_1(uint8_t status) { ThrowFailureResponse(); } - void OnSuccessResponse_6() { NextTest(); } + void OnSuccessResponse_1() { NextTest(); } - CHIP_ERROR TestCheckOnOffAttributeValueIsFalseAfterOffCommand_7() + CHIP_ERROR Test3aThReadsOperationalStatusAttributeFromDut_2() { - chip::Controller::OnOffClusterTest cluster; + chip::Controller::WindowCoveringClusterTest cluster; cluster.Associate(mDevice, 1); - return cluster.ReadAttributeOnOff(mOnSuccessCallback_7.Cancel(), mOnFailureCallback_7.Cancel()); + return cluster.ReadAttributeOperationalStatus(mOnSuccessCallback_2.Cancel(), mOnFailureCallback_2.Cancel()); } - void OnFailureResponse_7(uint8_t status) { ThrowFailureResponse(); } + void OnFailureResponse_2(uint8_t status) { ThrowFailureResponse(); } - void OnSuccessResponse_7(bool onOff) + void OnSuccessResponse_2(uint8_t operationalStatus) { - VerifyOrReturn(CheckValue("onOff", onOff, 0)); + VerifyOrReturn(CheckValue("operationalStatus", operationalStatus, 0)); NextTest(); } }; -class Test_TC_CC_6 : public TestCommand +class Test_TC_WNCV_3_3 : public TestCommand { public: - Test_TC_CC_6() : TestCommand("Test_TC_CC_6"), mTestIndex(0) {} + Test_TC_WNCV_3_3() : TestCommand("Test_TC_WNCV_3_3"), mTestIndex(0) {} /////////// TestCommand Interface ///////// void NextTest() override @@ -8915,12 +8761,12 @@ class Test_TC_CC_6 : public TestCommand if (0 == mTestIndex) { - ChipLogProgress(chipTool, " **** Test Start: Test_TC_CC_6\n"); + ChipLogProgress(chipTool, " **** Test Start: Test_TC_WNCV_3_3\n"); } if (mTestCount == mTestIndex) { - ChipLogProgress(chipTool, " **** Test Complete: Test_TC_CC_6\n"); + ChipLogProgress(chipTool, " **** Test Complete: Test_TC_WNCV_3_3\n"); SetCommandExitStatus(CHIP_NO_ERROR); return; } @@ -8932,44 +8778,16 @@ class Test_TC_CC_6 : public TestCommand switch (mTestIndex++) { case 0: - ChipLogProgress(chipTool, " ***** Test Step 0 : Turn on light for color control tests\n"); - err = TestTurnOnLightForColorControlTests_0(); + ChipLogProgress(chipTool, " ***** Test Step 0 : 1a: TH adjusts the the DUT to a non-open position\n"); + err = Test1aThAdjustsTheTheDutToANonOpenPosition_0(); break; case 1: - ChipLogProgress(chipTool, " ***** Test Step 1 : Check on/off attribute value is true after on command\n"); - err = TestCheckOnOffAttributeValueIsTrueAfterOnCommand_1(); + ChipLogProgress(chipTool, " ***** Test Step 1 : 2a: TH sends StopMotion command to DUT\n"); + err = Test2aThSendsStopMotionCommandToDut_1(); break; case 2: - ChipLogProgress(chipTool, " ***** Test Step 2 : Move To Color Temperature command\n"); - err = TestMoveToColorTemperatureCommand_2(); - break; - case 3: - ChipLogProgress(chipTool, " ***** Test Step 3 : Move up color temperature command\n"); - err = TestMoveUpColorTemperatureCommand_3(); - break; - case 4: - ChipLogProgress(chipTool, " ***** Test Step 4 : Stop Color Temperature command\n"); - err = TestStopColorTemperatureCommand_4(); - break; - case 5: - ChipLogProgress(chipTool, " ***** Test Step 5 : Move down color temperature command\n"); - err = TestMoveDownColorTemperatureCommand_5(); - break; - case 6: - ChipLogProgress(chipTool, " ***** Test Step 6 : Step up color temperature command\n"); - err = TestStepUpColorTemperatureCommand_6(); - break; - case 7: - ChipLogProgress(chipTool, " ***** Test Step 7 : Step down color temperature command\n"); - err = TestStepDownColorTemperatureCommand_7(); - break; - case 8: - ChipLogProgress(chipTool, " ***** Test Step 8 : Turn off light that we turned on\n"); - err = TestTurnOffLightThatWeTurnedOn_8(); - break; - case 9: - ChipLogProgress(chipTool, " ***** Test Step 9 : Check on/off attribute value is false after off command\n"); - err = TestCheckOnOffAttributeValueIsFalseAfterOffCommand_9(); + ChipLogProgress(chipTool, " ***** Test Step 2 : 2b: TH reads OperationalStatus attribute from DUT\n"); + err = Test2bThReadsOperationalStatusAttributeFromDut_2(); break; } @@ -8982,296 +8800,88 @@ class Test_TC_CC_6 : public TestCommand private: std::atomic_uint16_t mTestIndex; - const uint16_t mTestCount = 10; + const uint16_t mTestCount = 3; chip::Callback::Callback mOnFailureCallback_0{ OnFailureCallback_0, this }; chip::Callback::Callback mOnSuccessCallback_0{ OnSuccessCallback_0, this }; chip::Callback::Callback mOnFailureCallback_1{ OnFailureCallback_1, this }; - chip::Callback::Callback mOnSuccessCallback_1{ OnSuccessCallback_1, this }; + chip::Callback::Callback mOnSuccessCallback_1{ OnSuccessCallback_1, this }; chip::Callback::Callback mOnFailureCallback_2{ OnFailureCallback_2, this }; - chip::Callback::Callback mOnSuccessCallback_2{ OnSuccessCallback_2, this }; - chip::Callback::Callback mOnFailureCallback_3{ OnFailureCallback_3, this }; - chip::Callback::Callback mOnSuccessCallback_3{ OnSuccessCallback_3, this }; - chip::Callback::Callback mOnFailureCallback_4{ OnFailureCallback_4, this }; - chip::Callback::Callback mOnSuccessCallback_4{ OnSuccessCallback_4, this }; - chip::Callback::Callback mOnFailureCallback_5{ OnFailureCallback_5, this }; - chip::Callback::Callback mOnSuccessCallback_5{ OnSuccessCallback_5, this }; - chip::Callback::Callback mOnFailureCallback_6{ OnFailureCallback_6, this }; - chip::Callback::Callback mOnSuccessCallback_6{ OnSuccessCallback_6, this }; - chip::Callback::Callback mOnFailureCallback_7{ OnFailureCallback_7, this }; - chip::Callback::Callback mOnSuccessCallback_7{ OnSuccessCallback_7, this }; - chip::Callback::Callback mOnFailureCallback_8{ OnFailureCallback_8, this }; - chip::Callback::Callback mOnSuccessCallback_8{ OnSuccessCallback_8, this }; - chip::Callback::Callback mOnFailureCallback_9{ OnFailureCallback_9, this }; - chip::Callback::Callback mOnSuccessCallback_9{ OnSuccessCallback_9, this }; + chip::Callback::Callback mOnSuccessCallback_2{ OnSuccessCallback_2, this }; static void OnFailureCallback_0(void * context, uint8_t status) { - (static_cast(context))->OnFailureResponse_0(status); + (static_cast(context))->OnFailureResponse_0(status); } - static void OnSuccessCallback_0(void * context) { (static_cast(context))->OnSuccessResponse_0(); } + static void OnSuccessCallback_0(void * context) { (static_cast(context))->OnSuccessResponse_0(); } static void OnFailureCallback_1(void * context, uint8_t status) { - (static_cast(context))->OnFailureResponse_1(status); + (static_cast(context))->OnFailureResponse_1(status); } - static void OnSuccessCallback_1(void * context, bool onOff) - { - (static_cast(context))->OnSuccessResponse_1(onOff); - } + static void OnSuccessCallback_1(void * context) { (static_cast(context))->OnSuccessResponse_1(); } static void OnFailureCallback_2(void * context, uint8_t status) { - (static_cast(context))->OnFailureResponse_2(status); - } - - static void OnSuccessCallback_2(void * context) { (static_cast(context))->OnSuccessResponse_2(); } - - static void OnFailureCallback_3(void * context, uint8_t status) - { - (static_cast(context))->OnFailureResponse_3(status); - } - - static void OnSuccessCallback_3(void * context) { (static_cast(context))->OnSuccessResponse_3(); } - - static void OnFailureCallback_4(void * context, uint8_t status) - { - (static_cast(context))->OnFailureResponse_4(status); - } - - static void OnSuccessCallback_4(void * context) { (static_cast(context))->OnSuccessResponse_4(); } - - static void OnFailureCallback_5(void * context, uint8_t status) - { - (static_cast(context))->OnFailureResponse_5(status); - } - - static void OnSuccessCallback_5(void * context) { (static_cast(context))->OnSuccessResponse_5(); } - - static void OnFailureCallback_6(void * context, uint8_t status) - { - (static_cast(context))->OnFailureResponse_6(status); - } - - static void OnSuccessCallback_6(void * context) { (static_cast(context))->OnSuccessResponse_6(); } - - static void OnFailureCallback_7(void * context, uint8_t status) - { - (static_cast(context))->OnFailureResponse_7(status); - } - - static void OnSuccessCallback_7(void * context) { (static_cast(context))->OnSuccessResponse_7(); } - - static void OnFailureCallback_8(void * context, uint8_t status) - { - (static_cast(context))->OnFailureResponse_8(status); - } - - static void OnSuccessCallback_8(void * context) { (static_cast(context))->OnSuccessResponse_8(); } - - static void OnFailureCallback_9(void * context, uint8_t status) - { - (static_cast(context))->OnFailureResponse_9(status); + (static_cast(context))->OnFailureResponse_2(status); } - static void OnSuccessCallback_9(void * context, bool onOff) + static void OnSuccessCallback_2(void * context, uint8_t operationalStatus) { - (static_cast(context))->OnSuccessResponse_9(onOff); + (static_cast(context))->OnSuccessResponse_2(operationalStatus); } // // Tests methods // - CHIP_ERROR TestTurnOnLightForColorControlTests_0() + CHIP_ERROR Test1aThAdjustsTheTheDutToANonOpenPosition_0() { - chip::Controller::OnOffClusterTest cluster; + chip::Controller::WindowCoveringClusterTest cluster; cluster.Associate(mDevice, 1); - return cluster.On(mOnSuccessCallback_0.Cancel(), mOnFailureCallback_0.Cancel()); + return cluster.UpOrOpen(mOnSuccessCallback_0.Cancel(), mOnFailureCallback_0.Cancel()); } void OnFailureResponse_0(uint8_t status) { ThrowFailureResponse(); } void OnSuccessResponse_0() { NextTest(); } - CHIP_ERROR TestCheckOnOffAttributeValueIsTrueAfterOnCommand_1() + CHIP_ERROR Test2aThSendsStopMotionCommandToDut_1() { - chip::Controller::OnOffClusterTest cluster; + chip::Controller::WindowCoveringClusterTest cluster; cluster.Associate(mDevice, 1); - return cluster.ReadAttributeOnOff(mOnSuccessCallback_1.Cancel(), mOnFailureCallback_1.Cancel()); + return cluster.StopMotion(mOnSuccessCallback_1.Cancel(), mOnFailureCallback_1.Cancel()); } void OnFailureResponse_1(uint8_t status) { ThrowFailureResponse(); } - void OnSuccessResponse_1(bool onOff) - { - VerifyOrReturn(CheckValue("onOff", onOff, 1)); - NextTest(); - } + void OnSuccessResponse_1() { NextTest(); } - CHIP_ERROR TestMoveToColorTemperatureCommand_2() + CHIP_ERROR Test2bThReadsOperationalStatusAttributeFromDut_2() { - chip::Controller::ColorControlClusterTest cluster; + chip::Controller::WindowCoveringClusterTest cluster; cluster.Associate(mDevice, 1); - uint16_t colorTemperatureArgument = 100U; - uint16_t transitionTimeArgument = 10U; - uint8_t optionsMaskArgument = 0; - uint8_t optionsOverrideArgument = 0; - - return cluster.MoveToColorTemperature(mOnSuccessCallback_2.Cancel(), mOnFailureCallback_2.Cancel(), - colorTemperatureArgument, transitionTimeArgument, optionsMaskArgument, - optionsOverrideArgument); + return cluster.ReadAttributeOperationalStatus(mOnSuccessCallback_2.Cancel(), mOnFailureCallback_2.Cancel()); } void OnFailureResponse_2(uint8_t status) { ThrowFailureResponse(); } - void OnSuccessResponse_2() { NextTest(); } - - CHIP_ERROR TestMoveUpColorTemperatureCommand_3() + void OnSuccessResponse_2(uint8_t operationalStatus) { - chip::Controller::ColorControlClusterTest cluster; - cluster.Associate(mDevice, 1); - - uint8_t moveModeArgument = 1; - uint16_t rateArgument = 10U; - uint16_t colorTemperatureMinimumArgument = 1U; - uint16_t colorTemperatureMaximumArgument = 255U; - uint8_t optionsMaskArgument = 0; - uint8_t optionsOverrideArgument = 0; - - return cluster.MoveColorTemperature(mOnSuccessCallback_3.Cancel(), mOnFailureCallback_3.Cancel(), moveModeArgument, - rateArgument, colorTemperatureMinimumArgument, colorTemperatureMaximumArgument, - optionsMaskArgument, optionsOverrideArgument); - } - - void OnFailureResponse_3(uint8_t status) { ThrowFailureResponse(); } - - void OnSuccessResponse_3() { NextTest(); } - - CHIP_ERROR TestStopColorTemperatureCommand_4() - { - chip::Controller::ColorControlClusterTest cluster; - cluster.Associate(mDevice, 1); - - uint8_t moveModeArgument = 0; - uint16_t rateArgument = 10U; - uint16_t colorTemperatureMinimumArgument = 1U; - uint16_t colorTemperatureMaximumArgument = 255U; - uint8_t optionsMaskArgument = 0; - uint8_t optionsOverrideArgument = 0; - - return cluster.MoveColorTemperature(mOnSuccessCallback_4.Cancel(), mOnFailureCallback_4.Cancel(), moveModeArgument, - rateArgument, colorTemperatureMinimumArgument, colorTemperatureMaximumArgument, - optionsMaskArgument, optionsOverrideArgument); - } - - void OnFailureResponse_4(uint8_t status) { ThrowFailureResponse(); } - - void OnSuccessResponse_4() { NextTest(); } - - CHIP_ERROR TestMoveDownColorTemperatureCommand_5() - { - chip::Controller::ColorControlClusterTest cluster; - cluster.Associate(mDevice, 1); - - uint8_t moveModeArgument = 3; - uint16_t rateArgument = 20U; - uint16_t colorTemperatureMinimumArgument = 1U; - uint16_t colorTemperatureMaximumArgument = 255U; - uint8_t optionsMaskArgument = 0; - uint8_t optionsOverrideArgument = 0; - - return cluster.MoveColorTemperature(mOnSuccessCallback_5.Cancel(), mOnFailureCallback_5.Cancel(), moveModeArgument, - rateArgument, colorTemperatureMinimumArgument, colorTemperatureMaximumArgument, - optionsMaskArgument, optionsOverrideArgument); - } - - void OnFailureResponse_5(uint8_t status) { ThrowFailureResponse(); } - - void OnSuccessResponse_5() { NextTest(); } - - CHIP_ERROR TestStepUpColorTemperatureCommand_6() - { - chip::Controller::ColorControlClusterTest cluster; - cluster.Associate(mDevice, 1); - - uint8_t stepModeArgument = 1; - uint16_t stepSizeArgument = 5U; - uint16_t transitionTimeArgument = 50U; - uint16_t colorTemperatureMinimumArgument = 5U; - uint16_t colorTemperatureMaximumArgument = 100U; - uint8_t optionsMaskArgument = 0; - uint8_t optionsOverrideArgument = 0; - - return cluster.StepColorTemperature(mOnSuccessCallback_6.Cancel(), mOnFailureCallback_6.Cancel(), stepModeArgument, - stepSizeArgument, transitionTimeArgument, colorTemperatureMinimumArgument, - colorTemperatureMaximumArgument, optionsMaskArgument, optionsOverrideArgument); - } - - void OnFailureResponse_6(uint8_t status) { ThrowFailureResponse(); } - - void OnSuccessResponse_6() { NextTest(); } - - CHIP_ERROR TestStepDownColorTemperatureCommand_7() - { - chip::Controller::ColorControlClusterTest cluster; - cluster.Associate(mDevice, 1); - - uint8_t stepModeArgument = 3; - uint16_t stepSizeArgument = 5U; - uint16_t transitionTimeArgument = 50U; - uint16_t colorTemperatureMinimumArgument = 5U; - uint16_t colorTemperatureMaximumArgument = 100U; - uint8_t optionsMaskArgument = 0; - uint8_t optionsOverrideArgument = 0; - - return cluster.StepColorTemperature(mOnSuccessCallback_7.Cancel(), mOnFailureCallback_7.Cancel(), stepModeArgument, - stepSizeArgument, transitionTimeArgument, colorTemperatureMinimumArgument, - colorTemperatureMaximumArgument, optionsMaskArgument, optionsOverrideArgument); - } - - void OnFailureResponse_7(uint8_t status) { ThrowFailureResponse(); } - - void OnSuccessResponse_7() { NextTest(); } - - CHIP_ERROR TestTurnOffLightThatWeTurnedOn_8() - { - chip::Controller::OnOffClusterTest cluster; - cluster.Associate(mDevice, 1); - - return cluster.Off(mOnSuccessCallback_8.Cancel(), mOnFailureCallback_8.Cancel()); - } - - void OnFailureResponse_8(uint8_t status) { ThrowFailureResponse(); } - - void OnSuccessResponse_8() { NextTest(); } - - CHIP_ERROR TestCheckOnOffAttributeValueIsFalseAfterOffCommand_9() - { - chip::Controller::OnOffClusterTest cluster; - cluster.Associate(mDevice, 1); - - return cluster.ReadAttributeOnOff(mOnSuccessCallback_9.Cancel(), mOnFailureCallback_9.Cancel()); - } - - void OnFailureResponse_9(uint8_t status) { ThrowFailureResponse(); } - - void OnSuccessResponse_9(bool onOff) - { - VerifyOrReturn(CheckValue("onOff", onOff, 0)); + VerifyOrReturn(CheckValue("operationalStatus", operationalStatus, 0)); NextTest(); } }; -class Test_TC_CC_7 : public TestCommand +class Test_TC_BI_1_1 : public TestCommand { public: - Test_TC_CC_7() : TestCommand("Test_TC_CC_7"), mTestIndex(0) {} + Test_TC_BI_1_1() : TestCommand("Test_TC_BI_1_1"), mTestIndex(0) {} /////////// TestCommand Interface ///////// void NextTest() override @@ -9280,12 +8890,12 @@ class Test_TC_CC_7 : public TestCommand if (0 == mTestIndex) { - ChipLogProgress(chipTool, " **** Test Start: Test_TC_CC_7\n"); + ChipLogProgress(chipTool, " **** Test Start: Test_TC_BI_1_1\n"); } if (mTestCount == mTestIndex) { - ChipLogProgress(chipTool, " **** Test Complete: Test_TC_CC_7\n"); + ChipLogProgress(chipTool, " **** Test Complete: Test_TC_BI_1_1\n"); SetCommandExitStatus(CHIP_NO_ERROR); return; } @@ -9297,57 +8907,17 @@ class Test_TC_CC_7 : public TestCommand switch (mTestIndex++) { case 0: - ChipLogProgress(chipTool, " ***** Test Step 0 : Turn on light for color control tests\n"); - err = TestTurnOnLightForColorControlTests_0(); + ChipLogProgress(chipTool, " ***** Test Step 0 : read the global attribute: ClusterRevision\n"); + err = TestReadTheGlobalAttributeClusterRevision_0(); break; case 1: - ChipLogProgress(chipTool, " ***** Test Step 1 : Check on/off attribute value is true after on command\n"); - err = TestCheckOnOffAttributeValueIsTrueAfterOnCommand_1(); + ChipLogProgress(chipTool, + " ***** Test Step 1 : write the default values to mandatory global attribute: ClusterRevision\n"); + err = TestWriteTheDefaultValuesToMandatoryGlobalAttributeClusterRevision_1(); break; case 2: - ChipLogProgress(chipTool, " ***** Test Step 2 : Enhanced Move To Hue command\n"); - err = TestEnhancedMoveToHueCommand_2(); - break; - case 3: - ChipLogProgress( - chipTool, " ***** Test Step 3 : Check Remaining time attribute value matched the value sent by the last command\n"); - err = TestCheckRemainingTimeAttributeValueMatchedTheValueSentByTheLastCommand_3(); - break; - case 4: - ChipLogProgress(chipTool, " ***** Test Step 4 : Enhanced Move Hue Down command \n"); - err = TestEnhancedMoveHueDownCommand_4(); - break; - case 5: - ChipLogProgress(chipTool, " ***** Test Step 5 : Enhanced Move Hue Stop command\n"); - err = TestEnhancedMoveHueStopCommand_5(); - break; - case 6: - ChipLogProgress(chipTool, " ***** Test Step 6 : Enhanced Move Hue Up command\n"); - err = TestEnhancedMoveHueUpCommand_6(); - break; - case 7: - ChipLogProgress(chipTool, " ***** Test Step 7 : Enhanced Move Hue Stop command\n"); - err = TestEnhancedMoveHueStopCommand_7(); - break; - case 8: - ChipLogProgress(chipTool, " ***** Test Step 8 : Enhanced Step Hue Up command\n"); - err = TestEnhancedStepHueUpCommand_8(); - break; - case 9: - ChipLogProgress(chipTool, " ***** Test Step 9 : Enhanced Step Hue Down command\n"); - err = TestEnhancedStepHueDownCommand_9(); - break; - case 10: - ChipLogProgress(chipTool, " ***** Test Step 10 : Enhanced move to hue and saturation command\n"); - err = TestEnhancedMoveToHueAndSaturationCommand_10(); - break; - case 11: - ChipLogProgress(chipTool, " ***** Test Step 11 : Turn off light that we turned on\n"); - err = TestTurnOffLightThatWeTurnedOn_11(); - break; - case 12: - ChipLogProgress(chipTool, " ***** Test Step 12 : Check on/off attribute value is false after off command\n"); - err = TestCheckOnOffAttributeValueIsFalseAfterOffCommand_12(); + ChipLogProgress(chipTool, " ***** Test Step 2 : reads back global attribute: ClusterRevision\n"); + err = TestReadsBackGlobalAttributeClusterRevision_2(); break; } @@ -9360,133 +8930,3075 @@ class Test_TC_CC_7 : public TestCommand private: std::atomic_uint16_t mTestIndex; - const uint16_t mTestCount = 13; + const uint16_t mTestCount = 3; chip::Callback::Callback mOnFailureCallback_0{ OnFailureCallback_0, this }; - chip::Callback::Callback mOnSuccessCallback_0{ OnSuccessCallback_0, this }; + chip::Callback::Callback mOnSuccessCallback_0{ OnSuccessCallback_0, this }; chip::Callback::Callback mOnFailureCallback_1{ OnFailureCallback_1, this }; - chip::Callback::Callback mOnSuccessCallback_1{ OnSuccessCallback_1, this }; + chip::Callback::Callback mOnSuccessCallback_1{ OnSuccessCallback_1, this }; chip::Callback::Callback mOnFailureCallback_2{ OnFailureCallback_2, this }; - chip::Callback::Callback mOnSuccessCallback_2{ OnSuccessCallback_2, this }; - chip::Callback::Callback mOnFailureCallback_3{ OnFailureCallback_3, this }; - chip::Callback::Callback mOnSuccessCallback_3{ OnSuccessCallback_3, this }; - chip::Callback::Callback mOnFailureCallback_4{ OnFailureCallback_4, this }; - chip::Callback::Callback mOnSuccessCallback_4{ OnSuccessCallback_4, this }; - chip::Callback::Callback mOnFailureCallback_5{ OnFailureCallback_5, this }; - chip::Callback::Callback mOnSuccessCallback_5{ OnSuccessCallback_5, this }; - chip::Callback::Callback mOnFailureCallback_6{ OnFailureCallback_6, this }; - chip::Callback::Callback mOnSuccessCallback_6{ OnSuccessCallback_6, this }; - chip::Callback::Callback mOnFailureCallback_7{ OnFailureCallback_7, this }; - chip::Callback::Callback mOnSuccessCallback_7{ OnSuccessCallback_7, this }; - chip::Callback::Callback mOnFailureCallback_8{ OnFailureCallback_8, this }; - chip::Callback::Callback mOnSuccessCallback_8{ OnSuccessCallback_8, this }; - chip::Callback::Callback mOnFailureCallback_9{ OnFailureCallback_9, this }; - chip::Callback::Callback mOnSuccessCallback_9{ OnSuccessCallback_9, this }; - chip::Callback::Callback mOnFailureCallback_10{ OnFailureCallback_10, this }; - chip::Callback::Callback mOnSuccessCallback_10{ OnSuccessCallback_10, this }; - chip::Callback::Callback mOnFailureCallback_11{ OnFailureCallback_11, this }; - chip::Callback::Callback mOnSuccessCallback_11{ OnSuccessCallback_11, this }; - chip::Callback::Callback mOnFailureCallback_12{ OnFailureCallback_12, this }; - chip::Callback::Callback mOnSuccessCallback_12{ OnSuccessCallback_12, this }; + chip::Callback::Callback mOnSuccessCallback_2{ OnSuccessCallback_2, this }; static void OnFailureCallback_0(void * context, uint8_t status) { - (static_cast(context))->OnFailureResponse_0(status); + (static_cast(context))->OnFailureResponse_0(status); } - static void OnSuccessCallback_0(void * context) { (static_cast(context))->OnSuccessResponse_0(); } + static void OnSuccessCallback_0(void * context, uint16_t clusterRevision) + { + (static_cast(context))->OnSuccessResponse_0(clusterRevision); + } static void OnFailureCallback_1(void * context, uint8_t status) { - (static_cast(context))->OnFailureResponse_1(status); + (static_cast(context))->OnFailureResponse_1(status); } - static void OnSuccessCallback_1(void * context, bool onOff) + static void OnSuccessCallback_1(void * context, uint16_t clusterRevision) { - (static_cast(context))->OnSuccessResponse_1(onOff); + (static_cast(context))->OnSuccessResponse_1(clusterRevision); } static void OnFailureCallback_2(void * context, uint8_t status) { - (static_cast(context))->OnFailureResponse_2(status); + (static_cast(context))->OnFailureResponse_2(status); } - static void OnSuccessCallback_2(void * context) { (static_cast(context))->OnSuccessResponse_2(); } - - static void OnFailureCallback_3(void * context, uint8_t status) + static void OnSuccessCallback_2(void * context, uint16_t clusterRevision) { - (static_cast(context))->OnFailureResponse_3(status); + (static_cast(context))->OnSuccessResponse_2(clusterRevision); } - static void OnSuccessCallback_3(void * context, uint16_t remainingTime) - { - (static_cast(context))->OnSuccessResponse_3(remainingTime); - } + // + // Tests methods + // - static void OnFailureCallback_4(void * context, uint8_t status) + CHIP_ERROR TestReadTheGlobalAttributeClusterRevision_0() { - (static_cast(context))->OnFailureResponse_4(status); - } - - static void OnSuccessCallback_4(void * context) { (static_cast(context))->OnSuccessResponse_4(); } + chip::Controller::BinaryInputBasicClusterTest cluster; + cluster.Associate(mDevice, 1); - static void OnFailureCallback_5(void * context, uint8_t status) - { - (static_cast(context))->OnFailureResponse_5(status); + return cluster.ReadAttributeClusterRevision(mOnSuccessCallback_0.Cancel(), mOnFailureCallback_0.Cancel()); } - static void OnSuccessCallback_5(void * context) { (static_cast(context))->OnSuccessResponse_5(); } + void OnFailureResponse_0(uint8_t status) { ThrowFailureResponse(); } - static void OnFailureCallback_6(void * context, uint8_t status) + void OnSuccessResponse_0(uint16_t clusterRevision) { - (static_cast(context))->OnFailureResponse_6(status); + VerifyOrReturn(CheckValue("clusterRevision", clusterRevision, 1U)); + NextTest(); } - static void OnSuccessCallback_6(void * context) { (static_cast(context))->OnSuccessResponse_6(); } - - static void OnFailureCallback_7(void * context, uint8_t status) + CHIP_ERROR TestWriteTheDefaultValuesToMandatoryGlobalAttributeClusterRevision_1() { - (static_cast(context))->OnFailureResponse_7(status); - } + chip::Controller::BinaryInputBasicClusterTest cluster; + cluster.Associate(mDevice, 1); - static void OnSuccessCallback_7(void * context) { (static_cast(context))->OnSuccessResponse_7(); } + uint16_t clusterRevisionArgument = 1U; - static void OnFailureCallback_8(void * context, uint8_t status) - { - (static_cast(context))->OnFailureResponse_8(status); + return cluster.WriteAttributeClusterRevision(mOnSuccessCallback_1.Cancel(), mOnFailureCallback_1.Cancel(), + clusterRevisionArgument); } - static void OnSuccessCallback_8(void * context) { (static_cast(context))->OnSuccessResponse_8(); } + void OnFailureResponse_1(uint8_t status) { NextTest(); } - static void OnFailureCallback_9(void * context, uint8_t status) + void OnSuccessResponse_1(uint16_t clusterRevision) { ThrowSuccessResponse(); } + + CHIP_ERROR TestReadsBackGlobalAttributeClusterRevision_2() { - (static_cast(context))->OnFailureResponse_9(status); + chip::Controller::BinaryInputBasicClusterTest cluster; + cluster.Associate(mDevice, 1); + + return cluster.ReadAttributeClusterRevision(mOnSuccessCallback_2.Cancel(), mOnFailureCallback_2.Cancel()); } - static void OnSuccessCallback_9(void * context) { (static_cast(context))->OnSuccessResponse_9(); } + void OnFailureResponse_2(uint8_t status) { ThrowFailureResponse(); } - static void OnFailureCallback_10(void * context, uint8_t status) + void OnSuccessResponse_2(uint16_t clusterRevision) { - (static_cast(context))->OnFailureResponse_10(status); + VerifyOrReturn(CheckValue("clusterRevision", clusterRevision, 1U)); + NextTest(); } +}; - static void OnSuccessCallback_10(void * context) { (static_cast(context))->OnSuccessResponse_10(); } +class Test_TC_FLW_1_1 : public TestCommand +{ +public: + Test_TC_FLW_1_1() : TestCommand("Test_TC_FLW_1_1"), mTestIndex(0) {} - static void OnFailureCallback_11(void * context, uint8_t status) + /////////// TestCommand Interface ///////// + void NextTest() override { - (static_cast(context))->OnFailureResponse_11(status); - } + CHIP_ERROR err = CHIP_NO_ERROR; - static void OnSuccessCallback_11(void * context) { (static_cast(context))->OnSuccessResponse_11(); } + if (0 == mTestIndex) + { + ChipLogProgress(chipTool, " **** Test Start: Test_TC_FLW_1_1\n"); + } + + if (mTestCount == mTestIndex) + { + ChipLogProgress(chipTool, " **** Test Complete: Test_TC_FLW_1_1\n"); + SetCommandExitStatus(CHIP_NO_ERROR); + return; + } + + // Ensure we increment mTestIndex before we start running the relevant + // command. That way if we lose the timeslice after we send the message + // but before our function call returns, we won't end up with an + // incorrect mTestIndex value observed when we get the response. + switch (mTestIndex++) + { + case 0: + ChipLogProgress(chipTool, + " ***** Test Step 0 : write the default values to mandatory global attribute: ClusterRevision\n"); + err = TestWriteTheDefaultValuesToMandatoryGlobalAttributeClusterRevision_0(); + break; + } + + if (CHIP_NO_ERROR != err) + { + ChipLogError(chipTool, " ***** Test Failure: %s\n", chip::ErrorStr(err)); + SetCommandExitStatus(err); + } + } + +private: + std::atomic_uint16_t mTestIndex; + const uint16_t mTestCount = 1; + + chip::Callback::Callback mOnFailureCallback_0{ OnFailureCallback_0, this }; + chip::Callback::Callback mOnSuccessCallback_0{ OnSuccessCallback_0, this }; + + static void OnFailureCallback_0(void * context, uint8_t status) + { + (static_cast(context))->OnFailureResponse_0(status); + } + + static void OnSuccessCallback_0(void * context, uint16_t clusterRevision) + { + (static_cast(context))->OnSuccessResponse_0(clusterRevision); + } + + // + // Tests methods + // + + CHIP_ERROR TestWriteTheDefaultValuesToMandatoryGlobalAttributeClusterRevision_0() + { + chip::Controller::FlowMeasurementClusterTest cluster; + cluster.Associate(mDevice, 1); + + uint16_t clusterRevisionArgument = 2U; + + return cluster.WriteAttributeClusterRevision(mOnSuccessCallback_0.Cancel(), mOnFailureCallback_0.Cancel(), + clusterRevisionArgument); + } + + void OnFailureResponse_0(uint8_t status) { NextTest(); } + + void OnSuccessResponse_0(uint16_t clusterRevision) { ThrowSuccessResponse(); } +}; + +class Test_TC_TM_1_1 : public TestCommand +{ +public: + Test_TC_TM_1_1() : TestCommand("Test_TC_TM_1_1"), mTestIndex(0) {} + + /////////// TestCommand Interface ///////// + void NextTest() override + { + CHIP_ERROR err = CHIP_NO_ERROR; + + if (0 == mTestIndex) + { + ChipLogProgress(chipTool, " **** Test Start: Test_TC_TM_1_1\n"); + } + + if (mTestCount == mTestIndex) + { + ChipLogProgress(chipTool, " **** Test Complete: Test_TC_TM_1_1\n"); + SetCommandExitStatus(CHIP_NO_ERROR); + return; + } + + // Ensure we increment mTestIndex before we start running the relevant + // command. That way if we lose the timeslice after we send the message + // but before our function call returns, we won't end up with an + // incorrect mTestIndex value observed when we get the response. + switch (mTestIndex++) + { + case 0: + ChipLogProgress(chipTool, " ***** Test Step 0 : read the global attribute: ClusterRevision\n"); + err = TestReadTheGlobalAttributeClusterRevision_0(); + break; + case 1: + ChipLogProgress(chipTool, + " ***** Test Step 1 : write the default values to mandatory global attribute: ClusterRevision\n"); + err = TestWriteTheDefaultValuesToMandatoryGlobalAttributeClusterRevision_1(); + break; + case 2: + ChipLogProgress(chipTool, " ***** Test Step 2 : reads back global attribute: ClusterRevision\n"); + err = TestReadsBackGlobalAttributeClusterRevision_2(); + break; + } + + if (CHIP_NO_ERROR != err) + { + ChipLogError(chipTool, " ***** Test Failure: %s\n", chip::ErrorStr(err)); + SetCommandExitStatus(err); + } + } + +private: + std::atomic_uint16_t mTestIndex; + const uint16_t mTestCount = 3; + + chip::Callback::Callback mOnFailureCallback_0{ OnFailureCallback_0, this }; + chip::Callback::Callback mOnSuccessCallback_0{ OnSuccessCallback_0, this }; + chip::Callback::Callback mOnFailureCallback_1{ OnFailureCallback_1, this }; + chip::Callback::Callback mOnSuccessCallback_1{ OnSuccessCallback_1, this }; + chip::Callback::Callback mOnFailureCallback_2{ OnFailureCallback_2, this }; + chip::Callback::Callback mOnSuccessCallback_2{ OnSuccessCallback_2, this }; + + static void OnFailureCallback_0(void * context, uint8_t status) + { + (static_cast(context))->OnFailureResponse_0(status); + } + + static void OnSuccessCallback_0(void * context, uint16_t clusterRevision) + { + (static_cast(context))->OnSuccessResponse_0(clusterRevision); + } + + static void OnFailureCallback_1(void * context, uint8_t status) + { + (static_cast(context))->OnFailureResponse_1(status); + } + + static void OnSuccessCallback_1(void * context, uint16_t clusterRevision) + { + (static_cast(context))->OnSuccessResponse_1(clusterRevision); + } + + static void OnFailureCallback_2(void * context, uint8_t status) + { + (static_cast(context))->OnFailureResponse_2(status); + } + + static void OnSuccessCallback_2(void * context, uint16_t clusterRevision) + { + (static_cast(context))->OnSuccessResponse_2(clusterRevision); + } + + // + // Tests methods + // + + CHIP_ERROR TestReadTheGlobalAttributeClusterRevision_0() + { + chip::Controller::TemperatureMeasurementClusterTest cluster; + cluster.Associate(mDevice, 1); + + return cluster.ReadAttributeClusterRevision(mOnSuccessCallback_0.Cancel(), mOnFailureCallback_0.Cancel()); + } + + void OnFailureResponse_0(uint8_t status) { ThrowFailureResponse(); } + + void OnSuccessResponse_0(uint16_t clusterRevision) + { + VerifyOrReturn(CheckValue("clusterRevision", clusterRevision, 3U)); + NextTest(); + } + + CHIP_ERROR TestWriteTheDefaultValuesToMandatoryGlobalAttributeClusterRevision_1() + { + chip::Controller::TemperatureMeasurementClusterTest cluster; + cluster.Associate(mDevice, 1); + + uint16_t clusterRevisionArgument = 3U; + + return cluster.WriteAttributeClusterRevision(mOnSuccessCallback_1.Cancel(), mOnFailureCallback_1.Cancel(), + clusterRevisionArgument); + } + + void OnFailureResponse_1(uint8_t status) { NextTest(); } + + void OnSuccessResponse_1(uint16_t clusterRevision) { ThrowSuccessResponse(); } + + CHIP_ERROR TestReadsBackGlobalAttributeClusterRevision_2() + { + chip::Controller::TemperatureMeasurementClusterTest cluster; + cluster.Associate(mDevice, 1); + + return cluster.ReadAttributeClusterRevision(mOnSuccessCallback_2.Cancel(), mOnFailureCallback_2.Cancel()); + } + + void OnFailureResponse_2(uint8_t status) { ThrowFailureResponse(); } + + void OnSuccessResponse_2(uint16_t clusterRevision) + { + VerifyOrReturn(CheckValue("clusterRevision", clusterRevision, 3U)); + NextTest(); + } +}; + +class Test_TC_OCC_1_1 : public TestCommand +{ +public: + Test_TC_OCC_1_1() : TestCommand("Test_TC_OCC_1_1"), mTestIndex(0) {} + + /////////// TestCommand Interface ///////// + void NextTest() override + { + CHIP_ERROR err = CHIP_NO_ERROR; + + if (0 == mTestIndex) + { + ChipLogProgress(chipTool, " **** Test Start: Test_TC_OCC_1_1\n"); + } + + if (mTestCount == mTestIndex) + { + ChipLogProgress(chipTool, " **** Test Complete: Test_TC_OCC_1_1\n"); + SetCommandExitStatus(CHIP_NO_ERROR); + return; + } + + // Ensure we increment mTestIndex before we start running the relevant + // command. That way if we lose the timeslice after we send the message + // but before our function call returns, we won't end up with an + // incorrect mTestIndex value observed when we get the response. + switch (mTestIndex++) + { + case 0: + ChipLogProgress(chipTool, " ***** Test Step 0 : read the global attribute: ClusterRevision\n"); + err = TestReadTheGlobalAttributeClusterRevision_0(); + break; + case 1: + ChipLogProgress(chipTool, + " ***** Test Step 1 : write the default values to mandatory global attribute: ClusterRevision\n"); + err = TestWriteTheDefaultValuesToMandatoryGlobalAttributeClusterRevision_1(); + break; + } + + if (CHIP_NO_ERROR != err) + { + ChipLogError(chipTool, " ***** Test Failure: %s\n", chip::ErrorStr(err)); + SetCommandExitStatus(err); + } + } + +private: + std::atomic_uint16_t mTestIndex; + const uint16_t mTestCount = 2; + + chip::Callback::Callback mOnFailureCallback_0{ OnFailureCallback_0, this }; + chip::Callback::Callback mOnSuccessCallback_0{ OnSuccessCallback_0, this }; + chip::Callback::Callback mOnFailureCallback_1{ OnFailureCallback_1, this }; + chip::Callback::Callback mOnSuccessCallback_1{ OnSuccessCallback_1, this }; + + static void OnFailureCallback_0(void * context, uint8_t status) + { + (static_cast(context))->OnFailureResponse_0(status); + } + + static void OnSuccessCallback_0(void * context, uint16_t clusterRevision) + { + (static_cast(context))->OnSuccessResponse_0(clusterRevision); + } + + static void OnFailureCallback_1(void * context, uint8_t status) + { + (static_cast(context))->OnFailureResponse_1(status); + } + + static void OnSuccessCallback_1(void * context, uint16_t clusterRevision) + { + (static_cast(context))->OnSuccessResponse_1(clusterRevision); + } + + // + // Tests methods + // + + CHIP_ERROR TestReadTheGlobalAttributeClusterRevision_0() + { + chip::Controller::OccupancySensingClusterTest cluster; + cluster.Associate(mDevice, 1); + + return cluster.ReadAttributeClusterRevision(mOnSuccessCallback_0.Cancel(), mOnFailureCallback_0.Cancel()); + } + + void OnFailureResponse_0(uint8_t status) { ThrowFailureResponse(); } + + void OnSuccessResponse_0(uint16_t clusterRevision) + { + VerifyOrReturn(CheckValue("clusterRevision", clusterRevision, 2U)); + NextTest(); + } + + CHIP_ERROR TestWriteTheDefaultValuesToMandatoryGlobalAttributeClusterRevision_1() + { + chip::Controller::OccupancySensingClusterTest cluster; + cluster.Associate(mDevice, 1); + + uint16_t clusterRevisionArgument = 2U; + + return cluster.WriteAttributeClusterRevision(mOnSuccessCallback_1.Cancel(), mOnFailureCallback_1.Cancel(), + clusterRevisionArgument); + } + + void OnFailureResponse_1(uint8_t status) { NextTest(); } + + void OnSuccessResponse_1(uint16_t clusterRevision) { ThrowSuccessResponse(); } +}; + +class TestOperationalCredentialsCluster : public TestCommand +{ +public: + TestOperationalCredentialsCluster() : TestCommand("TestOperationalCredentialsCluster"), mTestIndex(0) {} + + /////////// TestCommand Interface ///////// + void NextTest() override + { + CHIP_ERROR err = CHIP_NO_ERROR; + + if (0 == mTestIndex) + { + ChipLogProgress(chipTool, " **** Test Start: TestOperationalCredentialsCluster\n"); + } + + if (mTestCount == mTestIndex) + { + ChipLogProgress(chipTool, " **** Test Complete: TestOperationalCredentialsCluster\n"); + SetCommandExitStatus(CHIP_NO_ERROR); + return; + } + + // Ensure we increment mTestIndex before we start running the relevant + // command. That way if we lose the timeslice after we send the message + // but before our function call returns, we won't end up with an + // incorrect mTestIndex value observed when we get the response. + switch (mTestIndex++) + { + case 0: + ChipLogProgress(chipTool, " ***** Test Step 0 : Read number of supported fabrics\n"); + err = TestReadNumberOfSupportedFabrics_0(); + break; + case 1: + ChipLogProgress(chipTool, " ***** Test Step 1 : Read number of commissioned fabrics\n"); + err = TestReadNumberOfCommissionedFabrics_1(); + break; + } + + if (CHIP_NO_ERROR != err) + { + ChipLogError(chipTool, " ***** Test Failure: %s\n", chip::ErrorStr(err)); + SetCommandExitStatus(err); + } + } + +private: + std::atomic_uint16_t mTestIndex; + const uint16_t mTestCount = 2; + + chip::Callback::Callback mOnFailureCallback_0{ OnFailureCallback_0, this }; + chip::Callback::Callback mOnSuccessCallback_0{ OnSuccessCallback_0, this }; + chip::Callback::Callback mOnFailureCallback_1{ OnFailureCallback_1, this }; + chip::Callback::Callback mOnSuccessCallback_1{ OnSuccessCallback_1, + this }; + + static void OnFailureCallback_0(void * context, uint8_t status) + { + (static_cast(context))->OnFailureResponse_0(status); + } + + static void OnSuccessCallback_0(void * context, uint8_t supportedFabrics) + { + (static_cast(context))->OnSuccessResponse_0(supportedFabrics); + } + + static void OnFailureCallback_1(void * context, uint8_t status) + { + (static_cast(context))->OnFailureResponse_1(status); + } + + static void OnSuccessCallback_1(void * context, uint8_t commissionedFabrics) + { + (static_cast(context))->OnSuccessResponse_1(commissionedFabrics); + } + + // + // Tests methods + // + + CHIP_ERROR TestReadNumberOfSupportedFabrics_0() + { + chip::Controller::OperationalCredentialsClusterTest cluster; + cluster.Associate(mDevice, 0); + + return cluster.ReadAttributeSupportedFabrics(mOnSuccessCallback_0.Cancel(), mOnFailureCallback_0.Cancel()); + } + + void OnFailureResponse_0(uint8_t status) { ThrowFailureResponse(); } + + void OnSuccessResponse_0(uint8_t supportedFabrics) + { + VerifyOrReturn(CheckConstraintType("supportedFabrics", "", "uint8")); + VerifyOrReturn(CheckConstraintMinValue("supportedFabrics", supportedFabrics, 4)); + NextTest(); + } + + CHIP_ERROR TestReadNumberOfCommissionedFabrics_1() + { + chip::Controller::OperationalCredentialsClusterTest cluster; + cluster.Associate(mDevice, 0); + + return cluster.ReadAttributeCommissionedFabrics(mOnSuccessCallback_1.Cancel(), mOnFailureCallback_1.Cancel()); + } + + void OnFailureResponse_1(uint8_t status) { ThrowFailureResponse(); } + + void OnSuccessResponse_1(uint8_t commissionedFabrics) + { + VerifyOrReturn(CheckConstraintType("commissionedFabrics", "", "uint8")); + VerifyOrReturn(CheckConstraintMinValue("commissionedFabrics", commissionedFabrics, 1)); + NextTest(); + } +}; + +class Test_TC_LVL_1_1 : public TestCommand +{ +public: + Test_TC_LVL_1_1() : TestCommand("Test_TC_LVL_1_1"), mTestIndex(0) {} + + /////////// TestCommand Interface ///////// + void NextTest() override + { + CHIP_ERROR err = CHIP_NO_ERROR; + + if (0 == mTestIndex) + { + ChipLogProgress(chipTool, " **** Test Start: Test_TC_LVL_1_1\n"); + } + + if (mTestCount == mTestIndex) + { + ChipLogProgress(chipTool, " **** Test Complete: Test_TC_LVL_1_1\n"); + SetCommandExitStatus(CHIP_NO_ERROR); + return; + } + + // Ensure we increment mTestIndex before we start running the relevant + // command. That way if we lose the timeslice after we send the message + // but before our function call returns, we won't end up with an + // incorrect mTestIndex value observed when we get the response. + switch (mTestIndex++) + { + case 0: + ChipLogProgress(chipTool, + " ***** Test Step 0 : write the default values to mandatory global attribute: ClusterRevision\n"); + err = TestWriteTheDefaultValuesToMandatoryGlobalAttributeClusterRevision_0(); + break; + } + + if (CHIP_NO_ERROR != err) + { + ChipLogError(chipTool, " ***** Test Failure: %s\n", chip::ErrorStr(err)); + SetCommandExitStatus(err); + } + } + +private: + std::atomic_uint16_t mTestIndex; + const uint16_t mTestCount = 1; + + chip::Callback::Callback mOnFailureCallback_0{ OnFailureCallback_0, this }; + chip::Callback::Callback mOnSuccessCallback_0{ OnSuccessCallback_0, this }; + + static void OnFailureCallback_0(void * context, uint8_t status) + { + (static_cast(context))->OnFailureResponse_0(status); + } + + static void OnSuccessCallback_0(void * context, uint16_t clusterRevision) + { + (static_cast(context))->OnSuccessResponse_0(clusterRevision); + } + + // + // Tests methods + // + + CHIP_ERROR TestWriteTheDefaultValuesToMandatoryGlobalAttributeClusterRevision_0() + { + chip::Controller::LevelControlClusterTest cluster; + cluster.Associate(mDevice, 1); + + uint16_t clusterRevisionArgument = 4U; + + return cluster.WriteAttributeClusterRevision(mOnSuccessCallback_0.Cancel(), mOnFailureCallback_0.Cancel(), + clusterRevisionArgument); + } + + void OnFailureResponse_0(uint8_t status) { NextTest(); } + + void OnSuccessResponse_0(uint16_t clusterRevision) { ThrowSuccessResponse(); } +}; + +class Test_TC_CC_1_1 : public TestCommand +{ +public: + Test_TC_CC_1_1() : TestCommand("Test_TC_CC_1_1"), mTestIndex(0) {} + + /////////// TestCommand Interface ///////// + void NextTest() override + { + CHIP_ERROR err = CHIP_NO_ERROR; + + if (0 == mTestIndex) + { + ChipLogProgress(chipTool, " **** Test Start: Test_TC_CC_1_1\n"); + } + + if (mTestCount == mTestIndex) + { + ChipLogProgress(chipTool, " **** Test Complete: Test_TC_CC_1_1\n"); + SetCommandExitStatus(CHIP_NO_ERROR); + return; + } + + // Ensure we increment mTestIndex before we start running the relevant + // command. That way if we lose the timeslice after we send the message + // but before our function call returns, we won't end up with an + // incorrect mTestIndex value observed when we get the response. + switch (mTestIndex++) + { + case 0: + ChipLogProgress(chipTool, + " ***** Test Step 0 : write the default values to mandatory global attribute: ClusterRevision\n"); + err = TestWriteTheDefaultValuesToMandatoryGlobalAttributeClusterRevision_0(); + break; + } + + if (CHIP_NO_ERROR != err) + { + ChipLogError(chipTool, " ***** Test Failure: %s\n", chip::ErrorStr(err)); + SetCommandExitStatus(err); + } + } + +private: + std::atomic_uint16_t mTestIndex; + const uint16_t mTestCount = 1; + + chip::Callback::Callback mOnFailureCallback_0{ OnFailureCallback_0, this }; + chip::Callback::Callback mOnSuccessCallback_0{ OnSuccessCallback_0, this }; + + static void OnFailureCallback_0(void * context, uint8_t status) + { + (static_cast(context))->OnFailureResponse_0(status); + } + + static void OnSuccessCallback_0(void * context, uint16_t clusterRevision) + { + (static_cast(context))->OnSuccessResponse_0(clusterRevision); + } + + // + // Tests methods + // + + CHIP_ERROR TestWriteTheDefaultValuesToMandatoryGlobalAttributeClusterRevision_0() + { + chip::Controller::ColorControlClusterTest cluster; + cluster.Associate(mDevice, 1); + + uint16_t clusterRevisionArgument = 4U; + + return cluster.WriteAttributeClusterRevision(mOnSuccessCallback_0.Cancel(), mOnFailureCallback_0.Cancel(), + clusterRevisionArgument); + } + + void OnFailureResponse_0(uint8_t status) { NextTest(); } + + void OnSuccessResponse_0(uint16_t clusterRevision) { ThrowSuccessResponse(); } +}; + +class Test_TC_RH_1_1 : public TestCommand +{ +public: + Test_TC_RH_1_1() : TestCommand("Test_TC_RH_1_1"), mTestIndex(0) {} + + /////////// TestCommand Interface ///////// + void NextTest() override + { + CHIP_ERROR err = CHIP_NO_ERROR; + + if (0 == mTestIndex) + { + ChipLogProgress(chipTool, " **** Test Start: Test_TC_RH_1_1\n"); + } + + if (mTestCount == mTestIndex) + { + ChipLogProgress(chipTool, " **** Test Complete: Test_TC_RH_1_1\n"); + SetCommandExitStatus(CHIP_NO_ERROR); + return; + } + + // Ensure we increment mTestIndex before we start running the relevant + // command. That way if we lose the timeslice after we send the message + // but before our function call returns, we won't end up with an + // incorrect mTestIndex value observed when we get the response. + switch (mTestIndex++) + { + case 0: + ChipLogProgress(chipTool, + " ***** Test Step 0 : write the default values to mandatory global attribute: ClusterRevision\n"); + err = TestWriteTheDefaultValuesToMandatoryGlobalAttributeClusterRevision_0(); + break; + } + + if (CHIP_NO_ERROR != err) + { + ChipLogError(chipTool, " ***** Test Failure: %s\n", chip::ErrorStr(err)); + SetCommandExitStatus(err); + } + } + +private: + std::atomic_uint16_t mTestIndex; + const uint16_t mTestCount = 1; + + chip::Callback::Callback mOnFailureCallback_0{ OnFailureCallback_0, this }; + chip::Callback::Callback mOnSuccessCallback_0{ OnSuccessCallback_0, this }; + + static void OnFailureCallback_0(void * context, uint8_t status) + { + (static_cast(context))->OnFailureResponse_0(status); + } + + static void OnSuccessCallback_0(void * context, uint16_t clusterRevision) + { + (static_cast(context))->OnSuccessResponse_0(clusterRevision); + } + + // + // Tests methods + // + + CHIP_ERROR TestWriteTheDefaultValuesToMandatoryGlobalAttributeClusterRevision_0() + { + chip::Controller::RelativeHumidityMeasurementClusterTest cluster; + cluster.Associate(mDevice, 1); + + uint16_t clusterRevisionArgument = 1U; + + return cluster.WriteAttributeClusterRevision(mOnSuccessCallback_0.Cancel(), mOnFailureCallback_0.Cancel(), + clusterRevisionArgument); + } + + void OnFailureResponse_0(uint8_t status) { NextTest(); } + + void OnSuccessResponse_0(uint16_t clusterRevision) { ThrowSuccessResponse(); } +}; + +class Test_TC_MC_1_1 : public TestCommand +{ +public: + Test_TC_MC_1_1() : TestCommand("Test_TC_MC_1_1"), mTestIndex(0) {} + + /////////// TestCommand Interface ///////// + void NextTest() override + { + CHIP_ERROR err = CHIP_NO_ERROR; + + if (0 == mTestIndex) + { + ChipLogProgress(chipTool, " **** Test Start: Test_TC_MC_1_1\n"); + } + + if (mTestCount == mTestIndex) + { + ChipLogProgress(chipTool, " **** Test Complete: Test_TC_MC_1_1\n"); + SetCommandExitStatus(CHIP_NO_ERROR); + return; + } + + // Ensure we increment mTestIndex before we start running the relevant + // command. That way if we lose the timeslice after we send the message + // but before our function call returns, we won't end up with an + // incorrect mTestIndex value observed when we get the response. + switch (mTestIndex++) + { + case 0: + ChipLogProgress(chipTool, + " ***** Test Step 0 : write the default values to mandatory global attribute: ClusterRevision\n"); + err = TestWriteTheDefaultValuesToMandatoryGlobalAttributeClusterRevision_0(); + break; + } + + if (CHIP_NO_ERROR != err) + { + ChipLogError(chipTool, " ***** Test Failure: %s\n", chip::ErrorStr(err)); + SetCommandExitStatus(err); + } + } + +private: + std::atomic_uint16_t mTestIndex; + const uint16_t mTestCount = 1; + + chip::Callback::Callback mOnFailureCallback_0{ OnFailureCallback_0, this }; + chip::Callback::Callback mOnSuccessCallback_0{ OnSuccessCallback_0, this }; + + static void OnFailureCallback_0(void * context, uint8_t status) + { + (static_cast(context))->OnFailureResponse_0(status); + } + + static void OnSuccessCallback_0(void * context, uint16_t clusterRevision) + { + (static_cast(context))->OnSuccessResponse_0(clusterRevision); + } + + // + // Tests methods + // + + CHIP_ERROR TestWriteTheDefaultValuesToMandatoryGlobalAttributeClusterRevision_0() + { + chip::Controller::RelativeHumidityMeasurementClusterTest cluster; + cluster.Associate(mDevice, 1); + + uint16_t clusterRevisionArgument = 1U; + + return cluster.WriteAttributeClusterRevision(mOnSuccessCallback_0.Cancel(), mOnFailureCallback_0.Cancel(), + clusterRevisionArgument); + } + + void OnFailureResponse_0(uint8_t status) { NextTest(); } + + void OnSuccessResponse_0(uint16_t clusterRevision) { ThrowSuccessResponse(); } +}; + +class Test_TC_TSTAT_1_1 : public TestCommand +{ +public: + Test_TC_TSTAT_1_1() : TestCommand("Test_TC_TSTAT_1_1"), mTestIndex(0) {} + + /////////// TestCommand Interface ///////// + void NextTest() override + { + CHIP_ERROR err = CHIP_NO_ERROR; + + if (0 == mTestIndex) + { + ChipLogProgress(chipTool, " **** Test Start: Test_TC_TSTAT_1_1\n"); + } + + if (mTestCount == mTestIndex) + { + ChipLogProgress(chipTool, " **** Test Complete: Test_TC_TSTAT_1_1\n"); + SetCommandExitStatus(CHIP_NO_ERROR); + return; + } + + // Ensure we increment mTestIndex before we start running the relevant + // command. That way if we lose the timeslice after we send the message + // but before our function call returns, we won't end up with an + // incorrect mTestIndex value observed when we get the response. + switch (mTestIndex++) + { + case 0: + ChipLogProgress(chipTool, + " ***** Test Step 0 : write the default values to mandatory global attribute: ClusterRevision\n"); + err = TestWriteTheDefaultValuesToMandatoryGlobalAttributeClusterRevision_0(); + break; + } + + if (CHIP_NO_ERROR != err) + { + ChipLogError(chipTool, " ***** Test Failure: %s\n", chip::ErrorStr(err)); + SetCommandExitStatus(err); + } + } + +private: + std::atomic_uint16_t mTestIndex; + const uint16_t mTestCount = 1; + + chip::Callback::Callback mOnFailureCallback_0{ OnFailureCallback_0, this }; + chip::Callback::Callback mOnSuccessCallback_0{ OnSuccessCallback_0, this }; + + static void OnFailureCallback_0(void * context, uint8_t status) + { + (static_cast(context))->OnFailureResponse_0(status); + } + + static void OnSuccessCallback_0(void * context, uint16_t clusterRevision) + { + (static_cast(context))->OnSuccessResponse_0(clusterRevision); + } + + // + // Tests methods + // + + CHIP_ERROR TestWriteTheDefaultValuesToMandatoryGlobalAttributeClusterRevision_0() + { + chip::Controller::ThermostatClusterTest cluster; + cluster.Associate(mDevice, 1); + + uint16_t clusterRevisionArgument = 5U; + + return cluster.WriteAttributeClusterRevision(mOnSuccessCallback_0.Cancel(), mOnFailureCallback_0.Cancel(), + clusterRevisionArgument); + } + + void OnFailureResponse_0(uint8_t status) { NextTest(); } + + void OnSuccessResponse_0(uint16_t clusterRevision) { ThrowSuccessResponse(); } +}; + +class Test_TC_PCC_1_1 : public TestCommand +{ +public: + Test_TC_PCC_1_1() : TestCommand("Test_TC_PCC_1_1"), mTestIndex(0) {} + + /////////// TestCommand Interface ///////// + void NextTest() override + { + CHIP_ERROR err = CHIP_NO_ERROR; + + if (0 == mTestIndex) + { + ChipLogProgress(chipTool, " **** Test Start: Test_TC_PCC_1_1\n"); + } + + if (mTestCount == mTestIndex) + { + ChipLogProgress(chipTool, " **** Test Complete: Test_TC_PCC_1_1\n"); + SetCommandExitStatus(CHIP_NO_ERROR); + return; + } + + // Ensure we increment mTestIndex before we start running the relevant + // command. That way if we lose the timeslice after we send the message + // but before our function call returns, we won't end up with an + // incorrect mTestIndex value observed when we get the response. + switch (mTestIndex++) + { + case 0: + ChipLogProgress(chipTool, + " ***** Test Step 0 : write the default values to mandatory global attribute: ClusterRevision\n"); + err = TestWriteTheDefaultValuesToMandatoryGlobalAttributeClusterRevision_0(); + break; + } + + if (CHIP_NO_ERROR != err) + { + ChipLogError(chipTool, " ***** Test Failure: %s\n", chip::ErrorStr(err)); + SetCommandExitStatus(err); + } + } + +private: + std::atomic_uint16_t mTestIndex; + const uint16_t mTestCount = 1; + + chip::Callback::Callback mOnFailureCallback_0{ OnFailureCallback_0, this }; + chip::Callback::Callback mOnSuccessCallback_0{ OnSuccessCallback_0, this }; + + static void OnFailureCallback_0(void * context, uint8_t status) + { + (static_cast(context))->OnFailureResponse_0(status); + } + + static void OnSuccessCallback_0(void * context, uint16_t clusterRevision) + { + (static_cast(context))->OnSuccessResponse_0(clusterRevision); + } + + // + // Tests methods + // + + CHIP_ERROR TestWriteTheDefaultValuesToMandatoryGlobalAttributeClusterRevision_0() + { + chip::Controller::PumpConfigurationAndControlClusterTest cluster; + cluster.Associate(mDevice, 1); + + uint16_t clusterRevisionArgument = 3U; + + return cluster.WriteAttributeClusterRevision(mOnSuccessCallback_0.Cancel(), mOnFailureCallback_0.Cancel(), + clusterRevisionArgument); + } + + void OnFailureResponse_0(uint8_t status) { NextTest(); } + + void OnSuccessResponse_0(uint16_t clusterRevision) { ThrowSuccessResponse(); } +}; + +class Test_TC_TSUIC_1_1 : public TestCommand +{ +public: + Test_TC_TSUIC_1_1() : TestCommand("Test_TC_TSUIC_1_1"), mTestIndex(0) {} + + /////////// TestCommand Interface ///////// + void NextTest() override + { + CHIP_ERROR err = CHIP_NO_ERROR; + + if (0 == mTestIndex) + { + ChipLogProgress(chipTool, " **** Test Start: Test_TC_TSUIC_1_1\n"); + } + + if (mTestCount == mTestIndex) + { + ChipLogProgress(chipTool, " **** Test Complete: Test_TC_TSUIC_1_1\n"); + SetCommandExitStatus(CHIP_NO_ERROR); + return; + } + + // Ensure we increment mTestIndex before we start running the relevant + // command. That way if we lose the timeslice after we send the message + // but before our function call returns, we won't end up with an + // incorrect mTestIndex value observed when we get the response. + switch (mTestIndex++) + { + case 0: + ChipLogProgress(chipTool, + " ***** Test Step 0 : write the default values to mandatory global attribute: ClusterRevision\n"); + err = TestWriteTheDefaultValuesToMandatoryGlobalAttributeClusterRevision_0(); + break; + } + + if (CHIP_NO_ERROR != err) + { + ChipLogError(chipTool, " ***** Test Failure: %s\n", chip::ErrorStr(err)); + SetCommandExitStatus(err); + } + } + +private: + std::atomic_uint16_t mTestIndex; + const uint16_t mTestCount = 1; + + chip::Callback::Callback mOnFailureCallback_0{ OnFailureCallback_0, this }; + chip::Callback::Callback mOnSuccessCallback_0{ OnSuccessCallback_0, this }; + + static void OnFailureCallback_0(void * context, uint8_t status) + { + (static_cast(context))->OnFailureResponse_0(status); + } + + static void OnSuccessCallback_0(void * context, uint16_t clusterRevision) + { + (static_cast(context))->OnSuccessResponse_0(clusterRevision); + } + + // + // Tests methods + // + + CHIP_ERROR TestWriteTheDefaultValuesToMandatoryGlobalAttributeClusterRevision_0() + { + chip::Controller::ThermostatUserInterfaceConfigurationClusterTest cluster; + cluster.Associate(mDevice, 1); + + uint16_t clusterRevisionArgument = 2U; + + return cluster.WriteAttributeClusterRevision(mOnSuccessCallback_0.Cancel(), mOnFailureCallback_0.Cancel(), + clusterRevisionArgument); + } + + void OnFailureResponse_0(uint8_t status) { NextTest(); } + + void OnSuccessResponse_0(uint16_t clusterRevision) { ThrowSuccessResponse(); } +}; + +class Test_TC_DIAGTH_1_1 : public TestCommand +{ +public: + Test_TC_DIAGTH_1_1() : TestCommand("Test_TC_DIAGTH_1_1"), mTestIndex(0) {} + + /////////// TestCommand Interface ///////// + void NextTest() override + { + CHIP_ERROR err = CHIP_NO_ERROR; + + if (0 == mTestIndex) + { + ChipLogProgress(chipTool, " **** Test Start: Test_TC_DIAGTH_1_1\n"); + } + + if (mTestCount == mTestIndex) + { + ChipLogProgress(chipTool, " **** Test Complete: Test_TC_DIAGTH_1_1\n"); + SetCommandExitStatus(CHIP_NO_ERROR); + return; + } + + // Ensure we increment mTestIndex before we start running the relevant + // command. That way if we lose the timeslice after we send the message + // but before our function call returns, we won't end up with an + // incorrect mTestIndex value observed when we get the response. + switch (mTestIndex++) + { + case 0: + ChipLogProgress(chipTool, " ***** Test Step 0 : read the global attribute: ClusterRevision\n"); + err = TestReadTheGlobalAttributeClusterRevision_0(); + break; + case 1: + ChipLogProgress(chipTool, + " ***** Test Step 1 : write the default values to mandatory global attribute: ClusterRevision\n"); + err = TestWriteTheDefaultValuesToMandatoryGlobalAttributeClusterRevision_1(); + break; + case 2: + ChipLogProgress(chipTool, " ***** Test Step 2 : reads back global attribute: ClusterRevision\n"); + err = TestReadsBackGlobalAttributeClusterRevision_2(); + break; + } + + if (CHIP_NO_ERROR != err) + { + ChipLogError(chipTool, " ***** Test Failure: %s\n", chip::ErrorStr(err)); + SetCommandExitStatus(err); + } + } + +private: + std::atomic_uint16_t mTestIndex; + const uint16_t mTestCount = 3; + + chip::Callback::Callback mOnFailureCallback_0{ OnFailureCallback_0, this }; + chip::Callback::Callback mOnSuccessCallback_0{ OnSuccessCallback_0, this }; + chip::Callback::Callback mOnFailureCallback_1{ OnFailureCallback_1, this }; + chip::Callback::Callback mOnSuccessCallback_1{ OnSuccessCallback_1, this }; + chip::Callback::Callback mOnFailureCallback_2{ OnFailureCallback_2, this }; + chip::Callback::Callback mOnSuccessCallback_2{ OnSuccessCallback_2, this }; + + static void OnFailureCallback_0(void * context, uint8_t status) + { + (static_cast(context))->OnFailureResponse_0(status); + } + + static void OnSuccessCallback_0(void * context, uint16_t clusterRevision) + { + (static_cast(context))->OnSuccessResponse_0(clusterRevision); + } + + static void OnFailureCallback_1(void * context, uint8_t status) + { + (static_cast(context))->OnFailureResponse_1(status); + } + + static void OnSuccessCallback_1(void * context, uint16_t clusterRevision) + { + (static_cast(context))->OnSuccessResponse_1(clusterRevision); + } + + static void OnFailureCallback_2(void * context, uint8_t status) + { + (static_cast(context))->OnFailureResponse_2(status); + } + + static void OnSuccessCallback_2(void * context, uint16_t clusterRevision) + { + (static_cast(context))->OnSuccessResponse_2(clusterRevision); + } + + // + // Tests methods + // + + CHIP_ERROR TestReadTheGlobalAttributeClusterRevision_0() + { + chip::Controller::ThreadNetworkDiagnosticsClusterTest cluster; + cluster.Associate(mDevice, 0); + + return cluster.ReadAttributeClusterRevision(mOnSuccessCallback_0.Cancel(), mOnFailureCallback_0.Cancel()); + } + + void OnFailureResponse_0(uint8_t status) { ThrowFailureResponse(); } + + void OnSuccessResponse_0(uint16_t clusterRevision) + { + VerifyOrReturn(CheckValue("clusterRevision", clusterRevision, 1U)); + NextTest(); + } + + CHIP_ERROR TestWriteTheDefaultValuesToMandatoryGlobalAttributeClusterRevision_1() + { + chip::Controller::ThreadNetworkDiagnosticsClusterTest cluster; + cluster.Associate(mDevice, 0); + + uint16_t clusterRevisionArgument = 1U; + + return cluster.WriteAttributeClusterRevision(mOnSuccessCallback_1.Cancel(), mOnFailureCallback_1.Cancel(), + clusterRevisionArgument); + } + + void OnFailureResponse_1(uint8_t status) { NextTest(); } + + void OnSuccessResponse_1(uint16_t clusterRevision) { ThrowSuccessResponse(); } + + CHIP_ERROR TestReadsBackGlobalAttributeClusterRevision_2() + { + chip::Controller::ThreadNetworkDiagnosticsClusterTest cluster; + cluster.Associate(mDevice, 0); + + return cluster.ReadAttributeClusterRevision(mOnSuccessCallback_2.Cancel(), mOnFailureCallback_2.Cancel()); + } + + void OnFailureResponse_2(uint8_t status) { ThrowFailureResponse(); } + + void OnSuccessResponse_2(uint16_t clusterRevision) + { + VerifyOrReturn(CheckValue("clusterRevision", clusterRevision, 1U)); + NextTest(); + } +}; + +class Test_TC_TM_2_1 : public TestCommand +{ +public: + Test_TC_TM_2_1() : TestCommand("Test_TC_TM_2_1"), mTestIndex(0) {} + + /////////// TestCommand Interface ///////// + void NextTest() override + { + CHIP_ERROR err = CHIP_NO_ERROR; + + if (0 == mTestIndex) + { + ChipLogProgress(chipTool, " **** Test Start: Test_TC_TM_2_1\n"); + } + + if (mTestCount == mTestIndex) + { + ChipLogProgress(chipTool, " **** Test Complete: Test_TC_TM_2_1\n"); + SetCommandExitStatus(CHIP_NO_ERROR); + return; + } + + // Ensure we increment mTestIndex before we start running the relevant + // command. That way if we lose the timeslice after we send the message + // but before our function call returns, we won't end up with an + // incorrect mTestIndex value observed when we get the response. + switch (mTestIndex++) + { + case 0: + ChipLogProgress(chipTool, " ***** Test Step 0 : read the mandatory attribute: MeasuredValue\n"); + err = TestReadTheMandatoryAttributeMeasuredValue_0(); + break; + } + + if (CHIP_NO_ERROR != err) + { + ChipLogError(chipTool, " ***** Test Failure: %s\n", chip::ErrorStr(err)); + SetCommandExitStatus(err); + } + } + +private: + std::atomic_uint16_t mTestIndex; + const uint16_t mTestCount = 1; + + chip::Callback::Callback mOnFailureCallback_0{ OnFailureCallback_0, this }; + chip::Callback::Callback mOnSuccessCallback_0{ OnSuccessCallback_0, this }; + + static void OnFailureCallback_0(void * context, uint8_t status) + { + (static_cast(context))->OnFailureResponse_0(status); + } + + static void OnSuccessCallback_0(void * context, int16_t measuredValue) + { + (static_cast(context))->OnSuccessResponse_0(measuredValue); + } + + // + // Tests methods + // + + CHIP_ERROR TestReadTheMandatoryAttributeMeasuredValue_0() + { + chip::Controller::TemperatureMeasurementClusterTest cluster; + cluster.Associate(mDevice, 1); + + return cluster.ReadAttributeMeasuredValue(mOnSuccessCallback_0.Cancel(), mOnFailureCallback_0.Cancel()); + } + + void OnFailureResponse_0(uint8_t status) { ThrowFailureResponse(); } + + void OnSuccessResponse_0(int16_t measuredValue) + { + VerifyOrReturn(CheckConstraintType("measuredValue", "", "int16")); + NextTest(); + } +}; + +class Test_TC_TSUIC_2_1 : public TestCommand +{ +public: + Test_TC_TSUIC_2_1() : TestCommand("Test_TC_TSUIC_2_1"), mTestIndex(0) {} + + /////////// TestCommand Interface ///////// + void NextTest() override + { + CHIP_ERROR err = CHIP_NO_ERROR; + + if (0 == mTestIndex) + { + ChipLogProgress(chipTool, " **** Test Start: Test_TC_TSUIC_2_1\n"); + } + + if (mTestCount == mTestIndex) + { + ChipLogProgress(chipTool, " **** Test Complete: Test_TC_TSUIC_2_1\n"); + SetCommandExitStatus(CHIP_NO_ERROR); + return; + } + + // Ensure we increment mTestIndex before we start running the relevant + // command. That way if we lose the timeslice after we send the message + // but before our function call returns, we won't end up with an + // incorrect mTestIndex value observed when we get the response. + switch (mTestIndex++) + { + case 0: + ChipLogProgress(chipTool, " ***** Test Step 0 : read the mandatory attribute: TemperatureDisplayMode\n"); + err = TestReadTheMandatoryAttributeTemperatureDisplayMode_0(); + break; + case 1: + ChipLogProgress(chipTool, " ***** Test Step 1 : read the mandatory attribute: TemperatureDisplayMode\n"); + err = TestReadTheMandatoryAttributeTemperatureDisplayMode_1(); + break; + case 2: + ChipLogProgress(chipTool, " ***** Test Step 2 : write to the mandatory attribute: TemperatureDisplayMode\n"); + err = TestWriteToTheMandatoryAttributeTemperatureDisplayMode_2(); + break; + case 3: + ChipLogProgress(chipTool, " ***** Test Step 3 : read the mandatory attribute: TemperatureDisplayMode\n"); + err = TestReadTheMandatoryAttributeTemperatureDisplayMode_3(); + break; + case 4: + ChipLogProgress(chipTool, " ***** Test Step 4 : read the mandatory attribute: TemperatureDisplayMode\n"); + err = TestReadTheMandatoryAttributeTemperatureDisplayMode_4(); + break; + case 5: + ChipLogProgress(chipTool, " ***** Test Step 5 : read the mandatory attribute: KeypadLockout\n"); + err = TestReadTheMandatoryAttributeKeypadLockout_5(); + break; + case 6: + ChipLogProgress(chipTool, " ***** Test Step 6 : read the mandatory attribute: KeypadLockout\n"); + err = TestReadTheMandatoryAttributeKeypadLockout_6(); + break; + case 7: + ChipLogProgress(chipTool, " ***** Test Step 7 : write to the mandatory attribute: KeypadLockout\n"); + err = TestWriteToTheMandatoryAttributeKeypadLockout_7(); + break; + case 8: + ChipLogProgress(chipTool, " ***** Test Step 8 : read the mandatory attribute: KeypadLockout\n"); + err = TestReadTheMandatoryAttributeKeypadLockout_8(); + break; + case 9: + ChipLogProgress(chipTool, " ***** Test Step 9 : read the mandatory attribute: KeypadLockout\n"); + err = TestReadTheMandatoryAttributeKeypadLockout_9(); + break; + case 10: + ChipLogProgress(chipTool, " ***** Test Step 10 : read the optional attribute: ScheduleProgrammingVisibility\n"); + err = TestReadTheOptionalAttributeScheduleProgrammingVisibility_10(); + break; + case 11: + ChipLogProgress(chipTool, " ***** Test Step 11 : read the optional attribute: ScheduleProgrammingVisibility\n"); + err = TestReadTheOptionalAttributeScheduleProgrammingVisibility_11(); + break; + case 12: + ChipLogProgress(chipTool, " ***** Test Step 12 : write to the mandatory attribute: ScheduleProgrammingVisibility\n"); + err = TestWriteToTheMandatoryAttributeScheduleProgrammingVisibility_12(); + break; + case 13: + ChipLogProgress(chipTool, " ***** Test Step 13 : read the optional attribute: ScheduleProgrammingVisibility\n"); + err = TestReadTheOptionalAttributeScheduleProgrammingVisibility_13(); + break; + case 14: + ChipLogProgress(chipTool, " ***** Test Step 14 : read the optional attribute: ScheduleProgrammingVisibility\n"); + err = TestReadTheOptionalAttributeScheduleProgrammingVisibility_14(); + break; + } + + if (CHIP_NO_ERROR != err) + { + ChipLogError(chipTool, " ***** Test Failure: %s\n", chip::ErrorStr(err)); + SetCommandExitStatus(err); + } + } + +private: + std::atomic_uint16_t mTestIndex; + const uint16_t mTestCount = 15; + + chip::Callback::Callback mOnFailureCallback_0{ OnFailureCallback_0, this }; + chip::Callback::Callback mOnSuccessCallback_0{ OnSuccessCallback_0, + this }; + chip::Callback::Callback mOnFailureCallback_1{ OnFailureCallback_1, this }; + chip::Callback::Callback mOnSuccessCallback_1{ OnSuccessCallback_1, + this }; + chip::Callback::Callback mOnFailureCallback_2{ OnFailureCallback_2, this }; + chip::Callback::Callback mOnSuccessCallback_2{ OnSuccessCallback_2, + this }; + chip::Callback::Callback mOnFailureCallback_3{ OnFailureCallback_3, this }; + chip::Callback::Callback mOnSuccessCallback_3{ OnSuccessCallback_3, + this }; + chip::Callback::Callback mOnFailureCallback_4{ OnFailureCallback_4, this }; + chip::Callback::Callback mOnSuccessCallback_4{ OnSuccessCallback_4, + this }; + chip::Callback::Callback mOnFailureCallback_5{ OnFailureCallback_5, this }; + chip::Callback::Callback mOnSuccessCallback_5{ OnSuccessCallback_5, this }; + chip::Callback::Callback mOnFailureCallback_6{ OnFailureCallback_6, this }; + chip::Callback::Callback mOnSuccessCallback_6{ OnSuccessCallback_6, this }; + chip::Callback::Callback mOnFailureCallback_7{ OnFailureCallback_7, this }; + chip::Callback::Callback mOnSuccessCallback_7{ OnSuccessCallback_7, this }; + chip::Callback::Callback mOnFailureCallback_8{ OnFailureCallback_8, this }; + chip::Callback::Callback mOnSuccessCallback_8{ OnSuccessCallback_8, this }; + chip::Callback::Callback mOnFailureCallback_9{ OnFailureCallback_9, this }; + chip::Callback::Callback mOnSuccessCallback_9{ OnSuccessCallback_9, this }; + chip::Callback::Callback mOnFailureCallback_10{ OnFailureCallback_10, this }; + chip::Callback::Callback mOnSuccessCallback_10{ + OnSuccessCallback_10, this + }; + chip::Callback::Callback mOnFailureCallback_11{ OnFailureCallback_11, this }; + chip::Callback::Callback mOnSuccessCallback_11{ + OnSuccessCallback_11, this + }; + chip::Callback::Callback mOnFailureCallback_12{ OnFailureCallback_12, this }; + chip::Callback::Callback mOnSuccessCallback_12{ + OnSuccessCallback_12, this + }; + chip::Callback::Callback mOnFailureCallback_13{ OnFailureCallback_13, this }; + chip::Callback::Callback mOnSuccessCallback_13{ + OnSuccessCallback_13, this + }; + chip::Callback::Callback mOnFailureCallback_14{ OnFailureCallback_14, this }; + chip::Callback::Callback mOnSuccessCallback_14{ + OnSuccessCallback_14, this + }; + + static void OnFailureCallback_0(void * context, uint8_t status) + { + (static_cast(context))->OnFailureResponse_0(status); + } + + static void OnSuccessCallback_0(void * context, uint8_t temperatureDisplayMode) + { + (static_cast(context))->OnSuccessResponse_0(temperatureDisplayMode); + } + + static void OnFailureCallback_1(void * context, uint8_t status) + { + (static_cast(context))->OnFailureResponse_1(status); + } + + static void OnSuccessCallback_1(void * context, uint8_t temperatureDisplayMode) + { + (static_cast(context))->OnSuccessResponse_1(temperatureDisplayMode); + } + + static void OnFailureCallback_2(void * context, uint8_t status) + { + (static_cast(context))->OnFailureResponse_2(status); + } + + static void OnSuccessCallback_2(void * context, uint8_t temperatureDisplayMode) + { + (static_cast(context))->OnSuccessResponse_2(temperatureDisplayMode); + } + + static void OnFailureCallback_3(void * context, uint8_t status) + { + (static_cast(context))->OnFailureResponse_3(status); + } + + static void OnSuccessCallback_3(void * context, uint8_t temperatureDisplayMode) + { + (static_cast(context))->OnSuccessResponse_3(temperatureDisplayMode); + } + + static void OnFailureCallback_4(void * context, uint8_t status) + { + (static_cast(context))->OnFailureResponse_4(status); + } + + static void OnSuccessCallback_4(void * context, uint8_t temperatureDisplayMode) + { + (static_cast(context))->OnSuccessResponse_4(temperatureDisplayMode); + } + + static void OnFailureCallback_5(void * context, uint8_t status) + { + (static_cast(context))->OnFailureResponse_5(status); + } + + static void OnSuccessCallback_5(void * context, uint8_t keypadLockout) + { + (static_cast(context))->OnSuccessResponse_5(keypadLockout); + } + + static void OnFailureCallback_6(void * context, uint8_t status) + { + (static_cast(context))->OnFailureResponse_6(status); + } + + static void OnSuccessCallback_6(void * context, uint8_t keypadLockout) + { + (static_cast(context))->OnSuccessResponse_6(keypadLockout); + } + + static void OnFailureCallback_7(void * context, uint8_t status) + { + (static_cast(context))->OnFailureResponse_7(status); + } + + static void OnSuccessCallback_7(void * context, uint8_t keypadLockout) + { + (static_cast(context))->OnSuccessResponse_7(keypadLockout); + } + + static void OnFailureCallback_8(void * context, uint8_t status) + { + (static_cast(context))->OnFailureResponse_8(status); + } + + static void OnSuccessCallback_8(void * context, uint8_t keypadLockout) + { + (static_cast(context))->OnSuccessResponse_8(keypadLockout); + } + + static void OnFailureCallback_9(void * context, uint8_t status) + { + (static_cast(context))->OnFailureResponse_9(status); + } + + static void OnSuccessCallback_9(void * context, uint8_t keypadLockout) + { + (static_cast(context))->OnSuccessResponse_9(keypadLockout); + } + + static void OnFailureCallback_10(void * context, uint8_t status) + { + (static_cast(context))->OnFailureResponse_10(status); + } + + static void OnSuccessCallback_10(void * context, uint8_t scheduleProgrammingVisibility) + { + (static_cast(context))->OnSuccessResponse_10(scheduleProgrammingVisibility); + } + + static void OnFailureCallback_11(void * context, uint8_t status) + { + (static_cast(context))->OnFailureResponse_11(status); + } + + static void OnSuccessCallback_11(void * context, uint8_t scheduleProgrammingVisibility) + { + (static_cast(context))->OnSuccessResponse_11(scheduleProgrammingVisibility); + } + + static void OnFailureCallback_12(void * context, uint8_t status) + { + (static_cast(context))->OnFailureResponse_12(status); + } + + static void OnSuccessCallback_12(void * context, uint8_t scheduleProgrammingVisibility) + { + (static_cast(context))->OnSuccessResponse_12(scheduleProgrammingVisibility); + } + + static void OnFailureCallback_13(void * context, uint8_t status) + { + (static_cast(context))->OnFailureResponse_13(status); + } + + static void OnSuccessCallback_13(void * context, uint8_t scheduleProgrammingVisibility) + { + (static_cast(context))->OnSuccessResponse_13(scheduleProgrammingVisibility); + } + + static void OnFailureCallback_14(void * context, uint8_t status) + { + (static_cast(context))->OnFailureResponse_14(status); + } + + static void OnSuccessCallback_14(void * context, uint8_t scheduleProgrammingVisibility) + { + (static_cast(context))->OnSuccessResponse_14(scheduleProgrammingVisibility); + } + + // + // Tests methods + // + + CHIP_ERROR TestReadTheMandatoryAttributeTemperatureDisplayMode_0() + { + chip::Controller::ThermostatUserInterfaceConfigurationClusterTest cluster; + cluster.Associate(mDevice, 1); + + return cluster.ReadAttributeTemperatureDisplayMode(mOnSuccessCallback_0.Cancel(), mOnFailureCallback_0.Cancel()); + } + + void OnFailureResponse_0(uint8_t status) { ThrowFailureResponse(); } + + void OnSuccessResponse_0(uint8_t temperatureDisplayMode) + { + VerifyOrReturn(CheckValue("temperatureDisplayMode", temperatureDisplayMode, 0)); + NextTest(); + } + + CHIP_ERROR TestReadTheMandatoryAttributeTemperatureDisplayMode_1() + { + chip::Controller::ThermostatUserInterfaceConfigurationClusterTest cluster; + cluster.Associate(mDevice, 1); + + return cluster.ReadAttributeTemperatureDisplayMode(mOnSuccessCallback_1.Cancel(), mOnFailureCallback_1.Cancel()); + } + + void OnFailureResponse_1(uint8_t status) { ThrowFailureResponse(); } + + void OnSuccessResponse_1(uint8_t temperatureDisplayMode) + { + VerifyOrReturn(CheckConstraintType("temperatureDisplayMode", "", "enum8")); + NextTest(); + } + + CHIP_ERROR TestWriteToTheMandatoryAttributeTemperatureDisplayMode_2() + { + chip::Controller::ThermostatUserInterfaceConfigurationClusterTest cluster; + cluster.Associate(mDevice, 1); + + uint8_t temperatureDisplayModeArgument = 0; + + return cluster.WriteAttributeTemperatureDisplayMode(mOnSuccessCallback_2.Cancel(), mOnFailureCallback_2.Cancel(), + temperatureDisplayModeArgument); + } + + void OnFailureResponse_2(uint8_t status) { ThrowFailureResponse(); } + + void OnSuccessResponse_2(uint8_t temperatureDisplayMode) { NextTest(); } + + CHIP_ERROR TestReadTheMandatoryAttributeTemperatureDisplayMode_3() + { + chip::Controller::ThermostatUserInterfaceConfigurationClusterTest cluster; + cluster.Associate(mDevice, 1); + + return cluster.ReadAttributeTemperatureDisplayMode(mOnSuccessCallback_3.Cancel(), mOnFailureCallback_3.Cancel()); + } + + void OnFailureResponse_3(uint8_t status) { ThrowFailureResponse(); } + + void OnSuccessResponse_3(uint8_t temperatureDisplayMode) + { + VerifyOrReturn(CheckValue("temperatureDisplayMode", temperatureDisplayMode, 0)); + NextTest(); + } + + CHIP_ERROR TestReadTheMandatoryAttributeTemperatureDisplayMode_4() + { + chip::Controller::ThermostatUserInterfaceConfigurationClusterTest cluster; + cluster.Associate(mDevice, 1); + + return cluster.ReadAttributeTemperatureDisplayMode(mOnSuccessCallback_4.Cancel(), mOnFailureCallback_4.Cancel()); + } + + void OnFailureResponse_4(uint8_t status) { ThrowFailureResponse(); } + + void OnSuccessResponse_4(uint8_t temperatureDisplayMode) + { + VerifyOrReturn(CheckConstraintType("temperatureDisplayMode", "", "enum8")); + NextTest(); + } + + CHIP_ERROR TestReadTheMandatoryAttributeKeypadLockout_5() + { + chip::Controller::ThermostatUserInterfaceConfigurationClusterTest cluster; + cluster.Associate(mDevice, 1); + + return cluster.ReadAttributeKeypadLockout(mOnSuccessCallback_5.Cancel(), mOnFailureCallback_5.Cancel()); + } + + void OnFailureResponse_5(uint8_t status) { ThrowFailureResponse(); } + + void OnSuccessResponse_5(uint8_t keypadLockout) + { + VerifyOrReturn(CheckValue("keypadLockout", keypadLockout, 0)); + NextTest(); + } + + CHIP_ERROR TestReadTheMandatoryAttributeKeypadLockout_6() + { + chip::Controller::ThermostatUserInterfaceConfigurationClusterTest cluster; + cluster.Associate(mDevice, 1); + + return cluster.ReadAttributeKeypadLockout(mOnSuccessCallback_6.Cancel(), mOnFailureCallback_6.Cancel()); + } + + void OnFailureResponse_6(uint8_t status) { ThrowFailureResponse(); } + + void OnSuccessResponse_6(uint8_t keypadLockout) + { + VerifyOrReturn(CheckConstraintType("keypadLockout", "", "enum8")); + NextTest(); + } + + CHIP_ERROR TestWriteToTheMandatoryAttributeKeypadLockout_7() + { + chip::Controller::ThermostatUserInterfaceConfigurationClusterTest cluster; + cluster.Associate(mDevice, 1); + + uint8_t keypadLockoutArgument = 0; + + return cluster.WriteAttributeKeypadLockout(mOnSuccessCallback_7.Cancel(), mOnFailureCallback_7.Cancel(), + keypadLockoutArgument); + } + + void OnFailureResponse_7(uint8_t status) { ThrowFailureResponse(); } + + void OnSuccessResponse_7(uint8_t keypadLockout) { NextTest(); } + + CHIP_ERROR TestReadTheMandatoryAttributeKeypadLockout_8() + { + chip::Controller::ThermostatUserInterfaceConfigurationClusterTest cluster; + cluster.Associate(mDevice, 1); + + return cluster.ReadAttributeKeypadLockout(mOnSuccessCallback_8.Cancel(), mOnFailureCallback_8.Cancel()); + } + + void OnFailureResponse_8(uint8_t status) { ThrowFailureResponse(); } + + void OnSuccessResponse_8(uint8_t keypadLockout) + { + VerifyOrReturn(CheckValue("keypadLockout", keypadLockout, 0)); + NextTest(); + } + + CHIP_ERROR TestReadTheMandatoryAttributeKeypadLockout_9() + { + chip::Controller::ThermostatUserInterfaceConfigurationClusterTest cluster; + cluster.Associate(mDevice, 1); + + return cluster.ReadAttributeKeypadLockout(mOnSuccessCallback_9.Cancel(), mOnFailureCallback_9.Cancel()); + } + + void OnFailureResponse_9(uint8_t status) { ThrowFailureResponse(); } + + void OnSuccessResponse_9(uint8_t keypadLockout) + { + VerifyOrReturn(CheckConstraintType("keypadLockout", "", "enum8")); + NextTest(); + } + + CHIP_ERROR TestReadTheOptionalAttributeScheduleProgrammingVisibility_10() + { + chip::Controller::ThermostatUserInterfaceConfigurationClusterTest cluster; + cluster.Associate(mDevice, 1); + + return cluster.ReadAttributeScheduleProgrammingVisibility(mOnSuccessCallback_10.Cancel(), mOnFailureCallback_10.Cancel()); + } + + void OnFailureResponse_10(uint8_t status) { ThrowFailureResponse(); } + + void OnSuccessResponse_10(uint8_t scheduleProgrammingVisibility) + { + VerifyOrReturn(CheckValue("scheduleProgrammingVisibility", scheduleProgrammingVisibility, 0)); + NextTest(); + } + + CHIP_ERROR TestReadTheOptionalAttributeScheduleProgrammingVisibility_11() + { + chip::Controller::ThermostatUserInterfaceConfigurationClusterTest cluster; + cluster.Associate(mDevice, 1); + + return cluster.ReadAttributeScheduleProgrammingVisibility(mOnSuccessCallback_11.Cancel(), mOnFailureCallback_11.Cancel()); + } + + void OnFailureResponse_11(uint8_t status) { ThrowFailureResponse(); } + + void OnSuccessResponse_11(uint8_t scheduleProgrammingVisibility) + { + VerifyOrReturn(CheckConstraintType("scheduleProgrammingVisibility", "", "enum8")); + NextTest(); + } + + CHIP_ERROR TestWriteToTheMandatoryAttributeScheduleProgrammingVisibility_12() + { + chip::Controller::ThermostatUserInterfaceConfigurationClusterTest cluster; + cluster.Associate(mDevice, 1); + + uint8_t scheduleProgrammingVisibilityArgument = 0; + + return cluster.WriteAttributeScheduleProgrammingVisibility(mOnSuccessCallback_12.Cancel(), mOnFailureCallback_12.Cancel(), + scheduleProgrammingVisibilityArgument); + } + + void OnFailureResponse_12(uint8_t status) { ThrowFailureResponse(); } + + void OnSuccessResponse_12(uint8_t scheduleProgrammingVisibility) { NextTest(); } + + CHIP_ERROR TestReadTheOptionalAttributeScheduleProgrammingVisibility_13() + { + chip::Controller::ThermostatUserInterfaceConfigurationClusterTest cluster; + cluster.Associate(mDevice, 1); + + return cluster.ReadAttributeScheduleProgrammingVisibility(mOnSuccessCallback_13.Cancel(), mOnFailureCallback_13.Cancel()); + } + + void OnFailureResponse_13(uint8_t status) { ThrowFailureResponse(); } + + void OnSuccessResponse_13(uint8_t scheduleProgrammingVisibility) + { + VerifyOrReturn(CheckValue("scheduleProgrammingVisibility", scheduleProgrammingVisibility, 0)); + NextTest(); + } + + CHIP_ERROR TestReadTheOptionalAttributeScheduleProgrammingVisibility_14() + { + chip::Controller::ThermostatUserInterfaceConfigurationClusterTest cluster; + cluster.Associate(mDevice, 1); + + return cluster.ReadAttributeScheduleProgrammingVisibility(mOnSuccessCallback_14.Cancel(), mOnFailureCallback_14.Cancel()); + } + + void OnFailureResponse_14(uint8_t status) { ThrowFailureResponse(); } + + void OnSuccessResponse_14(uint8_t scheduleProgrammingVisibility) + { + VerifyOrReturn(CheckConstraintType("scheduleProgrammingVisibility", "", "enum8")); + NextTest(); + } +}; + +class Test_TC_PCC_2_1 : public TestCommand +{ +public: + Test_TC_PCC_2_1() : TestCommand("Test_TC_PCC_2_1"), mTestIndex(0) {} + + /////////// TestCommand Interface ///////// + void NextTest() override + { + CHIP_ERROR err = CHIP_NO_ERROR; + + if (0 == mTestIndex) + { + ChipLogProgress(chipTool, " **** Test Start: Test_TC_PCC_2_1\n"); + } + + if (mTestCount == mTestIndex) + { + ChipLogProgress(chipTool, " **** Test Complete: Test_TC_PCC_2_1\n"); + SetCommandExitStatus(CHIP_NO_ERROR); + return; + } + + // Ensure we increment mTestIndex before we start running the relevant + // command. That way if we lose the timeslice after we send the message + // but before our function call returns, we won't end up with an + // incorrect mTestIndex value observed when we get the response. + switch (mTestIndex++) + { + case 0: + ChipLogProgress(chipTool, " ***** Test Step 0 : read the mandatory attribute: MaxPressure\n"); + err = TestReadTheMandatoryAttributeMaxPressure_0(); + break; + case 1: + ChipLogProgress(chipTool, " ***** Test Step 1 : read the mandatory attribute: EffectiveOperationMode\n"); + err = TestReadTheMandatoryAttributeEffectiveOperationMode_1(); + break; + case 2: + ChipLogProgress(chipTool, " ***** Test Step 2 : read the mandatory attribute: EffectiveControlMode\n"); + err = TestReadTheMandatoryAttributeEffectiveControlMode_2(); + break; + case 3: + ChipLogProgress(chipTool, " ***** Test Step 3 : read the mandatory attribute: Capacity\n"); + err = TestReadTheMandatoryAttributeCapacity_3(); + break; + case 4: + ChipLogProgress(chipTool, " ***** Test Step 4 : read the mandatory attribute: MaxPressure\n"); + err = TestReadTheMandatoryAttributeMaxPressure_4(); + break; + case 5: + ChipLogProgress(chipTool, " ***** Test Step 5 : read the mandatory attribute: EffectiveOperationMode\n"); + err = TestReadTheMandatoryAttributeEffectiveOperationMode_5(); + break; + case 6: + ChipLogProgress(chipTool, " ***** Test Step 6 : read the mandatory attribute: EffectiveControlMode\n"); + err = TestReadTheMandatoryAttributeEffectiveControlMode_6(); + break; + case 7: + ChipLogProgress(chipTool, " ***** Test Step 7 : read the mandatory attribute: Capacity\n"); + err = TestReadTheMandatoryAttributeCapacity_7(); + break; + } + + if (CHIP_NO_ERROR != err) + { + ChipLogError(chipTool, " ***** Test Failure: %s\n", chip::ErrorStr(err)); + SetCommandExitStatus(err); + } + } + +private: + std::atomic_uint16_t mTestIndex; + const uint16_t mTestCount = 8; + + chip::Callback::Callback mOnFailureCallback_0{ OnFailureCallback_0, this }; + chip::Callback::Callback mOnSuccessCallback_0{ OnSuccessCallback_0, this }; + chip::Callback::Callback mOnFailureCallback_1{ OnFailureCallback_1, this }; + chip::Callback::Callback mOnSuccessCallback_1{ OnSuccessCallback_1, + this }; + chip::Callback::Callback mOnFailureCallback_2{ OnFailureCallback_2, this }; + chip::Callback::Callback mOnSuccessCallback_2{ OnSuccessCallback_2, + this }; + chip::Callback::Callback mOnFailureCallback_3{ OnFailureCallback_3, this }; + chip::Callback::Callback mOnSuccessCallback_3{ OnSuccessCallback_3, this }; + chip::Callback::Callback mOnFailureCallback_4{ OnFailureCallback_4, this }; + chip::Callback::Callback mOnSuccessCallback_4{ OnSuccessCallback_4, this }; + chip::Callback::Callback mOnFailureCallback_5{ OnFailureCallback_5, this }; + chip::Callback::Callback mOnSuccessCallback_5{ OnSuccessCallback_5, + this }; + chip::Callback::Callback mOnFailureCallback_6{ OnFailureCallback_6, this }; + chip::Callback::Callback mOnSuccessCallback_6{ OnSuccessCallback_6, + this }; + chip::Callback::Callback mOnFailureCallback_7{ OnFailureCallback_7, this }; + chip::Callback::Callback mOnSuccessCallback_7{ OnSuccessCallback_7, this }; + + static void OnFailureCallback_0(void * context, uint8_t status) + { + (static_cast(context))->OnFailureResponse_0(status); + } + + static void OnSuccessCallback_0(void * context, int16_t maxPressure) + { + (static_cast(context))->OnSuccessResponse_0(maxPressure); + } + + static void OnFailureCallback_1(void * context, uint8_t status) + { + (static_cast(context))->OnFailureResponse_1(status); + } + + static void OnSuccessCallback_1(void * context, uint8_t effectiveOperationMode) + { + (static_cast(context))->OnSuccessResponse_1(effectiveOperationMode); + } + + static void OnFailureCallback_2(void * context, uint8_t status) + { + (static_cast(context))->OnFailureResponse_2(status); + } + + static void OnSuccessCallback_2(void * context, uint8_t effectiveControlMode) + { + (static_cast(context))->OnSuccessResponse_2(effectiveControlMode); + } + + static void OnFailureCallback_3(void * context, uint8_t status) + { + (static_cast(context))->OnFailureResponse_3(status); + } + + static void OnSuccessCallback_3(void * context, int16_t capacity) + { + (static_cast(context))->OnSuccessResponse_3(capacity); + } + + static void OnFailureCallback_4(void * context, uint8_t status) + { + (static_cast(context))->OnFailureResponse_4(status); + } + + static void OnSuccessCallback_4(void * context, int16_t maxPressure) + { + (static_cast(context))->OnSuccessResponse_4(maxPressure); + } + + static void OnFailureCallback_5(void * context, uint8_t status) + { + (static_cast(context))->OnFailureResponse_5(status); + } + + static void OnSuccessCallback_5(void * context, uint8_t effectiveOperationMode) + { + (static_cast(context))->OnSuccessResponse_5(effectiveOperationMode); + } + + static void OnFailureCallback_6(void * context, uint8_t status) + { + (static_cast(context))->OnFailureResponse_6(status); + } + + static void OnSuccessCallback_6(void * context, uint8_t effectiveControlMode) + { + (static_cast(context))->OnSuccessResponse_6(effectiveControlMode); + } + + static void OnFailureCallback_7(void * context, uint8_t status) + { + (static_cast(context))->OnFailureResponse_7(status); + } + + static void OnSuccessCallback_7(void * context, int16_t capacity) + { + (static_cast(context))->OnSuccessResponse_7(capacity); + } + + // + // Tests methods + // + + CHIP_ERROR TestReadTheMandatoryAttributeMaxPressure_0() + { + chip::Controller::PumpConfigurationAndControlClusterTest cluster; + cluster.Associate(mDevice, 1); + + return cluster.ReadAttributeMaxPressure(mOnSuccessCallback_0.Cancel(), mOnFailureCallback_0.Cancel()); + } + + void OnFailureResponse_0(uint8_t status) { ThrowFailureResponse(); } + + void OnSuccessResponse_0(int16_t maxPressure) + { + VerifyOrReturn(CheckConstraintType("maxPressure", "", "int16")); + NextTest(); + } + + CHIP_ERROR TestReadTheMandatoryAttributeEffectiveOperationMode_1() + { + chip::Controller::PumpConfigurationAndControlClusterTest cluster; + cluster.Associate(mDevice, 1); + + return cluster.ReadAttributeEffectiveOperationMode(mOnSuccessCallback_1.Cancel(), mOnFailureCallback_1.Cancel()); + } + + void OnFailureResponse_1(uint8_t status) { ThrowFailureResponse(); } + + void OnSuccessResponse_1(uint8_t effectiveOperationMode) + { + VerifyOrReturn(CheckConstraintType("effectiveOperationMode", "", "enum8")); + NextTest(); + } + + CHIP_ERROR TestReadTheMandatoryAttributeEffectiveControlMode_2() + { + chip::Controller::PumpConfigurationAndControlClusterTest cluster; + cluster.Associate(mDevice, 1); + + return cluster.ReadAttributeEffectiveControlMode(mOnSuccessCallback_2.Cancel(), mOnFailureCallback_2.Cancel()); + } + + void OnFailureResponse_2(uint8_t status) { ThrowFailureResponse(); } + + void OnSuccessResponse_2(uint8_t effectiveControlMode) + { + VerifyOrReturn(CheckConstraintType("effectiveControlMode", "", "enum8")); + NextTest(); + } + + CHIP_ERROR TestReadTheMandatoryAttributeCapacity_3() + { + chip::Controller::PumpConfigurationAndControlClusterTest cluster; + cluster.Associate(mDevice, 1); + + return cluster.ReadAttributeCapacity(mOnSuccessCallback_3.Cancel(), mOnFailureCallback_3.Cancel()); + } + + void OnFailureResponse_3(uint8_t status) { ThrowFailureResponse(); } + + void OnSuccessResponse_3(int16_t capacity) + { + VerifyOrReturn(CheckConstraintType("capacity", "", "int16")); + NextTest(); + } + + CHIP_ERROR TestReadTheMandatoryAttributeMaxPressure_4() + { + chip::Controller::PumpConfigurationAndControlClusterTest cluster; + cluster.Associate(mDevice, 1); + + return cluster.ReadAttributeMaxPressure(mOnSuccessCallback_4.Cancel(), mOnFailureCallback_4.Cancel()); + } + + void OnFailureResponse_4(uint8_t status) { ThrowFailureResponse(); } + + void OnSuccessResponse_4(int16_t maxPressure) + { + VerifyOrReturn(CheckConstraintType("maxPressure", "", "int16")); + NextTest(); + } + + CHIP_ERROR TestReadTheMandatoryAttributeEffectiveOperationMode_5() + { + chip::Controller::PumpConfigurationAndControlClusterTest cluster; + cluster.Associate(mDevice, 1); + + return cluster.ReadAttributeEffectiveOperationMode(mOnSuccessCallback_5.Cancel(), mOnFailureCallback_5.Cancel()); + } + + void OnFailureResponse_5(uint8_t status) { ThrowFailureResponse(); } + + void OnSuccessResponse_5(uint8_t effectiveOperationMode) + { + VerifyOrReturn(CheckConstraintType("effectiveOperationMode", "", "enum8")); + NextTest(); + } + + CHIP_ERROR TestReadTheMandatoryAttributeEffectiveControlMode_6() + { + chip::Controller::PumpConfigurationAndControlClusterTest cluster; + cluster.Associate(mDevice, 1); + + return cluster.ReadAttributeEffectiveControlMode(mOnSuccessCallback_6.Cancel(), mOnFailureCallback_6.Cancel()); + } + + void OnFailureResponse_6(uint8_t status) { ThrowFailureResponse(); } + + void OnSuccessResponse_6(uint8_t effectiveControlMode) + { + VerifyOrReturn(CheckConstraintType("effectiveControlMode", "", "enum8")); + NextTest(); + } + + CHIP_ERROR TestReadTheMandatoryAttributeCapacity_7() + { + chip::Controller::PumpConfigurationAndControlClusterTest cluster; + cluster.Associate(mDevice, 1); + + return cluster.ReadAttributeCapacity(mOnSuccessCallback_7.Cancel(), mOnFailureCallback_7.Cancel()); + } + + void OnFailureResponse_7(uint8_t status) { ThrowFailureResponse(); } + + void OnSuccessResponse_7(int16_t capacity) + { + VerifyOrReturn(CheckConstraintType("capacity", "", "int16")); + NextTest(); + } +}; + +class Test_TC_CC_3_1 : public TestCommand +{ +public: + Test_TC_CC_3_1() : TestCommand("Test_TC_CC_3_1"), mTestIndex(0) {} + + /////////// TestCommand Interface ///////// + void NextTest() override + { + CHIP_ERROR err = CHIP_NO_ERROR; + + if (0 == mTestIndex) + { + ChipLogProgress(chipTool, " **** Test Start: Test_TC_CC_3_1\n"); + } + + if (mTestCount == mTestIndex) + { + ChipLogProgress(chipTool, " **** Test Complete: Test_TC_CC_3_1\n"); + SetCommandExitStatus(CHIP_NO_ERROR); + return; + } + + // Ensure we increment mTestIndex before we start running the relevant + // command. That way if we lose the timeslice after we send the message + // but before our function call returns, we won't end up with an + // incorrect mTestIndex value observed when we get the response. + switch (mTestIndex++) + { + case 0: + ChipLogProgress(chipTool, " ***** Test Step 0 : Turn on light for color control tests\n"); + err = TestTurnOnLightForColorControlTests_0(); + break; + case 1: + ChipLogProgress(chipTool, " ***** Test Step 1 : Check on/off attribute value is true after on command\n"); + err = TestCheckOnOffAttributeValueIsTrueAfterOnCommand_1(); + break; + case 2: + ChipLogProgress(chipTool, " ***** Test Step 2 : Move to hue shortest distance command\n"); + err = TestMoveToHueShortestDistanceCommand_2(); + break; + case 3: + ChipLogProgress(chipTool, " ***** Test Step 3 : Move to hue longest distance command\n"); + err = TestMoveToHueLongestDistanceCommand_3(); + break; + case 4: + ChipLogProgress(chipTool, " ***** Test Step 4 : Move to hue up command\n"); + err = TestMoveToHueUpCommand_4(); + break; + case 5: + ChipLogProgress(chipTool, " ***** Test Step 5 : Move to hue down command\n"); + err = TestMoveToHueDownCommand_5(); + break; + case 6: + ChipLogProgress(chipTool, " ***** Test Step 6 : Turn off light that we turned on\n"); + err = TestTurnOffLightThatWeTurnedOn_6(); + break; + case 7: + ChipLogProgress(chipTool, " ***** Test Step 7 : Check on/off attribute value is false after off command\n"); + err = TestCheckOnOffAttributeValueIsFalseAfterOffCommand_7(); + break; + } + + if (CHIP_NO_ERROR != err) + { + ChipLogError(chipTool, " ***** Test Failure: %s\n", chip::ErrorStr(err)); + SetCommandExitStatus(err); + } + } + +private: + std::atomic_uint16_t mTestIndex; + const uint16_t mTestCount = 8; + + chip::Callback::Callback mOnFailureCallback_0{ OnFailureCallback_0, this }; + chip::Callback::Callback mOnSuccessCallback_0{ OnSuccessCallback_0, this }; + chip::Callback::Callback mOnFailureCallback_1{ OnFailureCallback_1, this }; + chip::Callback::Callback mOnSuccessCallback_1{ OnSuccessCallback_1, this }; + chip::Callback::Callback mOnFailureCallback_2{ OnFailureCallback_2, this }; + chip::Callback::Callback mOnSuccessCallback_2{ OnSuccessCallback_2, this }; + chip::Callback::Callback mOnFailureCallback_3{ OnFailureCallback_3, this }; + chip::Callback::Callback mOnSuccessCallback_3{ OnSuccessCallback_3, this }; + chip::Callback::Callback mOnFailureCallback_4{ OnFailureCallback_4, this }; + chip::Callback::Callback mOnSuccessCallback_4{ OnSuccessCallback_4, this }; + chip::Callback::Callback mOnFailureCallback_5{ OnFailureCallback_5, this }; + chip::Callback::Callback mOnSuccessCallback_5{ OnSuccessCallback_5, this }; + chip::Callback::Callback mOnFailureCallback_6{ OnFailureCallback_6, this }; + chip::Callback::Callback mOnSuccessCallback_6{ OnSuccessCallback_6, this }; + chip::Callback::Callback mOnFailureCallback_7{ OnFailureCallback_7, this }; + chip::Callback::Callback mOnSuccessCallback_7{ OnSuccessCallback_7, this }; + + static void OnFailureCallback_0(void * context, uint8_t status) + { + (static_cast(context))->OnFailureResponse_0(status); + } + + static void OnSuccessCallback_0(void * context) { (static_cast(context))->OnSuccessResponse_0(); } + + static void OnFailureCallback_1(void * context, uint8_t status) + { + (static_cast(context))->OnFailureResponse_1(status); + } + + static void OnSuccessCallback_1(void * context, bool onOff) + { + (static_cast(context))->OnSuccessResponse_1(onOff); + } + + static void OnFailureCallback_2(void * context, uint8_t status) + { + (static_cast(context))->OnFailureResponse_2(status); + } + + static void OnSuccessCallback_2(void * context) { (static_cast(context))->OnSuccessResponse_2(); } + + static void OnFailureCallback_3(void * context, uint8_t status) + { + (static_cast(context))->OnFailureResponse_3(status); + } + + static void OnSuccessCallback_3(void * context) { (static_cast(context))->OnSuccessResponse_3(); } + + static void OnFailureCallback_4(void * context, uint8_t status) + { + (static_cast(context))->OnFailureResponse_4(status); + } + + static void OnSuccessCallback_4(void * context) { (static_cast(context))->OnSuccessResponse_4(); } + + static void OnFailureCallback_5(void * context, uint8_t status) + { + (static_cast(context))->OnFailureResponse_5(status); + } + + static void OnSuccessCallback_5(void * context) { (static_cast(context))->OnSuccessResponse_5(); } + + static void OnFailureCallback_6(void * context, uint8_t status) + { + (static_cast(context))->OnFailureResponse_6(status); + } + + static void OnSuccessCallback_6(void * context) { (static_cast(context))->OnSuccessResponse_6(); } + + static void OnFailureCallback_7(void * context, uint8_t status) + { + (static_cast(context))->OnFailureResponse_7(status); + } + + static void OnSuccessCallback_7(void * context, bool onOff) + { + (static_cast(context))->OnSuccessResponse_7(onOff); + } + + // + // Tests methods + // + + CHIP_ERROR TestTurnOnLightForColorControlTests_0() + { + chip::Controller::OnOffClusterTest cluster; + cluster.Associate(mDevice, 1); + + return cluster.On(mOnSuccessCallback_0.Cancel(), mOnFailureCallback_0.Cancel()); + } + + void OnFailureResponse_0(uint8_t status) { ThrowFailureResponse(); } + + void OnSuccessResponse_0() { NextTest(); } + + CHIP_ERROR TestCheckOnOffAttributeValueIsTrueAfterOnCommand_1() + { + chip::Controller::OnOffClusterTest cluster; + cluster.Associate(mDevice, 1); + + return cluster.ReadAttributeOnOff(mOnSuccessCallback_1.Cancel(), mOnFailureCallback_1.Cancel()); + } + + void OnFailureResponse_1(uint8_t status) { ThrowFailureResponse(); } + + void OnSuccessResponse_1(bool onOff) + { + VerifyOrReturn(CheckValue("onOff", onOff, 1)); + NextTest(); + } + + CHIP_ERROR TestMoveToHueShortestDistanceCommand_2() + { + chip::Controller::ColorControlClusterTest cluster; + cluster.Associate(mDevice, 1); + + uint8_t hueArgument = 150; + uint8_t directionArgument = 0; + uint16_t transitionTimeArgument = 100U; + uint8_t optionsMaskArgument = 0; + uint8_t optionsOverrideArgument = 0; + + return cluster.MoveToHue(mOnSuccessCallback_2.Cancel(), mOnFailureCallback_2.Cancel(), hueArgument, directionArgument, + transitionTimeArgument, optionsMaskArgument, optionsOverrideArgument); + } + + void OnFailureResponse_2(uint8_t status) { ThrowFailureResponse(); } + + void OnSuccessResponse_2() { NextTest(); } + + CHIP_ERROR TestMoveToHueLongestDistanceCommand_3() + { + chip::Controller::ColorControlClusterTest cluster; + cluster.Associate(mDevice, 1); + + uint8_t hueArgument = 200; + uint8_t directionArgument = 1; + uint16_t transitionTimeArgument = 100U; + uint8_t optionsMaskArgument = 0; + uint8_t optionsOverrideArgument = 0; + + return cluster.MoveToHue(mOnSuccessCallback_3.Cancel(), mOnFailureCallback_3.Cancel(), hueArgument, directionArgument, + transitionTimeArgument, optionsMaskArgument, optionsOverrideArgument); + } + + void OnFailureResponse_3(uint8_t status) { ThrowFailureResponse(); } + + void OnSuccessResponse_3() { NextTest(); } + + CHIP_ERROR TestMoveToHueUpCommand_4() + { + chip::Controller::ColorControlClusterTest cluster; + cluster.Associate(mDevice, 1); + + uint8_t hueArgument = 250; + uint8_t directionArgument = 2; + uint16_t transitionTimeArgument = 100U; + uint8_t optionsMaskArgument = 0; + uint8_t optionsOverrideArgument = 0; + + return cluster.MoveToHue(mOnSuccessCallback_4.Cancel(), mOnFailureCallback_4.Cancel(), hueArgument, directionArgument, + transitionTimeArgument, optionsMaskArgument, optionsOverrideArgument); + } + + void OnFailureResponse_4(uint8_t status) { ThrowFailureResponse(); } + + void OnSuccessResponse_4() { NextTest(); } + + CHIP_ERROR TestMoveToHueDownCommand_5() + { + chip::Controller::ColorControlClusterTest cluster; + cluster.Associate(mDevice, 1); + + uint8_t hueArgument = 225; + uint8_t directionArgument = 3; + uint16_t transitionTimeArgument = 100U; + uint8_t optionsMaskArgument = 0; + uint8_t optionsOverrideArgument = 0; + + return cluster.MoveToHue(mOnSuccessCallback_5.Cancel(), mOnFailureCallback_5.Cancel(), hueArgument, directionArgument, + transitionTimeArgument, optionsMaskArgument, optionsOverrideArgument); + } + + void OnFailureResponse_5(uint8_t status) { ThrowFailureResponse(); } + + void OnSuccessResponse_5() { NextTest(); } + + CHIP_ERROR TestTurnOffLightThatWeTurnedOn_6() + { + chip::Controller::OnOffClusterTest cluster; + cluster.Associate(mDevice, 1); + + return cluster.Off(mOnSuccessCallback_6.Cancel(), mOnFailureCallback_6.Cancel()); + } + + void OnFailureResponse_6(uint8_t status) { ThrowFailureResponse(); } + + void OnSuccessResponse_6() { NextTest(); } + + CHIP_ERROR TestCheckOnOffAttributeValueIsFalseAfterOffCommand_7() + { + chip::Controller::OnOffClusterTest cluster; + cluster.Associate(mDevice, 1); + + return cluster.ReadAttributeOnOff(mOnSuccessCallback_7.Cancel(), mOnFailureCallback_7.Cancel()); + } + + void OnFailureResponse_7(uint8_t status) { ThrowFailureResponse(); } + + void OnSuccessResponse_7(bool onOff) + { + VerifyOrReturn(CheckValue("onOff", onOff, 0)); + NextTest(); + } +}; + +class Test_TC_CC_3_2 : public TestCommand +{ +public: + Test_TC_CC_3_2() : TestCommand("Test_TC_CC_3_2"), mTestIndex(0) {} + + /////////// TestCommand Interface ///////// + void NextTest() override + { + CHIP_ERROR err = CHIP_NO_ERROR; + + if (0 == mTestIndex) + { + ChipLogProgress(chipTool, " **** Test Start: Test_TC_CC_3_2\n"); + } + + if (mTestCount == mTestIndex) + { + ChipLogProgress(chipTool, " **** Test Complete: Test_TC_CC_3_2\n"); + SetCommandExitStatus(CHIP_NO_ERROR); + return; + } + + // Ensure we increment mTestIndex before we start running the relevant + // command. That way if we lose the timeslice after we send the message + // but before our function call returns, we won't end up with an + // incorrect mTestIndex value observed when we get the response. + switch (mTestIndex++) + { + case 0: + ChipLogProgress(chipTool, " ***** Test Step 0 : Turn on light for color control tests\n"); + err = TestTurnOnLightForColorControlTests_0(); + break; + case 1: + ChipLogProgress(chipTool, " ***** Test Step 1 : Check on/off attribute value is true after on command\n"); + err = TestCheckOnOffAttributeValueIsTrueAfterOnCommand_1(); + break; + case 2: + ChipLogProgress(chipTool, " ***** Test Step 2 : Move hue up command\n"); + err = TestMoveHueUpCommand_2(); + break; + case 3: + ChipLogProgress(chipTool, " ***** Test Step 3 : Move hue stop command\n"); + err = TestMoveHueStopCommand_3(); + break; + case 4: + ChipLogProgress(chipTool, " ***** Test Step 4 : Move hue down command\n"); + err = TestMoveHueDownCommand_4(); + break; + case 5: + ChipLogProgress(chipTool, " ***** Test Step 5 : Move hue stop command\n"); + err = TestMoveHueStopCommand_5(); + break; + case 6: + ChipLogProgress(chipTool, " ***** Test Step 6 : Turn off light that we turned on\n"); + err = TestTurnOffLightThatWeTurnedOn_6(); + break; + case 7: + ChipLogProgress(chipTool, " ***** Test Step 7 : Check on/off attribute value is false after off command\n"); + err = TestCheckOnOffAttributeValueIsFalseAfterOffCommand_7(); + break; + } + + if (CHIP_NO_ERROR != err) + { + ChipLogError(chipTool, " ***** Test Failure: %s\n", chip::ErrorStr(err)); + SetCommandExitStatus(err); + } + } + +private: + std::atomic_uint16_t mTestIndex; + const uint16_t mTestCount = 8; + + chip::Callback::Callback mOnFailureCallback_0{ OnFailureCallback_0, this }; + chip::Callback::Callback mOnSuccessCallback_0{ OnSuccessCallback_0, this }; + chip::Callback::Callback mOnFailureCallback_1{ OnFailureCallback_1, this }; + chip::Callback::Callback mOnSuccessCallback_1{ OnSuccessCallback_1, this }; + chip::Callback::Callback mOnFailureCallback_2{ OnFailureCallback_2, this }; + chip::Callback::Callback mOnSuccessCallback_2{ OnSuccessCallback_2, this }; + chip::Callback::Callback mOnFailureCallback_3{ OnFailureCallback_3, this }; + chip::Callback::Callback mOnSuccessCallback_3{ OnSuccessCallback_3, this }; + chip::Callback::Callback mOnFailureCallback_4{ OnFailureCallback_4, this }; + chip::Callback::Callback mOnSuccessCallback_4{ OnSuccessCallback_4, this }; + chip::Callback::Callback mOnFailureCallback_5{ OnFailureCallback_5, this }; + chip::Callback::Callback mOnSuccessCallback_5{ OnSuccessCallback_5, this }; + chip::Callback::Callback mOnFailureCallback_6{ OnFailureCallback_6, this }; + chip::Callback::Callback mOnSuccessCallback_6{ OnSuccessCallback_6, this }; + chip::Callback::Callback mOnFailureCallback_7{ OnFailureCallback_7, this }; + chip::Callback::Callback mOnSuccessCallback_7{ OnSuccessCallback_7, this }; + + static void OnFailureCallback_0(void * context, uint8_t status) + { + (static_cast(context))->OnFailureResponse_0(status); + } + + static void OnSuccessCallback_0(void * context) { (static_cast(context))->OnSuccessResponse_0(); } + + static void OnFailureCallback_1(void * context, uint8_t status) + { + (static_cast(context))->OnFailureResponse_1(status); + } + + static void OnSuccessCallback_1(void * context, bool onOff) + { + (static_cast(context))->OnSuccessResponse_1(onOff); + } + + static void OnFailureCallback_2(void * context, uint8_t status) + { + (static_cast(context))->OnFailureResponse_2(status); + } + + static void OnSuccessCallback_2(void * context) { (static_cast(context))->OnSuccessResponse_2(); } + + static void OnFailureCallback_3(void * context, uint8_t status) + { + (static_cast(context))->OnFailureResponse_3(status); + } + + static void OnSuccessCallback_3(void * context) { (static_cast(context))->OnSuccessResponse_3(); } + + static void OnFailureCallback_4(void * context, uint8_t status) + { + (static_cast(context))->OnFailureResponse_4(status); + } + + static void OnSuccessCallback_4(void * context) { (static_cast(context))->OnSuccessResponse_4(); } + + static void OnFailureCallback_5(void * context, uint8_t status) + { + (static_cast(context))->OnFailureResponse_5(status); + } + + static void OnSuccessCallback_5(void * context) { (static_cast(context))->OnSuccessResponse_5(); } + + static void OnFailureCallback_6(void * context, uint8_t status) + { + (static_cast(context))->OnFailureResponse_6(status); + } + + static void OnSuccessCallback_6(void * context) { (static_cast(context))->OnSuccessResponse_6(); } + + static void OnFailureCallback_7(void * context, uint8_t status) + { + (static_cast(context))->OnFailureResponse_7(status); + } + + static void OnSuccessCallback_7(void * context, bool onOff) + { + (static_cast(context))->OnSuccessResponse_7(onOff); + } + + // + // Tests methods + // + + CHIP_ERROR TestTurnOnLightForColorControlTests_0() + { + chip::Controller::OnOffClusterTest cluster; + cluster.Associate(mDevice, 1); + + return cluster.On(mOnSuccessCallback_0.Cancel(), mOnFailureCallback_0.Cancel()); + } + + void OnFailureResponse_0(uint8_t status) { ThrowFailureResponse(); } + + void OnSuccessResponse_0() { NextTest(); } + + CHIP_ERROR TestCheckOnOffAttributeValueIsTrueAfterOnCommand_1() + { + chip::Controller::OnOffClusterTest cluster; + cluster.Associate(mDevice, 1); + + return cluster.ReadAttributeOnOff(mOnSuccessCallback_1.Cancel(), mOnFailureCallback_1.Cancel()); + } + + void OnFailureResponse_1(uint8_t status) { ThrowFailureResponse(); } + + void OnSuccessResponse_1(bool onOff) + { + VerifyOrReturn(CheckValue("onOff", onOff, 1)); + NextTest(); + } + + CHIP_ERROR TestMoveHueUpCommand_2() + { + chip::Controller::ColorControlClusterTest cluster; + cluster.Associate(mDevice, 1); + + uint8_t moveModeArgument = 1; + uint8_t rateArgument = 50; + uint8_t optionsMaskArgument = 0; + uint8_t optionsOverrideArgument = 0; + + return cluster.MoveHue(mOnSuccessCallback_2.Cancel(), mOnFailureCallback_2.Cancel(), moveModeArgument, rateArgument, + optionsMaskArgument, optionsOverrideArgument); + } + + void OnFailureResponse_2(uint8_t status) { ThrowFailureResponse(); } + + void OnSuccessResponse_2() { NextTest(); } + + CHIP_ERROR TestMoveHueStopCommand_3() + { + chip::Controller::ColorControlClusterTest cluster; + cluster.Associate(mDevice, 1); + + uint8_t moveModeArgument = 0; + uint8_t rateArgument = 50; + uint8_t optionsMaskArgument = 0; + uint8_t optionsOverrideArgument = 0; + + return cluster.MoveHue(mOnSuccessCallback_3.Cancel(), mOnFailureCallback_3.Cancel(), moveModeArgument, rateArgument, + optionsMaskArgument, optionsOverrideArgument); + } + + void OnFailureResponse_3(uint8_t status) { ThrowFailureResponse(); } + + void OnSuccessResponse_3() { NextTest(); } + + CHIP_ERROR TestMoveHueDownCommand_4() + { + chip::Controller::ColorControlClusterTest cluster; + cluster.Associate(mDevice, 1); + + uint8_t moveModeArgument = 3; + uint8_t rateArgument = 50; + uint8_t optionsMaskArgument = 0; + uint8_t optionsOverrideArgument = 0; + + return cluster.MoveHue(mOnSuccessCallback_4.Cancel(), mOnFailureCallback_4.Cancel(), moveModeArgument, rateArgument, + optionsMaskArgument, optionsOverrideArgument); + } + + void OnFailureResponse_4(uint8_t status) { ThrowFailureResponse(); } + + void OnSuccessResponse_4() { NextTest(); } + + CHIP_ERROR TestMoveHueStopCommand_5() + { + chip::Controller::ColorControlClusterTest cluster; + cluster.Associate(mDevice, 1); + + uint8_t moveModeArgument = 0; + uint8_t rateArgument = 50; + uint8_t optionsMaskArgument = 0; + uint8_t optionsOverrideArgument = 0; + + return cluster.MoveHue(mOnSuccessCallback_5.Cancel(), mOnFailureCallback_5.Cancel(), moveModeArgument, rateArgument, + optionsMaskArgument, optionsOverrideArgument); + } + + void OnFailureResponse_5(uint8_t status) { ThrowFailureResponse(); } + + void OnSuccessResponse_5() { NextTest(); } + + CHIP_ERROR TestTurnOffLightThatWeTurnedOn_6() + { + chip::Controller::OnOffClusterTest cluster; + cluster.Associate(mDevice, 1); + + return cluster.Off(mOnSuccessCallback_6.Cancel(), mOnFailureCallback_6.Cancel()); + } + + void OnFailureResponse_6(uint8_t status) { ThrowFailureResponse(); } + + void OnSuccessResponse_6() { NextTest(); } + + CHIP_ERROR TestCheckOnOffAttributeValueIsFalseAfterOffCommand_7() + { + chip::Controller::OnOffClusterTest cluster; + cluster.Associate(mDevice, 1); + + return cluster.ReadAttributeOnOff(mOnSuccessCallback_7.Cancel(), mOnFailureCallback_7.Cancel()); + } + + void OnFailureResponse_7(uint8_t status) { ThrowFailureResponse(); } + + void OnSuccessResponse_7(bool onOff) + { + VerifyOrReturn(CheckValue("onOff", onOff, 0)); + NextTest(); + } +}; + +class Test_TC_CC_3_3 : public TestCommand +{ +public: + Test_TC_CC_3_3() : TestCommand("Test_TC_CC_3_3"), mTestIndex(0) {} + + /////////// TestCommand Interface ///////// + void NextTest() override + { + CHIP_ERROR err = CHIP_NO_ERROR; + + if (0 == mTestIndex) + { + ChipLogProgress(chipTool, " **** Test Start: Test_TC_CC_3_3\n"); + } + + if (mTestCount == mTestIndex) + { + ChipLogProgress(chipTool, " **** Test Complete: Test_TC_CC_3_3\n"); + SetCommandExitStatus(CHIP_NO_ERROR); + return; + } + + // Ensure we increment mTestIndex before we start running the relevant + // command. That way if we lose the timeslice after we send the message + // but before our function call returns, we won't end up with an + // incorrect mTestIndex value observed when we get the response. + switch (mTestIndex++) + { + case 0: + ChipLogProgress(chipTool, " ***** Test Step 0 : Turn on light for color control tests\n"); + err = TestTurnOnLightForColorControlTests_0(); + break; + case 1: + ChipLogProgress(chipTool, " ***** Test Step 1 : Check on/off attribute value is true after on command\n"); + err = TestCheckOnOffAttributeValueIsTrueAfterOnCommand_1(); + break; + case 2: + ChipLogProgress(chipTool, " ***** Test Step 2 : Step hue up command\n"); + err = TestStepHueUpCommand_2(); + break; + case 3: + ChipLogProgress(chipTool, " ***** Test Step 3 : Step hue down command\n"); + err = TestStepHueDownCommand_3(); + break; + case 4: + ChipLogProgress(chipTool, " ***** Test Step 4 : Turn off light that we turned on\n"); + err = TestTurnOffLightThatWeTurnedOn_4(); + break; + case 5: + ChipLogProgress(chipTool, " ***** Test Step 5 : Check on/off attribute value is false after off command\n"); + err = TestCheckOnOffAttributeValueIsFalseAfterOffCommand_5(); + break; + } + + if (CHIP_NO_ERROR != err) + { + ChipLogError(chipTool, " ***** Test Failure: %s\n", chip::ErrorStr(err)); + SetCommandExitStatus(err); + } + } + +private: + std::atomic_uint16_t mTestIndex; + const uint16_t mTestCount = 6; + + chip::Callback::Callback mOnFailureCallback_0{ OnFailureCallback_0, this }; + chip::Callback::Callback mOnSuccessCallback_0{ OnSuccessCallback_0, this }; + chip::Callback::Callback mOnFailureCallback_1{ OnFailureCallback_1, this }; + chip::Callback::Callback mOnSuccessCallback_1{ OnSuccessCallback_1, this }; + chip::Callback::Callback mOnFailureCallback_2{ OnFailureCallback_2, this }; + chip::Callback::Callback mOnSuccessCallback_2{ OnSuccessCallback_2, this }; + chip::Callback::Callback mOnFailureCallback_3{ OnFailureCallback_3, this }; + chip::Callback::Callback mOnSuccessCallback_3{ OnSuccessCallback_3, this }; + chip::Callback::Callback mOnFailureCallback_4{ OnFailureCallback_4, this }; + chip::Callback::Callback mOnSuccessCallback_4{ OnSuccessCallback_4, this }; + chip::Callback::Callback mOnFailureCallback_5{ OnFailureCallback_5, this }; + chip::Callback::Callback mOnSuccessCallback_5{ OnSuccessCallback_5, this }; + + static void OnFailureCallback_0(void * context, uint8_t status) + { + (static_cast(context))->OnFailureResponse_0(status); + } + + static void OnSuccessCallback_0(void * context) { (static_cast(context))->OnSuccessResponse_0(); } + + static void OnFailureCallback_1(void * context, uint8_t status) + { + (static_cast(context))->OnFailureResponse_1(status); + } + + static void OnSuccessCallback_1(void * context, bool onOff) + { + (static_cast(context))->OnSuccessResponse_1(onOff); + } + + static void OnFailureCallback_2(void * context, uint8_t status) + { + (static_cast(context))->OnFailureResponse_2(status); + } + + static void OnSuccessCallback_2(void * context) { (static_cast(context))->OnSuccessResponse_2(); } + + static void OnFailureCallback_3(void * context, uint8_t status) + { + (static_cast(context))->OnFailureResponse_3(status); + } + + static void OnSuccessCallback_3(void * context) { (static_cast(context))->OnSuccessResponse_3(); } + + static void OnFailureCallback_4(void * context, uint8_t status) + { + (static_cast(context))->OnFailureResponse_4(status); + } + + static void OnSuccessCallback_4(void * context) { (static_cast(context))->OnSuccessResponse_4(); } + + static void OnFailureCallback_5(void * context, uint8_t status) + { + (static_cast(context))->OnFailureResponse_5(status); + } + + static void OnSuccessCallback_5(void * context, bool onOff) + { + (static_cast(context))->OnSuccessResponse_5(onOff); + } + + // + // Tests methods + // + + CHIP_ERROR TestTurnOnLightForColorControlTests_0() + { + chip::Controller::OnOffClusterTest cluster; + cluster.Associate(mDevice, 1); + + return cluster.On(mOnSuccessCallback_0.Cancel(), mOnFailureCallback_0.Cancel()); + } + + void OnFailureResponse_0(uint8_t status) { ThrowFailureResponse(); } + + void OnSuccessResponse_0() { NextTest(); } + + CHIP_ERROR TestCheckOnOffAttributeValueIsTrueAfterOnCommand_1() + { + chip::Controller::OnOffClusterTest cluster; + cluster.Associate(mDevice, 1); + + return cluster.ReadAttributeOnOff(mOnSuccessCallback_1.Cancel(), mOnFailureCallback_1.Cancel()); + } + + void OnFailureResponse_1(uint8_t status) { ThrowFailureResponse(); } + + void OnSuccessResponse_1(bool onOff) + { + VerifyOrReturn(CheckValue("onOff", onOff, 1)); + NextTest(); + } + + CHIP_ERROR TestStepHueUpCommand_2() + { + chip::Controller::ColorControlClusterTest cluster; + cluster.Associate(mDevice, 1); + + uint8_t stepModeArgument = 1; + uint8_t stepSizeArgument = 5; + uint8_t transitionTimeArgument = 25; + uint8_t optionsMaskArgument = 0; + uint8_t optionsOverrideArgument = 0; + + return cluster.StepHue(mOnSuccessCallback_2.Cancel(), mOnFailureCallback_2.Cancel(), stepModeArgument, stepSizeArgument, + transitionTimeArgument, optionsMaskArgument, optionsOverrideArgument); + } + + void OnFailureResponse_2(uint8_t status) { ThrowFailureResponse(); } + + void OnSuccessResponse_2() { NextTest(); } + + CHIP_ERROR TestStepHueDownCommand_3() + { + chip::Controller::ColorControlClusterTest cluster; + cluster.Associate(mDevice, 1); + + uint8_t stepModeArgument = 3; + uint8_t stepSizeArgument = 5; + uint8_t transitionTimeArgument = 25; + uint8_t optionsMaskArgument = 0; + uint8_t optionsOverrideArgument = 0; + + return cluster.StepHue(mOnSuccessCallback_3.Cancel(), mOnFailureCallback_3.Cancel(), stepModeArgument, stepSizeArgument, + transitionTimeArgument, optionsMaskArgument, optionsOverrideArgument); + } + + void OnFailureResponse_3(uint8_t status) { ThrowFailureResponse(); } + + void OnSuccessResponse_3() { NextTest(); } + + CHIP_ERROR TestTurnOffLightThatWeTurnedOn_4() + { + chip::Controller::OnOffClusterTest cluster; + cluster.Associate(mDevice, 1); + + return cluster.Off(mOnSuccessCallback_4.Cancel(), mOnFailureCallback_4.Cancel()); + } + + void OnFailureResponse_4(uint8_t status) { ThrowFailureResponse(); } + + void OnSuccessResponse_4() { NextTest(); } + + CHIP_ERROR TestCheckOnOffAttributeValueIsFalseAfterOffCommand_5() + { + chip::Controller::OnOffClusterTest cluster; + cluster.Associate(mDevice, 1); + + return cluster.ReadAttributeOnOff(mOnSuccessCallback_5.Cancel(), mOnFailureCallback_5.Cancel()); + } + + void OnFailureResponse_5(uint8_t status) { ThrowFailureResponse(); } + + void OnSuccessResponse_5(bool onOff) + { + VerifyOrReturn(CheckValue("onOff", onOff, 0)); + NextTest(); + } +}; + +class Test_TC_CC_4_1 : public TestCommand +{ +public: + Test_TC_CC_4_1() : TestCommand("Test_TC_CC_4_1"), mTestIndex(0) {} + + /////////// TestCommand Interface ///////// + void NextTest() override + { + CHIP_ERROR err = CHIP_NO_ERROR; + + if (0 == mTestIndex) + { + ChipLogProgress(chipTool, " **** Test Start: Test_TC_CC_4_1\n"); + } + + if (mTestCount == mTestIndex) + { + ChipLogProgress(chipTool, " **** Test Complete: Test_TC_CC_4_1\n"); + SetCommandExitStatus(CHIP_NO_ERROR); + return; + } + + // Ensure we increment mTestIndex before we start running the relevant + // command. That way if we lose the timeslice after we send the message + // but before our function call returns, we won't end up with an + // incorrect mTestIndex value observed when we get the response. + switch (mTestIndex++) + { + case 0: + ChipLogProgress(chipTool, " ***** Test Step 0 : Turn on light for color control tests\n"); + err = TestTurnOnLightForColorControlTests_0(); + break; + case 1: + ChipLogProgress(chipTool, " ***** Test Step 1 : Check on/off attribute value is true after on command\n"); + err = TestCheckOnOffAttributeValueIsTrueAfterOnCommand_1(); + break; + case 2: + ChipLogProgress(chipTool, " ***** Test Step 2 : Move to saturation command\n"); + err = TestMoveToSaturationCommand_2(); + break; + case 3: + ChipLogProgress(chipTool, " ***** Test Step 3 : Turn off light that we turned on\n"); + err = TestTurnOffLightThatWeTurnedOn_3(); + break; + case 4: + ChipLogProgress(chipTool, " ***** Test Step 4 : Check on/off attribute value is false after off command\n"); + err = TestCheckOnOffAttributeValueIsFalseAfterOffCommand_4(); + break; + } - static void OnFailureCallback_12(void * context, uint8_t status) + if (CHIP_NO_ERROR != err) + { + ChipLogError(chipTool, " ***** Test Failure: %s\n", chip::ErrorStr(err)); + SetCommandExitStatus(err); + } + } + +private: + std::atomic_uint16_t mTestIndex; + const uint16_t mTestCount = 5; + + chip::Callback::Callback mOnFailureCallback_0{ OnFailureCallback_0, this }; + chip::Callback::Callback mOnSuccessCallback_0{ OnSuccessCallback_0, this }; + chip::Callback::Callback mOnFailureCallback_1{ OnFailureCallback_1, this }; + chip::Callback::Callback mOnSuccessCallback_1{ OnSuccessCallback_1, this }; + chip::Callback::Callback mOnFailureCallback_2{ OnFailureCallback_2, this }; + chip::Callback::Callback mOnSuccessCallback_2{ OnSuccessCallback_2, this }; + chip::Callback::Callback mOnFailureCallback_3{ OnFailureCallback_3, this }; + chip::Callback::Callback mOnSuccessCallback_3{ OnSuccessCallback_3, this }; + chip::Callback::Callback mOnFailureCallback_4{ OnFailureCallback_4, this }; + chip::Callback::Callback mOnSuccessCallback_4{ OnSuccessCallback_4, this }; + + static void OnFailureCallback_0(void * context, uint8_t status) + { + (static_cast(context))->OnFailureResponse_0(status); + } + + static void OnSuccessCallback_0(void * context) { (static_cast(context))->OnSuccessResponse_0(); } + + static void OnFailureCallback_1(void * context, uint8_t status) + { + (static_cast(context))->OnFailureResponse_1(status); + } + + static void OnSuccessCallback_1(void * context, bool onOff) + { + (static_cast(context))->OnSuccessResponse_1(onOff); + } + + static void OnFailureCallback_2(void * context, uint8_t status) + { + (static_cast(context))->OnFailureResponse_2(status); + } + + static void OnSuccessCallback_2(void * context) { (static_cast(context))->OnSuccessResponse_2(); } + + static void OnFailureCallback_3(void * context, uint8_t status) + { + (static_cast(context))->OnFailureResponse_3(status); + } + + static void OnSuccessCallback_3(void * context) { (static_cast(context))->OnSuccessResponse_3(); } + + static void OnFailureCallback_4(void * context, uint8_t status) { - (static_cast(context))->OnFailureResponse_12(status); + (static_cast(context))->OnFailureResponse_4(status); } - static void OnSuccessCallback_12(void * context, bool onOff) + static void OnSuccessCallback_4(void * context, bool onOff) { - (static_cast(context))->OnSuccessResponse_12(onOff); + (static_cast(context))->OnSuccessResponse_4(onOff); } // @@ -9521,204 +12033,280 @@ class Test_TC_CC_7 : public TestCommand NextTest(); } - CHIP_ERROR TestEnhancedMoveToHueCommand_2() + CHIP_ERROR TestMoveToSaturationCommand_2() { chip::Controller::ColorControlClusterTest cluster; cluster.Associate(mDevice, 1); - uint16_t enhancedHueArgument = 1025U; - uint8_t directionArgument = 0; - uint16_t transitionTimeArgument = 1U; + uint8_t saturationArgument = 90; + uint16_t transitionTimeArgument = 10U; uint8_t optionsMaskArgument = 0; uint8_t optionsOverrideArgument = 0; - return cluster.EnhancedMoveToHue(mOnSuccessCallback_2.Cancel(), mOnFailureCallback_2.Cancel(), enhancedHueArgument, - directionArgument, transitionTimeArgument, optionsMaskArgument, optionsOverrideArgument); + return cluster.MoveToSaturation(mOnSuccessCallback_2.Cancel(), mOnFailureCallback_2.Cancel(), saturationArgument, + transitionTimeArgument, optionsMaskArgument, optionsOverrideArgument); } void OnFailureResponse_2(uint8_t status) { ThrowFailureResponse(); } void OnSuccessResponse_2() { NextTest(); } - CHIP_ERROR TestCheckRemainingTimeAttributeValueMatchedTheValueSentByTheLastCommand_3() + CHIP_ERROR TestTurnOffLightThatWeTurnedOn_3() { - chip::Controller::ColorControlClusterTest cluster; + chip::Controller::OnOffClusterTest cluster; cluster.Associate(mDevice, 1); - return cluster.ReadAttributeRemainingTime(mOnSuccessCallback_3.Cancel(), mOnFailureCallback_3.Cancel()); + return cluster.Off(mOnSuccessCallback_3.Cancel(), mOnFailureCallback_3.Cancel()); } void OnFailureResponse_3(uint8_t status) { ThrowFailureResponse(); } - void OnSuccessResponse_3(uint16_t remainingTime) + void OnSuccessResponse_3() { NextTest(); } + + CHIP_ERROR TestCheckOnOffAttributeValueIsFalseAfterOffCommand_4() { - VerifyOrReturn(CheckValue("remainingTime", remainingTime, 1U)); + chip::Controller::OnOffClusterTest cluster; + cluster.Associate(mDevice, 1); + + return cluster.ReadAttributeOnOff(mOnSuccessCallback_4.Cancel(), mOnFailureCallback_4.Cancel()); + } + + void OnFailureResponse_4(uint8_t status) { ThrowFailureResponse(); } + + void OnSuccessResponse_4(bool onOff) + { + VerifyOrReturn(CheckValue("onOff", onOff, 0)); NextTest(); } +}; - CHIP_ERROR TestEnhancedMoveHueDownCommand_4() +class Test_TC_CC_4_2 : public TestCommand +{ +public: + Test_TC_CC_4_2() : TestCommand("Test_TC_CC_4_2"), mTestIndex(0) {} + + /////////// TestCommand Interface ///////// + void NextTest() override { - chip::Controller::ColorControlClusterTest cluster; - cluster.Associate(mDevice, 1); + CHIP_ERROR err = CHIP_NO_ERROR; - uint8_t moveModeArgument = 3; - uint16_t rateArgument = 5U; - uint8_t optionsMaskArgument = 0; - uint8_t optionsOverrideArgument = 0; + if (0 == mTestIndex) + { + ChipLogProgress(chipTool, " **** Test Start: Test_TC_CC_4_2\n"); + } - return cluster.EnhancedMoveHue(mOnSuccessCallback_4.Cancel(), mOnFailureCallback_4.Cancel(), moveModeArgument, rateArgument, - optionsMaskArgument, optionsOverrideArgument); + if (mTestCount == mTestIndex) + { + ChipLogProgress(chipTool, " **** Test Complete: Test_TC_CC_4_2\n"); + SetCommandExitStatus(CHIP_NO_ERROR); + return; + } + + // Ensure we increment mTestIndex before we start running the relevant + // command. That way if we lose the timeslice after we send the message + // but before our function call returns, we won't end up with an + // incorrect mTestIndex value observed when we get the response. + switch (mTestIndex++) + { + case 0: + ChipLogProgress(chipTool, " ***** Test Step 0 : Turn on light for color control tests\n"); + err = TestTurnOnLightForColorControlTests_0(); + break; + case 1: + ChipLogProgress(chipTool, " ***** Test Step 1 : Check on/off attribute value is true after on command\n"); + err = TestCheckOnOffAttributeValueIsTrueAfterOnCommand_1(); + break; + case 2: + ChipLogProgress(chipTool, " ***** Test Step 2 : Move saturation up command\n"); + err = TestMoveSaturationUpCommand_2(); + break; + case 3: + ChipLogProgress(chipTool, " ***** Test Step 3 : Move saturation down command\n"); + err = TestMoveSaturationDownCommand_3(); + break; + case 4: + ChipLogProgress(chipTool, " ***** Test Step 4 : Turn off light that we turned on\n"); + err = TestTurnOffLightThatWeTurnedOn_4(); + break; + case 5: + ChipLogProgress(chipTool, " ***** Test Step 5 : Check on/off attribute value is false after off command\n"); + err = TestCheckOnOffAttributeValueIsFalseAfterOffCommand_5(); + break; + } + + if (CHIP_NO_ERROR != err) + { + ChipLogError(chipTool, " ***** Test Failure: %s\n", chip::ErrorStr(err)); + SetCommandExitStatus(err); + } } - void OnFailureResponse_4(uint8_t status) { ThrowFailureResponse(); } +private: + std::atomic_uint16_t mTestIndex; + const uint16_t mTestCount = 6; - void OnSuccessResponse_4() { NextTest(); } + chip::Callback::Callback mOnFailureCallback_0{ OnFailureCallback_0, this }; + chip::Callback::Callback mOnSuccessCallback_0{ OnSuccessCallback_0, this }; + chip::Callback::Callback mOnFailureCallback_1{ OnFailureCallback_1, this }; + chip::Callback::Callback mOnSuccessCallback_1{ OnSuccessCallback_1, this }; + chip::Callback::Callback mOnFailureCallback_2{ OnFailureCallback_2, this }; + chip::Callback::Callback mOnSuccessCallback_2{ OnSuccessCallback_2, this }; + chip::Callback::Callback mOnFailureCallback_3{ OnFailureCallback_3, this }; + chip::Callback::Callback mOnSuccessCallback_3{ OnSuccessCallback_3, this }; + chip::Callback::Callback mOnFailureCallback_4{ OnFailureCallback_4, this }; + chip::Callback::Callback mOnSuccessCallback_4{ OnSuccessCallback_4, this }; + chip::Callback::Callback mOnFailureCallback_5{ OnFailureCallback_5, this }; + chip::Callback::Callback mOnSuccessCallback_5{ OnSuccessCallback_5, this }; - CHIP_ERROR TestEnhancedMoveHueStopCommand_5() + static void OnFailureCallback_0(void * context, uint8_t status) { - chip::Controller::ColorControlClusterTest cluster; - cluster.Associate(mDevice, 1); + (static_cast(context))->OnFailureResponse_0(status); + } - uint8_t moveModeArgument = 0; - uint16_t rateArgument = 0U; - uint8_t optionsMaskArgument = 0; - uint8_t optionsOverrideArgument = 0; + static void OnSuccessCallback_0(void * context) { (static_cast(context))->OnSuccessResponse_0(); } - return cluster.EnhancedMoveHue(mOnSuccessCallback_5.Cancel(), mOnFailureCallback_5.Cancel(), moveModeArgument, rateArgument, - optionsMaskArgument, optionsOverrideArgument); + static void OnFailureCallback_1(void * context, uint8_t status) + { + (static_cast(context))->OnFailureResponse_1(status); } - void OnFailureResponse_5(uint8_t status) { ThrowFailureResponse(); } + static void OnSuccessCallback_1(void * context, bool onOff) + { + (static_cast(context))->OnSuccessResponse_1(onOff); + } - void OnSuccessResponse_5() { NextTest(); } + static void OnFailureCallback_2(void * context, uint8_t status) + { + (static_cast(context))->OnFailureResponse_2(status); + } - CHIP_ERROR TestEnhancedMoveHueUpCommand_6() + static void OnSuccessCallback_2(void * context) { (static_cast(context))->OnSuccessResponse_2(); } + + static void OnFailureCallback_3(void * context, uint8_t status) { - chip::Controller::ColorControlClusterTest cluster; - cluster.Associate(mDevice, 1); + (static_cast(context))->OnFailureResponse_3(status); + } - uint8_t moveModeArgument = 1; - uint16_t rateArgument = 50U; - uint8_t optionsMaskArgument = 0; - uint8_t optionsOverrideArgument = 0; + static void OnSuccessCallback_3(void * context) { (static_cast(context))->OnSuccessResponse_3(); } - return cluster.EnhancedMoveHue(mOnSuccessCallback_6.Cancel(), mOnFailureCallback_6.Cancel(), moveModeArgument, rateArgument, - optionsMaskArgument, optionsOverrideArgument); + static void OnFailureCallback_4(void * context, uint8_t status) + { + (static_cast(context))->OnFailureResponse_4(status); } - void OnFailureResponse_6(uint8_t status) { ThrowFailureResponse(); } + static void OnSuccessCallback_4(void * context) { (static_cast(context))->OnSuccessResponse_4(); } - void OnSuccessResponse_6() { NextTest(); } + static void OnFailureCallback_5(void * context, uint8_t status) + { + (static_cast(context))->OnFailureResponse_5(status); + } - CHIP_ERROR TestEnhancedMoveHueStopCommand_7() + static void OnSuccessCallback_5(void * context, bool onOff) { - chip::Controller::ColorControlClusterTest cluster; - cluster.Associate(mDevice, 1); + (static_cast(context))->OnSuccessResponse_5(onOff); + } - uint8_t moveModeArgument = 0; - uint16_t rateArgument = 0U; - uint8_t optionsMaskArgument = 0; - uint8_t optionsOverrideArgument = 0; + // + // Tests methods + // - return cluster.EnhancedMoveHue(mOnSuccessCallback_7.Cancel(), mOnFailureCallback_7.Cancel(), moveModeArgument, rateArgument, - optionsMaskArgument, optionsOverrideArgument); + CHIP_ERROR TestTurnOnLightForColorControlTests_0() + { + chip::Controller::OnOffClusterTest cluster; + cluster.Associate(mDevice, 1); + + return cluster.On(mOnSuccessCallback_0.Cancel(), mOnFailureCallback_0.Cancel()); } - void OnFailureResponse_7(uint8_t status) { ThrowFailureResponse(); } + void OnFailureResponse_0(uint8_t status) { ThrowFailureResponse(); } - void OnSuccessResponse_7() { NextTest(); } + void OnSuccessResponse_0() { NextTest(); } - CHIP_ERROR TestEnhancedStepHueUpCommand_8() + CHIP_ERROR TestCheckOnOffAttributeValueIsTrueAfterOnCommand_1() { - chip::Controller::ColorControlClusterTest cluster; + chip::Controller::OnOffClusterTest cluster; cluster.Associate(mDevice, 1); - uint8_t stepModeArgument = 0; - uint16_t stepSizeArgument = 50U; - uint16_t transitionTimeArgument = 1U; - uint8_t optionsMaskArgument = 0; - uint8_t optionsOverrideArgument = 0; - - return cluster.EnhancedStepHue(mOnSuccessCallback_8.Cancel(), mOnFailureCallback_8.Cancel(), stepModeArgument, - stepSizeArgument, transitionTimeArgument, optionsMaskArgument, optionsOverrideArgument); + return cluster.ReadAttributeOnOff(mOnSuccessCallback_1.Cancel(), mOnFailureCallback_1.Cancel()); } - void OnFailureResponse_8(uint8_t status) { ThrowFailureResponse(); } + void OnFailureResponse_1(uint8_t status) { ThrowFailureResponse(); } - void OnSuccessResponse_8() { NextTest(); } + void OnSuccessResponse_1(bool onOff) + { + VerifyOrReturn(CheckValue("onOff", onOff, 1)); + NextTest(); + } - CHIP_ERROR TestEnhancedStepHueDownCommand_9() + CHIP_ERROR TestMoveSaturationUpCommand_2() { chip::Controller::ColorControlClusterTest cluster; cluster.Associate(mDevice, 1); - uint8_t stepModeArgument = 1; - uint16_t stepSizeArgument = 75U; - uint16_t transitionTimeArgument = 1U; + uint8_t moveModeArgument = 1; + uint8_t rateArgument = 5; uint8_t optionsMaskArgument = 0; uint8_t optionsOverrideArgument = 0; - return cluster.EnhancedStepHue(mOnSuccessCallback_9.Cancel(), mOnFailureCallback_9.Cancel(), stepModeArgument, - stepSizeArgument, transitionTimeArgument, optionsMaskArgument, optionsOverrideArgument); + return cluster.MoveSaturation(mOnSuccessCallback_2.Cancel(), mOnFailureCallback_2.Cancel(), moveModeArgument, rateArgument, + optionsMaskArgument, optionsOverrideArgument); } - void OnFailureResponse_9(uint8_t status) { ThrowFailureResponse(); } + void OnFailureResponse_2(uint8_t status) { ThrowFailureResponse(); } - void OnSuccessResponse_9() { NextTest(); } + void OnSuccessResponse_2() { NextTest(); } - CHIP_ERROR TestEnhancedMoveToHueAndSaturationCommand_10() + CHIP_ERROR TestMoveSaturationDownCommand_3() { chip::Controller::ColorControlClusterTest cluster; cluster.Associate(mDevice, 1); - uint16_t enhancedHueArgument = 1200U; - uint8_t saturationArgument = 90; - uint16_t transitionTimeArgument = 10U; + uint8_t moveModeArgument = 3; + uint8_t rateArgument = 5; uint8_t optionsMaskArgument = 0; uint8_t optionsOverrideArgument = 0; - return cluster.EnhancedMoveToHueAndSaturation(mOnSuccessCallback_10.Cancel(), mOnFailureCallback_10.Cancel(), - enhancedHueArgument, saturationArgument, transitionTimeArgument, - optionsMaskArgument, optionsOverrideArgument); + return cluster.MoveSaturation(mOnSuccessCallback_3.Cancel(), mOnFailureCallback_3.Cancel(), moveModeArgument, rateArgument, + optionsMaskArgument, optionsOverrideArgument); } - void OnFailureResponse_10(uint8_t status) { ThrowFailureResponse(); } + void OnFailureResponse_3(uint8_t status) { ThrowFailureResponse(); } - void OnSuccessResponse_10() { NextTest(); } + void OnSuccessResponse_3() { NextTest(); } - CHIP_ERROR TestTurnOffLightThatWeTurnedOn_11() + CHIP_ERROR TestTurnOffLightThatWeTurnedOn_4() { chip::Controller::OnOffClusterTest cluster; cluster.Associate(mDevice, 1); - return cluster.Off(mOnSuccessCallback_11.Cancel(), mOnFailureCallback_11.Cancel()); + return cluster.Off(mOnSuccessCallback_4.Cancel(), mOnFailureCallback_4.Cancel()); } - void OnFailureResponse_11(uint8_t status) { ThrowFailureResponse(); } + void OnFailureResponse_4(uint8_t status) { ThrowFailureResponse(); } - void OnSuccessResponse_11() { NextTest(); } + void OnSuccessResponse_4() { NextTest(); } - CHIP_ERROR TestCheckOnOffAttributeValueIsFalseAfterOffCommand_12() + CHIP_ERROR TestCheckOnOffAttributeValueIsFalseAfterOffCommand_5() { chip::Controller::OnOffClusterTest cluster; cluster.Associate(mDevice, 1); - return cluster.ReadAttributeOnOff(mOnSuccessCallback_12.Cancel(), mOnFailureCallback_12.Cancel()); + return cluster.ReadAttributeOnOff(mOnSuccessCallback_5.Cancel(), mOnFailureCallback_5.Cancel()); } - void OnFailureResponse_12(uint8_t status) { ThrowFailureResponse(); } + void OnFailureResponse_5(uint8_t status) { ThrowFailureResponse(); } - void OnSuccessResponse_12(bool onOff) + void OnSuccessResponse_5(bool onOff) { VerifyOrReturn(CheckValue("onOff", onOff, 0)); NextTest(); } }; -class Test_TC_CC_8 : public TestCommand +class Test_TC_CC_4_3 : public TestCommand { public: - Test_TC_CC_8() : TestCommand("Test_TC_CC_8"), mTestIndex(0) {} + Test_TC_CC_4_3() : TestCommand("Test_TC_CC_4_3"), mTestIndex(0) {} /////////// TestCommand Interface ///////// void NextTest() override @@ -9727,12 +12315,12 @@ class Test_TC_CC_8 : public TestCommand if (0 == mTestIndex) { - ChipLogProgress(chipTool, " **** Test Start: Test_TC_CC_8\n"); + ChipLogProgress(chipTool, " **** Test Start: Test_TC_CC_4_3\n"); } if (mTestCount == mTestIndex) { - ChipLogProgress(chipTool, " **** Test Complete: Test_TC_CC_8\n"); + ChipLogProgress(chipTool, " **** Test Complete: Test_TC_CC_4_3\n"); SetCommandExitStatus(CHIP_NO_ERROR); return; } @@ -9752,60 +12340,20 @@ class Test_TC_CC_8 : public TestCommand err = TestCheckOnOffAttributeValueIsTrueAfterOnCommand_1(); break; case 2: - ChipLogProgress(chipTool, " ***** Test Step 2 : Color Loop Set Command - Set all Attributs\n"); - err = TestColorLoopSetCommandSetAllAttributs_2(); + ChipLogProgress(chipTool, " ***** Test Step 2 : Step saturation up command\n"); + err = TestStepSaturationUpCommand_2(); break; case 3: - ChipLogProgress(chipTool, " ***** Test Step 3 : Check ColorLoopDirection Value\n"); - err = TestCheckColorLoopDirectionValue_3(); + ChipLogProgress(chipTool, " ***** Test Step 3 : Step saturation down command\n"); + err = TestStepSaturationDownCommand_3(); break; case 4: - ChipLogProgress(chipTool, " ***** Test Step 4 : Check ColorLoopTime Value\n"); - err = TestCheckColorLoopTimeValue_4(); + ChipLogProgress(chipTool, " ***** Test Step 4 : Turn off light that we turned on\n"); + err = TestTurnOffLightThatWeTurnedOn_4(); break; case 5: - ChipLogProgress(chipTool, " ***** Test Step 5 : Check ColorLoopStartEnhancedHue Value\n"); - err = TestCheckColorLoopStartEnhancedHueValue_5(); - break; - case 6: - ChipLogProgress(chipTool, " ***** Test Step 6 : Check ColorLoopActive Value\n"); - err = TestCheckColorLoopActiveValue_6(); - break; - case 7: - ChipLogProgress(chipTool, " ***** Test Step 7 : Color Loop Set Command - Start Color Loop\n"); - err = TestColorLoopSetCommandStartColorLoop_7(); - break; - case 8: - ChipLogProgress(chipTool, " ***** Test Step 8 : Check ColorLoopActive Value\n"); - err = TestCheckColorLoopActiveValue_8(); - break; - case 9: - ChipLogProgress(chipTool, " ***** Test Step 9 : Color Loop Set Command - Set direction and time while running\n"); - err = TestColorLoopSetCommandSetDirectionAndTimeWhileRunning_9(); - break; - case 10: - ChipLogProgress(chipTool, " ***** Test Step 10 : Check ColorLoopDirection Value\n"); - err = TestCheckColorLoopDirectionValue_10(); - break; - case 11: - ChipLogProgress(chipTool, " ***** Test Step 11 : Check ColorLoopTime Value\n"); - err = TestCheckColorLoopTimeValue_11(); - break; - case 12: - ChipLogProgress(chipTool, " ***** Test Step 12 : Color Loop Set Command - Set direction while running\n"); - err = TestColorLoopSetCommandSetDirectionWhileRunning_12(); - break; - case 13: - ChipLogProgress(chipTool, " ***** Test Step 13 : Check ColorLoopDirection Value\n"); - err = TestCheckColorLoopDirectionValue_13(); - break; - case 14: - ChipLogProgress(chipTool, " ***** Test Step 14 : Turn off light that we turned on\n"); - err = TestTurnOffLightThatWeTurnedOn_14(); - break; - case 15: - ChipLogProgress(chipTool, " ***** Test Step 15 : Check on/off attribute value is false after off command\n"); - err = TestCheckOnOffAttributeValueIsFalseAfterOffCommand_15(); + ChipLogProgress(chipTool, " ***** Test Step 5 : Check on/off attribute value is false after off command\n"); + err = TestCheckOnOffAttributeValueIsFalseAfterOffCommand_5(); break; } @@ -9818,7 +12366,7 @@ class Test_TC_CC_8 : public TestCommand private: std::atomic_uint16_t mTestIndex; - const uint16_t mTestCount = 16; + const uint16_t mTestCount = 6; chip::Callback::Callback mOnFailureCallback_0{ OnFailureCallback_0, this }; chip::Callback::Callback mOnSuccessCallback_0{ OnSuccessCallback_0, this }; @@ -9827,177 +12375,58 @@ class Test_TC_CC_8 : public TestCommand chip::Callback::Callback mOnFailureCallback_2{ OnFailureCallback_2, this }; chip::Callback::Callback mOnSuccessCallback_2{ OnSuccessCallback_2, this }; chip::Callback::Callback mOnFailureCallback_3{ OnFailureCallback_3, this }; - chip::Callback::Callback mOnSuccessCallback_3{ OnSuccessCallback_3, - this }; + chip::Callback::Callback mOnSuccessCallback_3{ OnSuccessCallback_3, this }; chip::Callback::Callback mOnFailureCallback_4{ OnFailureCallback_4, this }; - chip::Callback::Callback mOnSuccessCallback_4{ OnSuccessCallback_4, this }; + chip::Callback::Callback mOnSuccessCallback_4{ OnSuccessCallback_4, this }; chip::Callback::Callback mOnFailureCallback_5{ OnFailureCallback_5, this }; - chip::Callback::Callback mOnSuccessCallback_5{ - OnSuccessCallback_5, this - }; - chip::Callback::Callback mOnFailureCallback_6{ OnFailureCallback_6, this }; - chip::Callback::Callback mOnSuccessCallback_6{ OnSuccessCallback_6, this }; - chip::Callback::Callback mOnFailureCallback_7{ OnFailureCallback_7, this }; - chip::Callback::Callback mOnSuccessCallback_7{ OnSuccessCallback_7, this }; - chip::Callback::Callback mOnFailureCallback_8{ OnFailureCallback_8, this }; - chip::Callback::Callback mOnSuccessCallback_8{ OnSuccessCallback_8, this }; - chip::Callback::Callback mOnFailureCallback_9{ OnFailureCallback_9, this }; - chip::Callback::Callback mOnSuccessCallback_9{ OnSuccessCallback_9, this }; - chip::Callback::Callback mOnFailureCallback_10{ OnFailureCallback_10, this }; - chip::Callback::Callback mOnSuccessCallback_10{ OnSuccessCallback_10, - this }; - chip::Callback::Callback mOnFailureCallback_11{ OnFailureCallback_11, this }; - chip::Callback::Callback mOnSuccessCallback_11{ OnSuccessCallback_11, this }; - chip::Callback::Callback mOnFailureCallback_12{ OnFailureCallback_12, this }; - chip::Callback::Callback mOnSuccessCallback_12{ OnSuccessCallback_12, this }; - chip::Callback::Callback mOnFailureCallback_13{ OnFailureCallback_13, this }; - chip::Callback::Callback mOnSuccessCallback_13{ OnSuccessCallback_13, - this }; - chip::Callback::Callback mOnFailureCallback_14{ OnFailureCallback_14, this }; - chip::Callback::Callback mOnSuccessCallback_14{ OnSuccessCallback_14, this }; - chip::Callback::Callback mOnFailureCallback_15{ OnFailureCallback_15, this }; - chip::Callback::Callback mOnSuccessCallback_15{ OnSuccessCallback_15, this }; + chip::Callback::Callback mOnSuccessCallback_5{ OnSuccessCallback_5, this }; static void OnFailureCallback_0(void * context, uint8_t status) { - (static_cast(context))->OnFailureResponse_0(status); + (static_cast(context))->OnFailureResponse_0(status); } - static void OnSuccessCallback_0(void * context) { (static_cast(context))->OnSuccessResponse_0(); } + static void OnSuccessCallback_0(void * context) { (static_cast(context))->OnSuccessResponse_0(); } static void OnFailureCallback_1(void * context, uint8_t status) { - (static_cast(context))->OnFailureResponse_1(status); + (static_cast(context))->OnFailureResponse_1(status); } static void OnSuccessCallback_1(void * context, bool onOff) { - (static_cast(context))->OnSuccessResponse_1(onOff); + (static_cast(context))->OnSuccessResponse_1(onOff); } static void OnFailureCallback_2(void * context, uint8_t status) { - (static_cast(context))->OnFailureResponse_2(status); + (static_cast(context))->OnFailureResponse_2(status); } - static void OnSuccessCallback_2(void * context) { (static_cast(context))->OnSuccessResponse_2(); } + static void OnSuccessCallback_2(void * context) { (static_cast(context))->OnSuccessResponse_2(); } static void OnFailureCallback_3(void * context, uint8_t status) { - (static_cast(context))->OnFailureResponse_3(status); + (static_cast(context))->OnFailureResponse_3(status); } - static void OnSuccessCallback_3(void * context, uint8_t colorLoopDirection) - { - (static_cast(context))->OnSuccessResponse_3(colorLoopDirection); - } + static void OnSuccessCallback_3(void * context) { (static_cast(context))->OnSuccessResponse_3(); } static void OnFailureCallback_4(void * context, uint8_t status) { - (static_cast(context))->OnFailureResponse_4(status); + (static_cast(context))->OnFailureResponse_4(status); } - static void OnSuccessCallback_4(void * context, uint16_t colorLoopTime) - { - (static_cast(context))->OnSuccessResponse_4(colorLoopTime); - } + static void OnSuccessCallback_4(void * context) { (static_cast(context))->OnSuccessResponse_4(); } static void OnFailureCallback_5(void * context, uint8_t status) { - (static_cast(context))->OnFailureResponse_5(status); - } - - static void OnSuccessCallback_5(void * context, uint16_t colorLoopStartEnhancedHue) - { - (static_cast(context))->OnSuccessResponse_5(colorLoopStartEnhancedHue); - } - - static void OnFailureCallback_6(void * context, uint8_t status) - { - (static_cast(context))->OnFailureResponse_6(status); - } - - static void OnSuccessCallback_6(void * context, uint8_t colorLoopActive) - { - (static_cast(context))->OnSuccessResponse_6(colorLoopActive); - } - - static void OnFailureCallback_7(void * context, uint8_t status) - { - (static_cast(context))->OnFailureResponse_7(status); - } - - static void OnSuccessCallback_7(void * context) { (static_cast(context))->OnSuccessResponse_7(); } - - static void OnFailureCallback_8(void * context, uint8_t status) - { - (static_cast(context))->OnFailureResponse_8(status); - } - - static void OnSuccessCallback_8(void * context, uint8_t colorLoopActive) - { - (static_cast(context))->OnSuccessResponse_8(colorLoopActive); - } - - static void OnFailureCallback_9(void * context, uint8_t status) - { - (static_cast(context))->OnFailureResponse_9(status); - } - - static void OnSuccessCallback_9(void * context) { (static_cast(context))->OnSuccessResponse_9(); } - - static void OnFailureCallback_10(void * context, uint8_t status) - { - (static_cast(context))->OnFailureResponse_10(status); - } - - static void OnSuccessCallback_10(void * context, uint8_t colorLoopDirection) - { - (static_cast(context))->OnSuccessResponse_10(colorLoopDirection); - } - - static void OnFailureCallback_11(void * context, uint8_t status) - { - (static_cast(context))->OnFailureResponse_11(status); - } - - static void OnSuccessCallback_11(void * context, uint16_t colorLoopTime) - { - (static_cast(context))->OnSuccessResponse_11(colorLoopTime); - } - - static void OnFailureCallback_12(void * context, uint8_t status) - { - (static_cast(context))->OnFailureResponse_12(status); - } - - static void OnSuccessCallback_12(void * context) { (static_cast(context))->OnSuccessResponse_12(); } - - static void OnFailureCallback_13(void * context, uint8_t status) - { - (static_cast(context))->OnFailureResponse_13(status); + (static_cast(context))->OnFailureResponse_5(status); } - static void OnSuccessCallback_13(void * context, uint8_t colorLoopDirection) - { - (static_cast(context))->OnSuccessResponse_13(colorLoopDirection); - } - - static void OnFailureCallback_14(void * context, uint8_t status) - { - (static_cast(context))->OnFailureResponse_14(status); - } - - static void OnSuccessCallback_14(void * context) { (static_cast(context))->OnSuccessResponse_14(); } - - static void OnFailureCallback_15(void * context, uint8_t status) - { - (static_cast(context))->OnFailureResponse_15(status); - } - - static void OnSuccessCallback_15(void * context, bool onOff) + static void OnSuccessCallback_5(void * context, bool onOff) { - (static_cast(context))->OnSuccessResponse_15(onOff); + (static_cast(context))->OnSuccessResponse_5(onOff); } // @@ -10032,255 +12461,271 @@ class Test_TC_CC_8 : public TestCommand NextTest(); } - CHIP_ERROR TestColorLoopSetCommandSetAllAttributs_2() + CHIP_ERROR TestStepSaturationUpCommand_2() { chip::Controller::ColorControlClusterTest cluster; cluster.Associate(mDevice, 1); - uint8_t updateFlagsArgument = 14; - uint8_t actionArgument = 0; - uint8_t directionArgument = 1; - uint16_t timeArgument = 100U; - uint16_t startHueArgument = 500U; + uint8_t stepModeArgument = 1; + uint8_t stepSizeArgument = 15; + uint8_t transitionTimeArgument = 10; uint8_t optionsMaskArgument = 0; uint8_t optionsOverrideArgument = 0; - return cluster.ColorLoopSet(mOnSuccessCallback_2.Cancel(), mOnFailureCallback_2.Cancel(), updateFlagsArgument, - actionArgument, directionArgument, timeArgument, startHueArgument, optionsMaskArgument, - optionsOverrideArgument); + return cluster.StepSaturation(mOnSuccessCallback_2.Cancel(), mOnFailureCallback_2.Cancel(), stepModeArgument, + stepSizeArgument, transitionTimeArgument, optionsMaskArgument, optionsOverrideArgument); } void OnFailureResponse_2(uint8_t status) { ThrowFailureResponse(); } void OnSuccessResponse_2() { NextTest(); } - CHIP_ERROR TestCheckColorLoopDirectionValue_3() + CHIP_ERROR TestStepSaturationDownCommand_3() { chip::Controller::ColorControlClusterTest cluster; cluster.Associate(mDevice, 1); - return cluster.ReadAttributeColorLoopDirection(mOnSuccessCallback_3.Cancel(), mOnFailureCallback_3.Cancel()); + uint8_t stepModeArgument = 3; + uint8_t stepSizeArgument = 20; + uint8_t transitionTimeArgument = 10; + uint8_t optionsMaskArgument = 0; + uint8_t optionsOverrideArgument = 0; + + return cluster.StepSaturation(mOnSuccessCallback_3.Cancel(), mOnFailureCallback_3.Cancel(), stepModeArgument, + stepSizeArgument, transitionTimeArgument, optionsMaskArgument, optionsOverrideArgument); } void OnFailureResponse_3(uint8_t status) { ThrowFailureResponse(); } - void OnSuccessResponse_3(uint8_t colorLoopDirection) + void OnSuccessResponse_3() { NextTest(); } + + CHIP_ERROR TestTurnOffLightThatWeTurnedOn_4() { - VerifyOrReturn(CheckValue("colorLoopDirection", colorLoopDirection, 1)); - NextTest(); + chip::Controller::OnOffClusterTest cluster; + cluster.Associate(mDevice, 1); + + return cluster.Off(mOnSuccessCallback_4.Cancel(), mOnFailureCallback_4.Cancel()); } - CHIP_ERROR TestCheckColorLoopTimeValue_4() + void OnFailureResponse_4(uint8_t status) { ThrowFailureResponse(); } + + void OnSuccessResponse_4() { NextTest(); } + + CHIP_ERROR TestCheckOnOffAttributeValueIsFalseAfterOffCommand_5() { - chip::Controller::ColorControlClusterTest cluster; + chip::Controller::OnOffClusterTest cluster; cluster.Associate(mDevice, 1); - return cluster.ReadAttributeColorLoopTime(mOnSuccessCallback_4.Cancel(), mOnFailureCallback_4.Cancel()); + return cluster.ReadAttributeOnOff(mOnSuccessCallback_5.Cancel(), mOnFailureCallback_5.Cancel()); + } + + void OnFailureResponse_5(uint8_t status) { ThrowFailureResponse(); } + + void OnSuccessResponse_5(bool onOff) + { + VerifyOrReturn(CheckValue("onOff", onOff, 0)); + NextTest(); + } +}; + +class Test_TC_CC_4_4 : public TestCommand +{ +public: + Test_TC_CC_4_4() : TestCommand("Test_TC_CC_4_4"), mTestIndex(0) {} + + /////////// TestCommand Interface ///////// + void NextTest() override + { + CHIP_ERROR err = CHIP_NO_ERROR; + + if (0 == mTestIndex) + { + ChipLogProgress(chipTool, " **** Test Start: Test_TC_CC_4_4\n"); + } + + if (mTestCount == mTestIndex) + { + ChipLogProgress(chipTool, " **** Test Complete: Test_TC_CC_4_4\n"); + SetCommandExitStatus(CHIP_NO_ERROR); + return; + } + + // Ensure we increment mTestIndex before we start running the relevant + // command. That way if we lose the timeslice after we send the message + // but before our function call returns, we won't end up with an + // incorrect mTestIndex value observed when we get the response. + switch (mTestIndex++) + { + case 0: + ChipLogProgress(chipTool, " ***** Test Step 0 : Turn on light for color control tests\n"); + err = TestTurnOnLightForColorControlTests_0(); + break; + case 1: + ChipLogProgress(chipTool, " ***** Test Step 1 : Check on/off attribute value is true after on command\n"); + err = TestCheckOnOffAttributeValueIsTrueAfterOnCommand_1(); + break; + case 2: + ChipLogProgress(chipTool, " ***** Test Step 2 : Move To current hue and saturation command\n"); + err = TestMoveToCurrentHueAndSaturationCommand_2(); + break; + case 3: + ChipLogProgress(chipTool, " ***** Test Step 3 : Turn off light that we turned on\n"); + err = TestTurnOffLightThatWeTurnedOn_3(); + break; + case 4: + ChipLogProgress(chipTool, " ***** Test Step 4 : Check on/off attribute value is false after off command\n"); + err = TestCheckOnOffAttributeValueIsFalseAfterOffCommand_4(); + break; + } + + if (CHIP_NO_ERROR != err) + { + ChipLogError(chipTool, " ***** Test Failure: %s\n", chip::ErrorStr(err)); + SetCommandExitStatus(err); + } } - void OnFailureResponse_4(uint8_t status) { ThrowFailureResponse(); } +private: + std::atomic_uint16_t mTestIndex; + const uint16_t mTestCount = 5; - void OnSuccessResponse_4(uint16_t colorLoopTime) - { - VerifyOrReturn(CheckValue("colorLoopTime", colorLoopTime, 100U)); - NextTest(); - } + chip::Callback::Callback mOnFailureCallback_0{ OnFailureCallback_0, this }; + chip::Callback::Callback mOnSuccessCallback_0{ OnSuccessCallback_0, this }; + chip::Callback::Callback mOnFailureCallback_1{ OnFailureCallback_1, this }; + chip::Callback::Callback mOnSuccessCallback_1{ OnSuccessCallback_1, this }; + chip::Callback::Callback mOnFailureCallback_2{ OnFailureCallback_2, this }; + chip::Callback::Callback mOnSuccessCallback_2{ OnSuccessCallback_2, this }; + chip::Callback::Callback mOnFailureCallback_3{ OnFailureCallback_3, this }; + chip::Callback::Callback mOnSuccessCallback_3{ OnSuccessCallback_3, this }; + chip::Callback::Callback mOnFailureCallback_4{ OnFailureCallback_4, this }; + chip::Callback::Callback mOnSuccessCallback_4{ OnSuccessCallback_4, this }; - CHIP_ERROR TestCheckColorLoopStartEnhancedHueValue_5() + static void OnFailureCallback_0(void * context, uint8_t status) { - chip::Controller::ColorControlClusterTest cluster; - cluster.Associate(mDevice, 1); - - return cluster.ReadAttributeColorLoopStartEnhancedHue(mOnSuccessCallback_5.Cancel(), mOnFailureCallback_5.Cancel()); + (static_cast(context))->OnFailureResponse_0(status); } - void OnFailureResponse_5(uint8_t status) { ThrowFailureResponse(); } - - void OnSuccessResponse_5(uint16_t colorLoopStartEnhancedHue) - { - VerifyOrReturn(CheckValue("colorLoopStartEnhancedHue", colorLoopStartEnhancedHue, 500U)); - NextTest(); - } + static void OnSuccessCallback_0(void * context) { (static_cast(context))->OnSuccessResponse_0(); } - CHIP_ERROR TestCheckColorLoopActiveValue_6() + static void OnFailureCallback_1(void * context, uint8_t status) { - chip::Controller::ColorControlClusterTest cluster; - cluster.Associate(mDevice, 1); - - return cluster.ReadAttributeColorLoopActive(mOnSuccessCallback_6.Cancel(), mOnFailureCallback_6.Cancel()); + (static_cast(context))->OnFailureResponse_1(status); } - void OnFailureResponse_6(uint8_t status) { ThrowFailureResponse(); } - - void OnSuccessResponse_6(uint8_t colorLoopActive) + static void OnSuccessCallback_1(void * context, bool onOff) { - VerifyOrReturn(CheckValue("colorLoopActive", colorLoopActive, 0)); - NextTest(); + (static_cast(context))->OnSuccessResponse_1(onOff); } - CHIP_ERROR TestColorLoopSetCommandStartColorLoop_7() + static void OnFailureCallback_2(void * context, uint8_t status) { - chip::Controller::ColorControlClusterTest cluster; - cluster.Associate(mDevice, 1); - - uint8_t updateFlagsArgument = 1; - uint8_t actionArgument = 1; - uint8_t directionArgument = 0; - uint16_t timeArgument = 0U; - uint16_t startHueArgument = 0U; - uint8_t optionsMaskArgument = 0; - uint8_t optionsOverrideArgument = 0; - - return cluster.ColorLoopSet(mOnSuccessCallback_7.Cancel(), mOnFailureCallback_7.Cancel(), updateFlagsArgument, - actionArgument, directionArgument, timeArgument, startHueArgument, optionsMaskArgument, - optionsOverrideArgument); + (static_cast(context))->OnFailureResponse_2(status); } - void OnFailureResponse_7(uint8_t status) { ThrowFailureResponse(); } - - void OnSuccessResponse_7() { NextTest(); } + static void OnSuccessCallback_2(void * context) { (static_cast(context))->OnSuccessResponse_2(); } - CHIP_ERROR TestCheckColorLoopActiveValue_8() + static void OnFailureCallback_3(void * context, uint8_t status) { - chip::Controller::ColorControlClusterTest cluster; - cluster.Associate(mDevice, 1); - - return cluster.ReadAttributeColorLoopActive(mOnSuccessCallback_8.Cancel(), mOnFailureCallback_8.Cancel()); + (static_cast(context))->OnFailureResponse_3(status); } - void OnFailureResponse_8(uint8_t status) { ThrowFailureResponse(); } + static void OnSuccessCallback_3(void * context) { (static_cast(context))->OnSuccessResponse_3(); } - void OnSuccessResponse_8(uint8_t colorLoopActive) + static void OnFailureCallback_4(void * context, uint8_t status) { - VerifyOrReturn(CheckValue("colorLoopActive", colorLoopActive, 1)); - NextTest(); + (static_cast(context))->OnFailureResponse_4(status); } - CHIP_ERROR TestColorLoopSetCommandSetDirectionAndTimeWhileRunning_9() + static void OnSuccessCallback_4(void * context, bool onOff) { - chip::Controller::ColorControlClusterTest cluster; - cluster.Associate(mDevice, 1); - - uint8_t updateFlagsArgument = 6; - uint8_t actionArgument = 0; - uint8_t directionArgument = 0; - uint16_t timeArgument = 3500U; - uint16_t startHueArgument = 0U; - uint8_t optionsMaskArgument = 0; - uint8_t optionsOverrideArgument = 0; - - return cluster.ColorLoopSet(mOnSuccessCallback_9.Cancel(), mOnFailureCallback_9.Cancel(), updateFlagsArgument, - actionArgument, directionArgument, timeArgument, startHueArgument, optionsMaskArgument, - optionsOverrideArgument); + (static_cast(context))->OnSuccessResponse_4(onOff); } - void OnFailureResponse_9(uint8_t status) { ThrowFailureResponse(); } - - void OnSuccessResponse_9() { NextTest(); } + // + // Tests methods + // - CHIP_ERROR TestCheckColorLoopDirectionValue_10() + CHIP_ERROR TestTurnOnLightForColorControlTests_0() { - chip::Controller::ColorControlClusterTest cluster; + chip::Controller::OnOffClusterTest cluster; cluster.Associate(mDevice, 1); - return cluster.ReadAttributeColorLoopDirection(mOnSuccessCallback_10.Cancel(), mOnFailureCallback_10.Cancel()); + return cluster.On(mOnSuccessCallback_0.Cancel(), mOnFailureCallback_0.Cancel()); } - void OnFailureResponse_10(uint8_t status) { ThrowFailureResponse(); } + void OnFailureResponse_0(uint8_t status) { ThrowFailureResponse(); } - void OnSuccessResponse_10(uint8_t colorLoopDirection) - { - VerifyOrReturn(CheckValue("colorLoopDirection", colorLoopDirection, 0)); - NextTest(); - } + void OnSuccessResponse_0() { NextTest(); } - CHIP_ERROR TestCheckColorLoopTimeValue_11() + CHIP_ERROR TestCheckOnOffAttributeValueIsTrueAfterOnCommand_1() { - chip::Controller::ColorControlClusterTest cluster; + chip::Controller::OnOffClusterTest cluster; cluster.Associate(mDevice, 1); - return cluster.ReadAttributeColorLoopTime(mOnSuccessCallback_11.Cancel(), mOnFailureCallback_11.Cancel()); + return cluster.ReadAttributeOnOff(mOnSuccessCallback_1.Cancel(), mOnFailureCallback_1.Cancel()); } - void OnFailureResponse_11(uint8_t status) { ThrowFailureResponse(); } + void OnFailureResponse_1(uint8_t status) { ThrowFailureResponse(); } - void OnSuccessResponse_11(uint16_t colorLoopTime) + void OnSuccessResponse_1(bool onOff) { - VerifyOrReturn(CheckValue("colorLoopTime", colorLoopTime, 3500U)); + VerifyOrReturn(CheckValue("onOff", onOff, 1)); NextTest(); } - CHIP_ERROR TestColorLoopSetCommandSetDirectionWhileRunning_12() + CHIP_ERROR TestMoveToCurrentHueAndSaturationCommand_2() { chip::Controller::ColorControlClusterTest cluster; cluster.Associate(mDevice, 1); - uint8_t updateFlagsArgument = 2; - uint8_t actionArgument = 0; - uint8_t directionArgument = 1; - uint16_t timeArgument = 0U; - uint16_t startHueArgument = 0U; + uint8_t hueArgument = 40; + uint8_t saturationArgument = 160; + uint16_t transitionTimeArgument = 10U; uint8_t optionsMaskArgument = 0; uint8_t optionsOverrideArgument = 0; - return cluster.ColorLoopSet(mOnSuccessCallback_12.Cancel(), mOnFailureCallback_12.Cancel(), updateFlagsArgument, - actionArgument, directionArgument, timeArgument, startHueArgument, optionsMaskArgument, - optionsOverrideArgument); - } - - void OnFailureResponse_12(uint8_t status) { ThrowFailureResponse(); } - - void OnSuccessResponse_12() { NextTest(); } - - CHIP_ERROR TestCheckColorLoopDirectionValue_13() - { - chip::Controller::ColorControlClusterTest cluster; - cluster.Associate(mDevice, 1); - - return cluster.ReadAttributeColorLoopDirection(mOnSuccessCallback_13.Cancel(), mOnFailureCallback_13.Cancel()); + return cluster.MoveToHueAndSaturation(mOnSuccessCallback_2.Cancel(), mOnFailureCallback_2.Cancel(), hueArgument, + saturationArgument, transitionTimeArgument, optionsMaskArgument, + optionsOverrideArgument); } - void OnFailureResponse_13(uint8_t status) { ThrowFailureResponse(); } + void OnFailureResponse_2(uint8_t status) { ThrowFailureResponse(); } - void OnSuccessResponse_13(uint8_t colorLoopDirection) - { - VerifyOrReturn(CheckValue("colorLoopDirection", colorLoopDirection, 1)); - NextTest(); - } + void OnSuccessResponse_2() { NextTest(); } - CHIP_ERROR TestTurnOffLightThatWeTurnedOn_14() + CHIP_ERROR TestTurnOffLightThatWeTurnedOn_3() { chip::Controller::OnOffClusterTest cluster; cluster.Associate(mDevice, 1); - return cluster.Off(mOnSuccessCallback_14.Cancel(), mOnFailureCallback_14.Cancel()); + return cluster.Off(mOnSuccessCallback_3.Cancel(), mOnFailureCallback_3.Cancel()); } - void OnFailureResponse_14(uint8_t status) { ThrowFailureResponse(); } + void OnFailureResponse_3(uint8_t status) { ThrowFailureResponse(); } - void OnSuccessResponse_14() { NextTest(); } + void OnSuccessResponse_3() { NextTest(); } - CHIP_ERROR TestCheckOnOffAttributeValueIsFalseAfterOffCommand_15() + CHIP_ERROR TestCheckOnOffAttributeValueIsFalseAfterOffCommand_4() { chip::Controller::OnOffClusterTest cluster; cluster.Associate(mDevice, 1); - return cluster.ReadAttributeOnOff(mOnSuccessCallback_15.Cancel(), mOnFailureCallback_15.Cancel()); + return cluster.ReadAttributeOnOff(mOnSuccessCallback_4.Cancel(), mOnFailureCallback_4.Cancel()); } - void OnFailureResponse_15(uint8_t status) { ThrowFailureResponse(); } + void OnFailureResponse_4(uint8_t status) { ThrowFailureResponse(); } - void OnSuccessResponse_15(bool onOff) + void OnSuccessResponse_4(bool onOff) { VerifyOrReturn(CheckValue("onOff", onOff, 0)); NextTest(); } }; -class Test_TC_WNCV_1_1 : public TestCommand +class Test_TC_CC_5_1 : public TestCommand { public: - Test_TC_WNCV_1_1() : TestCommand("Test_TC_WNCV_1_1"), mTestIndex(0) {} + Test_TC_CC_5_1() : TestCommand("Test_TC_CC_5_1"), mTestIndex(0) {} /////////// TestCommand Interface ///////// void NextTest() override @@ -10289,12 +12734,12 @@ class Test_TC_WNCV_1_1 : public TestCommand if (0 == mTestIndex) { - ChipLogProgress(chipTool, " **** Test Start: Test_TC_WNCV_1_1\n"); + ChipLogProgress(chipTool, " **** Test Start: Test_TC_CC_5_1\n"); } if (mTestCount == mTestIndex) { - ChipLogProgress(chipTool, " **** Test Complete: Test_TC_WNCV_1_1\n"); + ChipLogProgress(chipTool, " **** Test Complete: Test_TC_CC_5_1\n"); SetCommandExitStatus(CHIP_NO_ERROR); return; } @@ -10306,17 +12751,24 @@ class Test_TC_WNCV_1_1 : public TestCommand switch (mTestIndex++) { case 0: - ChipLogProgress(chipTool, " ***** Test Step 0 : read the global attribute: ClusterRevision\n"); - err = TestReadTheGlobalAttributeClusterRevision_0(); + ChipLogProgress(chipTool, " ***** Test Step 0 : Turn on light for color control tests\n"); + err = TestTurnOnLightForColorControlTests_0(); break; case 1: - ChipLogProgress(chipTool, - " ***** Test Step 1 : write the default value to mandatory global attribute: ClusterRevision\n"); - err = TestWriteTheDefaultValueToMandatoryGlobalAttributeClusterRevision_1(); + ChipLogProgress(chipTool, " ***** Test Step 1 : Check on/off attribute value is true after on command\n"); + err = TestCheckOnOffAttributeValueIsTrueAfterOnCommand_1(); break; case 2: - ChipLogProgress(chipTool, " ***** Test Step 2 : reads back global attribute: ClusterRevision\n"); - err = TestReadsBackGlobalAttributeClusterRevision_2(); + ChipLogProgress(chipTool, " ***** Test Step 2 : Move to Color command\n"); + err = TestMoveToColorCommand_2(); + break; + case 3: + ChipLogProgress(chipTool, " ***** Test Step 3 : Turn off light that we turned on\n"); + err = TestTurnOffLightThatWeTurnedOn_3(); + break; + case 4: + ChipLogProgress(chipTool, " ***** Test Step 4 : Check on/off attribute value is false after off command\n"); + err = TestCheckOnOffAttributeValueIsFalseAfterOffCommand_4(); break; } @@ -10329,101 +12781,144 @@ class Test_TC_WNCV_1_1 : public TestCommand private: std::atomic_uint16_t mTestIndex; - const uint16_t mTestCount = 3; + const uint16_t mTestCount = 5; chip::Callback::Callback mOnFailureCallback_0{ OnFailureCallback_0, this }; - chip::Callback::Callback mOnSuccessCallback_0{ OnSuccessCallback_0, this }; + chip::Callback::Callback mOnSuccessCallback_0{ OnSuccessCallback_0, this }; chip::Callback::Callback mOnFailureCallback_1{ OnFailureCallback_1, this }; - chip::Callback::Callback mOnSuccessCallback_1{ OnSuccessCallback_1, this }; + chip::Callback::Callback mOnSuccessCallback_1{ OnSuccessCallback_1, this }; chip::Callback::Callback mOnFailureCallback_2{ OnFailureCallback_2, this }; - chip::Callback::Callback mOnSuccessCallback_2{ OnSuccessCallback_2, this }; + chip::Callback::Callback mOnSuccessCallback_2{ OnSuccessCallback_2, this }; + chip::Callback::Callback mOnFailureCallback_3{ OnFailureCallback_3, this }; + chip::Callback::Callback mOnSuccessCallback_3{ OnSuccessCallback_3, this }; + chip::Callback::Callback mOnFailureCallback_4{ OnFailureCallback_4, this }; + chip::Callback::Callback mOnSuccessCallback_4{ OnSuccessCallback_4, this }; static void OnFailureCallback_0(void * context, uint8_t status) { - (static_cast(context))->OnFailureResponse_0(status); + (static_cast(context))->OnFailureResponse_0(status); } - static void OnSuccessCallback_0(void * context, uint16_t clusterRevision) - { - (static_cast(context))->OnSuccessResponse_0(clusterRevision); - } + static void OnSuccessCallback_0(void * context) { (static_cast(context))->OnSuccessResponse_0(); } static void OnFailureCallback_1(void * context, uint8_t status) { - (static_cast(context))->OnFailureResponse_1(status); + (static_cast(context))->OnFailureResponse_1(status); } - static void OnSuccessCallback_1(void * context, uint16_t clusterRevision) + static void OnSuccessCallback_1(void * context, bool onOff) { - (static_cast(context))->OnSuccessResponse_1(clusterRevision); + (static_cast(context))->OnSuccessResponse_1(onOff); } static void OnFailureCallback_2(void * context, uint8_t status) { - (static_cast(context))->OnFailureResponse_2(status); + (static_cast(context))->OnFailureResponse_2(status); } - static void OnSuccessCallback_2(void * context, uint16_t clusterRevision) + static void OnSuccessCallback_2(void * context) { (static_cast(context))->OnSuccessResponse_2(); } + + static void OnFailureCallback_3(void * context, uint8_t status) { - (static_cast(context))->OnSuccessResponse_2(clusterRevision); + (static_cast(context))->OnFailureResponse_3(status); + } + + static void OnSuccessCallback_3(void * context) { (static_cast(context))->OnSuccessResponse_3(); } + + static void OnFailureCallback_4(void * context, uint8_t status) + { + (static_cast(context))->OnFailureResponse_4(status); + } + + static void OnSuccessCallback_4(void * context, bool onOff) + { + (static_cast(context))->OnSuccessResponse_4(onOff); } // // Tests methods // - CHIP_ERROR TestReadTheGlobalAttributeClusterRevision_0() + CHIP_ERROR TestTurnOnLightForColorControlTests_0() { - chip::Controller::WindowCoveringClusterTest cluster; + chip::Controller::OnOffClusterTest cluster; + cluster.Associate(mDevice, 1); + + return cluster.On(mOnSuccessCallback_0.Cancel(), mOnFailureCallback_0.Cancel()); + } + + void OnFailureResponse_0(uint8_t status) { ThrowFailureResponse(); } + + void OnSuccessResponse_0() { NextTest(); } + + CHIP_ERROR TestCheckOnOffAttributeValueIsTrueAfterOnCommand_1() + { + chip::Controller::OnOffClusterTest cluster; + cluster.Associate(mDevice, 1); + + return cluster.ReadAttributeOnOff(mOnSuccessCallback_1.Cancel(), mOnFailureCallback_1.Cancel()); + } + + void OnFailureResponse_1(uint8_t status) { ThrowFailureResponse(); } + + void OnSuccessResponse_1(bool onOff) + { + VerifyOrReturn(CheckValue("onOff", onOff, 1)); + NextTest(); + } + + CHIP_ERROR TestMoveToColorCommand_2() + { + chip::Controller::ColorControlClusterTest cluster; cluster.Associate(mDevice, 1); - return cluster.ReadAttributeClusterRevision(mOnSuccessCallback_0.Cancel(), mOnFailureCallback_0.Cancel()); + uint16_t colorXArgument = 200U; + uint16_t colorYArgument = 300U; + uint16_t transitionTimeArgument = 20U; + uint8_t optionsMaskArgument = 0; + uint8_t optionsOverrideArgument = 0; + + return cluster.MoveToColor(mOnSuccessCallback_2.Cancel(), mOnFailureCallback_2.Cancel(), colorXArgument, colorYArgument, + transitionTimeArgument, optionsMaskArgument, optionsOverrideArgument); } - void OnFailureResponse_0(uint8_t status) { ThrowFailureResponse(); } + void OnFailureResponse_2(uint8_t status) { ThrowFailureResponse(); } - void OnSuccessResponse_0(uint16_t clusterRevision) - { - VerifyOrReturn(CheckValue("clusterRevision", clusterRevision, 5U)); - NextTest(); - } + void OnSuccessResponse_2() { NextTest(); } - CHIP_ERROR TestWriteTheDefaultValueToMandatoryGlobalAttributeClusterRevision_1() + CHIP_ERROR TestTurnOffLightThatWeTurnedOn_3() { - chip::Controller::WindowCoveringClusterTest cluster; + chip::Controller::OnOffClusterTest cluster; cluster.Associate(mDevice, 1); - uint16_t clusterRevisionArgument = 5U; - - return cluster.WriteAttributeClusterRevision(mOnSuccessCallback_1.Cancel(), mOnFailureCallback_1.Cancel(), - clusterRevisionArgument); + return cluster.Off(mOnSuccessCallback_3.Cancel(), mOnFailureCallback_3.Cancel()); } - void OnFailureResponse_1(uint8_t status) { NextTest(); } + void OnFailureResponse_3(uint8_t status) { ThrowFailureResponse(); } - void OnSuccessResponse_1(uint16_t clusterRevision) { ThrowSuccessResponse(); } + void OnSuccessResponse_3() { NextTest(); } - CHIP_ERROR TestReadsBackGlobalAttributeClusterRevision_2() + CHIP_ERROR TestCheckOnOffAttributeValueIsFalseAfterOffCommand_4() { - chip::Controller::WindowCoveringClusterTest cluster; + chip::Controller::OnOffClusterTest cluster; cluster.Associate(mDevice, 1); - return cluster.ReadAttributeClusterRevision(mOnSuccessCallback_2.Cancel(), mOnFailureCallback_2.Cancel()); + return cluster.ReadAttributeOnOff(mOnSuccessCallback_4.Cancel(), mOnFailureCallback_4.Cancel()); } - void OnFailureResponse_2(uint8_t status) { ThrowFailureResponse(); } + void OnFailureResponse_4(uint8_t status) { ThrowFailureResponse(); } - void OnSuccessResponse_2(uint16_t clusterRevision) + void OnSuccessResponse_4(bool onOff) { - VerifyOrReturn(CheckValue("clusterRevision", clusterRevision, 5U)); + VerifyOrReturn(CheckValue("onOff", onOff, 0)); NextTest(); } }; -class Test_TC_WNCV_2_1 : public TestCommand +class Test_TC_CC_5_2 : public TestCommand { public: - Test_TC_WNCV_2_1() : TestCommand("Test_TC_WNCV_2_1"), mTestIndex(0) {} + Test_TC_CC_5_2() : TestCommand("Test_TC_CC_5_2"), mTestIndex(0) {} /////////// TestCommand Interface ///////// void NextTest() override @@ -10432,12 +12927,12 @@ class Test_TC_WNCV_2_1 : public TestCommand if (0 == mTestIndex) { - ChipLogProgress(chipTool, " **** Test Start: Test_TC_WNCV_2_1\n"); + ChipLogProgress(chipTool, " **** Test Start: Test_TC_CC_5_2\n"); } if (mTestCount == mTestIndex) { - ChipLogProgress(chipTool, " **** Test Complete: Test_TC_WNCV_2_1\n"); + ChipLogProgress(chipTool, " **** Test Complete: Test_TC_CC_5_2\n"); SetCommandExitStatus(CHIP_NO_ERROR); return; } @@ -10449,48 +12944,28 @@ class Test_TC_WNCV_2_1 : public TestCommand switch (mTestIndex++) { case 0: - ChipLogProgress(chipTool, " ***** Test Step 0 : read the RO mandatory attribute default: Type\n"); - err = TestReadTheRoMandatoryAttributeDefaultType_0(); + ChipLogProgress(chipTool, " ***** Test Step 0 : Turn on light for color control tests\n"); + err = TestTurnOnLightForColorControlTests_0(); break; case 1: - ChipLogProgress(chipTool, " ***** Test Step 1 : reads back the RO mandatory attribute: Type\n"); - err = TestReadsBackTheRoMandatoryAttributeType_1(); + ChipLogProgress(chipTool, " ***** Test Step 1 : Check on/off attribute value is true after on command\n"); + err = TestCheckOnOffAttributeValueIsTrueAfterOnCommand_1(); break; case 2: - ChipLogProgress(chipTool, " ***** Test Step 2 : read the RO mandatory attribute default: ConfigStatus\n"); - err = TestReadTheRoMandatoryAttributeDefaultConfigStatus_2(); + ChipLogProgress(chipTool, " ***** Test Step 2 : Move Color command\n"); + err = TestMoveColorCommand_2(); break; case 3: - ChipLogProgress(chipTool, " ***** Test Step 3 : reads back the RO mandatory attribute: ConfigStatus\n"); - err = TestReadsBackTheRoMandatoryAttributeConfigStatus_3(); + ChipLogProgress(chipTool, " ***** Test Step 3 : Stop Move Step command\n"); + err = TestStopMoveStepCommand_3(); break; case 4: - ChipLogProgress(chipTool, " ***** Test Step 4 : read the RO mandatory attribute default: OperationalStatus\n"); - err = TestReadTheRoMandatoryAttributeDefaultOperationalStatus_4(); + ChipLogProgress(chipTool, " ***** Test Step 4 : Turn off light that we turned on\n"); + err = TestTurnOffLightThatWeTurnedOn_4(); break; case 5: - ChipLogProgress(chipTool, " ***** Test Step 5 : reads back the RO mandatory attribute: OperationalStatus\n"); - err = TestReadsBackTheRoMandatoryAttributeOperationalStatus_5(); - break; - case 6: - ChipLogProgress(chipTool, " ***** Test Step 6 : read the RO mandatory attribute default: EndProductType\n"); - err = TestReadTheRoMandatoryAttributeDefaultEndProductType_6(); - break; - case 7: - ChipLogProgress(chipTool, " ***** Test Step 7 : reads back the RO mandatory attribute: EndProductType\n"); - err = TestReadsBackTheRoMandatoryAttributeEndProductType_7(); - break; - case 8: - ChipLogProgress(chipTool, " ***** Test Step 8 : read the RW mandatory attribute default: Mode\n"); - err = TestReadTheRwMandatoryAttributeDefaultMode_8(); - break; - case 9: - ChipLogProgress(chipTool, " ***** Test Step 9 : write a value into the RW mandatory attribute:: Mode\n"); - err = TestWriteAValueIntoTheRwMandatoryAttributeMode_9(); - break; - case 10: - ChipLogProgress(chipTool, " ***** Test Step 10 : reads back the RW mandatory attribute: Mode\n"); - err = TestReadsBackTheRwMandatoryAttributeMode_10(); + ChipLogProgress(chipTool, " ***** Test Step 5 : Check on/off attribute value is false after off command\n"); + err = TestCheckOnOffAttributeValueIsFalseAfterOffCommand_5(); break; } @@ -10503,324 +12978,361 @@ class Test_TC_WNCV_2_1 : public TestCommand private: std::atomic_uint16_t mTestIndex; - const uint16_t mTestCount = 11; + const uint16_t mTestCount = 6; chip::Callback::Callback mOnFailureCallback_0{ OnFailureCallback_0, this }; - chip::Callback::Callback mOnSuccessCallback_0{ OnSuccessCallback_0, this }; + chip::Callback::Callback mOnSuccessCallback_0{ OnSuccessCallback_0, this }; chip::Callback::Callback mOnFailureCallback_1{ OnFailureCallback_1, this }; - chip::Callback::Callback mOnSuccessCallback_1{ OnSuccessCallback_1, this }; + chip::Callback::Callback mOnSuccessCallback_1{ OnSuccessCallback_1, this }; chip::Callback::Callback mOnFailureCallback_2{ OnFailureCallback_2, this }; - chip::Callback::Callback mOnSuccessCallback_2{ OnSuccessCallback_2, this }; + chip::Callback::Callback mOnSuccessCallback_2{ OnSuccessCallback_2, this }; chip::Callback::Callback mOnFailureCallback_3{ OnFailureCallback_3, this }; - chip::Callback::Callback mOnSuccessCallback_3{ OnSuccessCallback_3, this }; + chip::Callback::Callback mOnSuccessCallback_3{ OnSuccessCallback_3, this }; chip::Callback::Callback mOnFailureCallback_4{ OnFailureCallback_4, this }; - chip::Callback::Callback mOnSuccessCallback_4{ OnSuccessCallback_4, this }; + chip::Callback::Callback mOnSuccessCallback_4{ OnSuccessCallback_4, this }; chip::Callback::Callback mOnFailureCallback_5{ OnFailureCallback_5, this }; - chip::Callback::Callback mOnSuccessCallback_5{ OnSuccessCallback_5, this }; - chip::Callback::Callback mOnFailureCallback_6{ OnFailureCallback_6, this }; - chip::Callback::Callback mOnSuccessCallback_6{ OnSuccessCallback_6, this }; - chip::Callback::Callback mOnFailureCallback_7{ OnFailureCallback_7, this }; - chip::Callback::Callback mOnSuccessCallback_7{ OnSuccessCallback_7, this }; - chip::Callback::Callback mOnFailureCallback_8{ OnFailureCallback_8, this }; - chip::Callback::Callback mOnSuccessCallback_8{ OnSuccessCallback_8, this }; - chip::Callback::Callback mOnFailureCallback_9{ OnFailureCallback_9, this }; - chip::Callback::Callback mOnSuccessCallback_9{ OnSuccessCallback_9, this }; - chip::Callback::Callback mOnFailureCallback_10{ OnFailureCallback_10, this }; - chip::Callback::Callback mOnSuccessCallback_10{ OnSuccessCallback_10, this }; + chip::Callback::Callback mOnSuccessCallback_5{ OnSuccessCallback_5, this }; static void OnFailureCallback_0(void * context, uint8_t status) { - (static_cast(context))->OnFailureResponse_0(status); + (static_cast(context))->OnFailureResponse_0(status); } - static void OnSuccessCallback_0(void * context, uint8_t type) - { - (static_cast(context))->OnSuccessResponse_0(type); - } + static void OnSuccessCallback_0(void * context) { (static_cast(context))->OnSuccessResponse_0(); } static void OnFailureCallback_1(void * context, uint8_t status) { - (static_cast(context))->OnFailureResponse_1(status); + (static_cast(context))->OnFailureResponse_1(status); } - static void OnSuccessCallback_1(void * context, uint8_t type) + static void OnSuccessCallback_1(void * context, bool onOff) { - (static_cast(context))->OnSuccessResponse_1(type); + (static_cast(context))->OnSuccessResponse_1(onOff); } static void OnFailureCallback_2(void * context, uint8_t status) { - (static_cast(context))->OnFailureResponse_2(status); + (static_cast(context))->OnFailureResponse_2(status); } - static void OnSuccessCallback_2(void * context, uint8_t configStatus) - { - (static_cast(context))->OnSuccessResponse_2(configStatus); - } + static void OnSuccessCallback_2(void * context) { (static_cast(context))->OnSuccessResponse_2(); } static void OnFailureCallback_3(void * context, uint8_t status) { - (static_cast(context))->OnFailureResponse_3(status); + (static_cast(context))->OnFailureResponse_3(status); } - static void OnSuccessCallback_3(void * context, uint8_t configStatus) - { - (static_cast(context))->OnSuccessResponse_3(configStatus); - } + static void OnSuccessCallback_3(void * context) { (static_cast(context))->OnSuccessResponse_3(); } static void OnFailureCallback_4(void * context, uint8_t status) { - (static_cast(context))->OnFailureResponse_4(status); + (static_cast(context))->OnFailureResponse_4(status); } - static void OnSuccessCallback_4(void * context, uint8_t operationalStatus) - { - (static_cast(context))->OnSuccessResponse_4(operationalStatus); - } + static void OnSuccessCallback_4(void * context) { (static_cast(context))->OnSuccessResponse_4(); } static void OnFailureCallback_5(void * context, uint8_t status) { - (static_cast(context))->OnFailureResponse_5(status); + (static_cast(context))->OnFailureResponse_5(status); } - static void OnSuccessCallback_5(void * context, uint8_t operationalStatus) + static void OnSuccessCallback_5(void * context, bool onOff) { - (static_cast(context))->OnSuccessResponse_5(operationalStatus); + (static_cast(context))->OnSuccessResponse_5(onOff); } - static void OnFailureCallback_6(void * context, uint8_t status) - { - (static_cast(context))->OnFailureResponse_6(status); - } + // + // Tests methods + // - static void OnSuccessCallback_6(void * context, uint8_t endProductType) + CHIP_ERROR TestTurnOnLightForColorControlTests_0() { - (static_cast(context))->OnSuccessResponse_6(endProductType); - } + chip::Controller::OnOffClusterTest cluster; + cluster.Associate(mDevice, 1); - static void OnFailureCallback_7(void * context, uint8_t status) - { - (static_cast(context))->OnFailureResponse_7(status); + return cluster.On(mOnSuccessCallback_0.Cancel(), mOnFailureCallback_0.Cancel()); } - static void OnSuccessCallback_7(void * context, uint8_t endProductType) + void OnFailureResponse_0(uint8_t status) { ThrowFailureResponse(); } + + void OnSuccessResponse_0() { NextTest(); } + + CHIP_ERROR TestCheckOnOffAttributeValueIsTrueAfterOnCommand_1() { - (static_cast(context))->OnSuccessResponse_7(endProductType); + chip::Controller::OnOffClusterTest cluster; + cluster.Associate(mDevice, 1); + + return cluster.ReadAttributeOnOff(mOnSuccessCallback_1.Cancel(), mOnFailureCallback_1.Cancel()); } - static void OnFailureCallback_8(void * context, uint8_t status) + void OnFailureResponse_1(uint8_t status) { ThrowFailureResponse(); } + + void OnSuccessResponse_1(bool onOff) { - (static_cast(context))->OnFailureResponse_8(status); + VerifyOrReturn(CheckValue("onOff", onOff, 1)); + NextTest(); } - static void OnSuccessCallback_8(void * context, uint8_t mode) + CHIP_ERROR TestMoveColorCommand_2() { - (static_cast(context))->OnSuccessResponse_8(mode); + chip::Controller::ColorControlClusterTest cluster; + cluster.Associate(mDevice, 1); + + int16_t rateXArgument = 15; + int16_t rateYArgument = 20; + uint8_t optionsMaskArgument = 0; + uint8_t optionsOverrideArgument = 0; + + return cluster.MoveColor(mOnSuccessCallback_2.Cancel(), mOnFailureCallback_2.Cancel(), rateXArgument, rateYArgument, + optionsMaskArgument, optionsOverrideArgument); } - static void OnFailureCallback_9(void * context, uint8_t status) + void OnFailureResponse_2(uint8_t status) { ThrowFailureResponse(); } + + void OnSuccessResponse_2() { NextTest(); } + + CHIP_ERROR TestStopMoveStepCommand_3() { - (static_cast(context))->OnFailureResponse_9(status); + chip::Controller::ColorControlClusterTest cluster; + cluster.Associate(mDevice, 1); + + uint8_t optionsMaskArgument = 0; + uint8_t optionsOverrideArgument = 0; + + return cluster.StopMoveStep(mOnSuccessCallback_3.Cancel(), mOnFailureCallback_3.Cancel(), optionsMaskArgument, + optionsOverrideArgument); } - static void OnSuccessCallback_9(void * context, uint8_t mode) + void OnFailureResponse_3(uint8_t status) { ThrowFailureResponse(); } + + void OnSuccessResponse_3() { NextTest(); } + + CHIP_ERROR TestTurnOffLightThatWeTurnedOn_4() { - (static_cast(context))->OnSuccessResponse_9(mode); + chip::Controller::OnOffClusterTest cluster; + cluster.Associate(mDevice, 1); + + return cluster.Off(mOnSuccessCallback_4.Cancel(), mOnFailureCallback_4.Cancel()); } - static void OnFailureCallback_10(void * context, uint8_t status) + void OnFailureResponse_4(uint8_t status) { ThrowFailureResponse(); } + + void OnSuccessResponse_4() { NextTest(); } + + CHIP_ERROR TestCheckOnOffAttributeValueIsFalseAfterOffCommand_5() { - (static_cast(context))->OnFailureResponse_10(status); + chip::Controller::OnOffClusterTest cluster; + cluster.Associate(mDevice, 1); + + return cluster.ReadAttributeOnOff(mOnSuccessCallback_5.Cancel(), mOnFailureCallback_5.Cancel()); } - static void OnSuccessCallback_10(void * context, uint8_t mode) + void OnFailureResponse_5(uint8_t status) { ThrowFailureResponse(); } + + void OnSuccessResponse_5(bool onOff) { - (static_cast(context))->OnSuccessResponse_10(mode); + VerifyOrReturn(CheckValue("onOff", onOff, 0)); + NextTest(); } +}; - // - // Tests methods - // +class Test_TC_CC_5_3 : public TestCommand +{ +public: + Test_TC_CC_5_3() : TestCommand("Test_TC_CC_5_3"), mTestIndex(0) {} - CHIP_ERROR TestReadTheRoMandatoryAttributeDefaultType_0() + /////////// TestCommand Interface ///////// + void NextTest() override { - chip::Controller::WindowCoveringClusterTest cluster; - cluster.Associate(mDevice, 1); + CHIP_ERROR err = CHIP_NO_ERROR; + + if (0 == mTestIndex) + { + ChipLogProgress(chipTool, " **** Test Start: Test_TC_CC_5_3\n"); + } + + if (mTestCount == mTestIndex) + { + ChipLogProgress(chipTool, " **** Test Complete: Test_TC_CC_5_3\n"); + SetCommandExitStatus(CHIP_NO_ERROR); + return; + } + + // Ensure we increment mTestIndex before we start running the relevant + // command. That way if we lose the timeslice after we send the message + // but before our function call returns, we won't end up with an + // incorrect mTestIndex value observed when we get the response. + switch (mTestIndex++) + { + case 0: + ChipLogProgress(chipTool, " ***** Test Step 0 : Turn on light for color control tests\n"); + err = TestTurnOnLightForColorControlTests_0(); + break; + case 1: + ChipLogProgress(chipTool, " ***** Test Step 1 : Check on/off attribute value is true after on command\n"); + err = TestCheckOnOffAttributeValueIsTrueAfterOnCommand_1(); + break; + case 2: + ChipLogProgress(chipTool, " ***** Test Step 2 : Step Color command\n"); + err = TestStepColorCommand_2(); + break; + case 3: + ChipLogProgress(chipTool, " ***** Test Step 3 : Turn off light that we turned on\n"); + err = TestTurnOffLightThatWeTurnedOn_3(); + break; + case 4: + ChipLogProgress(chipTool, " ***** Test Step 4 : Check on/off attribute value is false after off command\n"); + err = TestCheckOnOffAttributeValueIsFalseAfterOffCommand_4(); + break; + } - return cluster.ReadAttributeType(mOnSuccessCallback_0.Cancel(), mOnFailureCallback_0.Cancel()); + if (CHIP_NO_ERROR != err) + { + ChipLogError(chipTool, " ***** Test Failure: %s\n", chip::ErrorStr(err)); + SetCommandExitStatus(err); + } } - void OnFailureResponse_0(uint8_t status) { ThrowFailureResponse(); } +private: + std::atomic_uint16_t mTestIndex; + const uint16_t mTestCount = 5; - void OnSuccessResponse_0(uint8_t type) - { - VerifyOrReturn(CheckValue("type", type, 0)); - NextTest(); - } + chip::Callback::Callback mOnFailureCallback_0{ OnFailureCallback_0, this }; + chip::Callback::Callback mOnSuccessCallback_0{ OnSuccessCallback_0, this }; + chip::Callback::Callback mOnFailureCallback_1{ OnFailureCallback_1, this }; + chip::Callback::Callback mOnSuccessCallback_1{ OnSuccessCallback_1, this }; + chip::Callback::Callback mOnFailureCallback_2{ OnFailureCallback_2, this }; + chip::Callback::Callback mOnSuccessCallback_2{ OnSuccessCallback_2, this }; + chip::Callback::Callback mOnFailureCallback_3{ OnFailureCallback_3, this }; + chip::Callback::Callback mOnSuccessCallback_3{ OnSuccessCallback_3, this }; + chip::Callback::Callback mOnFailureCallback_4{ OnFailureCallback_4, this }; + chip::Callback::Callback mOnSuccessCallback_4{ OnSuccessCallback_4, this }; - CHIP_ERROR TestReadsBackTheRoMandatoryAttributeType_1() + static void OnFailureCallback_0(void * context, uint8_t status) { - chip::Controller::WindowCoveringClusterTest cluster; - cluster.Associate(mDevice, 1); - - return cluster.ReadAttributeType(mOnSuccessCallback_1.Cancel(), mOnFailureCallback_1.Cancel()); + (static_cast(context))->OnFailureResponse_0(status); } - void OnFailureResponse_1(uint8_t status) { ThrowFailureResponse(); } - - void OnSuccessResponse_1(uint8_t type) - { - VerifyOrReturn(CheckValue("type", type, 0)); - NextTest(); - } + static void OnSuccessCallback_0(void * context) { (static_cast(context))->OnSuccessResponse_0(); } - CHIP_ERROR TestReadTheRoMandatoryAttributeDefaultConfigStatus_2() + static void OnFailureCallback_1(void * context, uint8_t status) { - chip::Controller::WindowCoveringClusterTest cluster; - cluster.Associate(mDevice, 1); - - return cluster.ReadAttributeConfigStatus(mOnSuccessCallback_2.Cancel(), mOnFailureCallback_2.Cancel()); + (static_cast(context))->OnFailureResponse_1(status); } - void OnFailureResponse_2(uint8_t status) { ThrowFailureResponse(); } - - void OnSuccessResponse_2(uint8_t configStatus) + static void OnSuccessCallback_1(void * context, bool onOff) { - VerifyOrReturn(CheckValue("configStatus", configStatus, 3)); - NextTest(); + (static_cast(context))->OnSuccessResponse_1(onOff); } - CHIP_ERROR TestReadsBackTheRoMandatoryAttributeConfigStatus_3() + static void OnFailureCallback_2(void * context, uint8_t status) { - chip::Controller::WindowCoveringClusterTest cluster; - cluster.Associate(mDevice, 1); - - return cluster.ReadAttributeConfigStatus(mOnSuccessCallback_3.Cancel(), mOnFailureCallback_3.Cancel()); + (static_cast(context))->OnFailureResponse_2(status); } - void OnFailureResponse_3(uint8_t status) { ThrowFailureResponse(); } - - void OnSuccessResponse_3(uint8_t configStatus) - { - VerifyOrReturn(CheckValue("configStatus", configStatus, 3)); - NextTest(); - } + static void OnSuccessCallback_2(void * context) { (static_cast(context))->OnSuccessResponse_2(); } - CHIP_ERROR TestReadTheRoMandatoryAttributeDefaultOperationalStatus_4() + static void OnFailureCallback_3(void * context, uint8_t status) { - chip::Controller::WindowCoveringClusterTest cluster; - cluster.Associate(mDevice, 1); - - return cluster.ReadAttributeOperationalStatus(mOnSuccessCallback_4.Cancel(), mOnFailureCallback_4.Cancel()); + (static_cast(context))->OnFailureResponse_3(status); } - void OnFailureResponse_4(uint8_t status) { ThrowFailureResponse(); } + static void OnSuccessCallback_3(void * context) { (static_cast(context))->OnSuccessResponse_3(); } - void OnSuccessResponse_4(uint8_t operationalStatus) + static void OnFailureCallback_4(void * context, uint8_t status) { - VerifyOrReturn(CheckValue("operationalStatus", operationalStatus, 0)); - NextTest(); + (static_cast(context))->OnFailureResponse_4(status); } - CHIP_ERROR TestReadsBackTheRoMandatoryAttributeOperationalStatus_5() + static void OnSuccessCallback_4(void * context, bool onOff) { - chip::Controller::WindowCoveringClusterTest cluster; - cluster.Associate(mDevice, 1); - - return cluster.ReadAttributeOperationalStatus(mOnSuccessCallback_5.Cancel(), mOnFailureCallback_5.Cancel()); + (static_cast(context))->OnSuccessResponse_4(onOff); } - void OnFailureResponse_5(uint8_t status) { ThrowFailureResponse(); } - - void OnSuccessResponse_5(uint8_t operationalStatus) - { - VerifyOrReturn(CheckValue("operationalStatus", operationalStatus, 0)); - NextTest(); - } + // + // Tests methods + // - CHIP_ERROR TestReadTheRoMandatoryAttributeDefaultEndProductType_6() + CHIP_ERROR TestTurnOnLightForColorControlTests_0() { - chip::Controller::WindowCoveringClusterTest cluster; + chip::Controller::OnOffClusterTest cluster; cluster.Associate(mDevice, 1); - return cluster.ReadAttributeEndProductType(mOnSuccessCallback_6.Cancel(), mOnFailureCallback_6.Cancel()); + return cluster.On(mOnSuccessCallback_0.Cancel(), mOnFailureCallback_0.Cancel()); } - void OnFailureResponse_6(uint8_t status) { ThrowFailureResponse(); } + void OnFailureResponse_0(uint8_t status) { ThrowFailureResponse(); } - void OnSuccessResponse_6(uint8_t endProductType) - { - VerifyOrReturn(CheckValue("endProductType", endProductType, 0)); - NextTest(); - } + void OnSuccessResponse_0() { NextTest(); } - CHIP_ERROR TestReadsBackTheRoMandatoryAttributeEndProductType_7() + CHIP_ERROR TestCheckOnOffAttributeValueIsTrueAfterOnCommand_1() { - chip::Controller::WindowCoveringClusterTest cluster; + chip::Controller::OnOffClusterTest cluster; cluster.Associate(mDevice, 1); - return cluster.ReadAttributeEndProductType(mOnSuccessCallback_7.Cancel(), mOnFailureCallback_7.Cancel()); + return cluster.ReadAttributeOnOff(mOnSuccessCallback_1.Cancel(), mOnFailureCallback_1.Cancel()); } - void OnFailureResponse_7(uint8_t status) { ThrowFailureResponse(); } + void OnFailureResponse_1(uint8_t status) { ThrowFailureResponse(); } - void OnSuccessResponse_7(uint8_t endProductType) + void OnSuccessResponse_1(bool onOff) { - VerifyOrReturn(CheckValue("endProductType", endProductType, 0)); + VerifyOrReturn(CheckValue("onOff", onOff, 1)); NextTest(); } - CHIP_ERROR TestReadTheRwMandatoryAttributeDefaultMode_8() + CHIP_ERROR TestStepColorCommand_2() { - chip::Controller::WindowCoveringClusterTest cluster; + chip::Controller::ColorControlClusterTest cluster; cluster.Associate(mDevice, 1); - return cluster.ReadAttributeMode(mOnSuccessCallback_8.Cancel(), mOnFailureCallback_8.Cancel()); + int16_t stepXArgument = 15; + int16_t stepYArgument = 20; + uint16_t transitionTimeArgument = 50U; + uint8_t optionsMaskArgument = 0; + uint8_t optionsOverrideArgument = 0; + + return cluster.StepColor(mOnSuccessCallback_2.Cancel(), mOnFailureCallback_2.Cancel(), stepXArgument, stepYArgument, + transitionTimeArgument, optionsMaskArgument, optionsOverrideArgument); } - void OnFailureResponse_8(uint8_t status) { ThrowFailureResponse(); } + void OnFailureResponse_2(uint8_t status) { ThrowFailureResponse(); } - void OnSuccessResponse_8(uint8_t mode) - { - VerifyOrReturn(CheckValue("mode", mode, 0)); - NextTest(); - } + void OnSuccessResponse_2() { NextTest(); } - CHIP_ERROR TestWriteAValueIntoTheRwMandatoryAttributeMode_9() + CHIP_ERROR TestTurnOffLightThatWeTurnedOn_3() { - chip::Controller::WindowCoveringClusterTest cluster; + chip::Controller::OnOffClusterTest cluster; cluster.Associate(mDevice, 1); - uint8_t modeArgument = 7; - - return cluster.WriteAttributeMode(mOnSuccessCallback_9.Cancel(), mOnFailureCallback_9.Cancel(), modeArgument); + return cluster.Off(mOnSuccessCallback_3.Cancel(), mOnFailureCallback_3.Cancel()); } - void OnFailureResponse_9(uint8_t status) { ThrowFailureResponse(); } + void OnFailureResponse_3(uint8_t status) { ThrowFailureResponse(); } - void OnSuccessResponse_9(uint8_t mode) { NextTest(); } + void OnSuccessResponse_3() { NextTest(); } - CHIP_ERROR TestReadsBackTheRwMandatoryAttributeMode_10() + CHIP_ERROR TestCheckOnOffAttributeValueIsFalseAfterOffCommand_4() { - chip::Controller::WindowCoveringClusterTest cluster; + chip::Controller::OnOffClusterTest cluster; cluster.Associate(mDevice, 1); - return cluster.ReadAttributeMode(mOnSuccessCallback_10.Cancel(), mOnFailureCallback_10.Cancel()); + return cluster.ReadAttributeOnOff(mOnSuccessCallback_4.Cancel(), mOnFailureCallback_4.Cancel()); } - void OnFailureResponse_10(uint8_t status) { ThrowFailureResponse(); } + void OnFailureResponse_4(uint8_t status) { ThrowFailureResponse(); } - void OnSuccessResponse_10(uint8_t mode) + void OnSuccessResponse_4(bool onOff) { - VerifyOrReturn(CheckValue("mode", mode, 7)); + VerifyOrReturn(CheckValue("onOff", onOff, 0)); NextTest(); } }; -class Test_TC_WNCV_3_1 : public TestCommand +class Test_TC_CC_6_1 : public TestCommand { public: - Test_TC_WNCV_3_1() : TestCommand("Test_TC_WNCV_3_1"), mTestIndex(0) {} + Test_TC_CC_6_1() : TestCommand("Test_TC_CC_6_1"), mTestIndex(0) {} /////////// TestCommand Interface ///////// void NextTest() override @@ -10829,12 +13341,12 @@ class Test_TC_WNCV_3_1 : public TestCommand if (0 == mTestIndex) { - ChipLogProgress(chipTool, " **** Test Start: Test_TC_WNCV_3_1\n"); + ChipLogProgress(chipTool, " **** Test Start: Test_TC_CC_6_1\n"); } if (mTestCount == mTestIndex) { - ChipLogProgress(chipTool, " **** Test Complete: Test_TC_WNCV_3_1\n"); + ChipLogProgress(chipTool, " **** Test Complete: Test_TC_CC_6_1\n"); SetCommandExitStatus(CHIP_NO_ERROR); return; } @@ -10846,16 +13358,24 @@ class Test_TC_WNCV_3_1 : public TestCommand switch (mTestIndex++) { case 0: - ChipLogProgress(chipTool, " ***** Test Step 0 : 1a: TH adjusts the the DUT to a non-open position\n"); - err = Test1aThAdjustsTheTheDutToANonOpenPosition_0(); + ChipLogProgress(chipTool, " ***** Test Step 0 : Turn on light for color control tests\n"); + err = TestTurnOnLightForColorControlTests_0(); break; case 1: - ChipLogProgress(chipTool, " ***** Test Step 1 : 2a: TH sends UpOrOpen command to DUT\n"); - err = Test2aThSendsUpOrOpenCommandToDut_1(); + ChipLogProgress(chipTool, " ***** Test Step 1 : Check on/off attribute value is true after on command\n"); + err = TestCheckOnOffAttributeValueIsTrueAfterOnCommand_1(); break; case 2: - ChipLogProgress(chipTool, " ***** Test Step 2 : 3a: TH reads OperationalStatus attribute from DUT\n"); - err = Test3aThReadsOperationalStatusAttributeFromDut_2(); + ChipLogProgress(chipTool, " ***** Test Step 2 : Move To Color Temperature command\n"); + err = TestMoveToColorTemperatureCommand_2(); + break; + case 3: + ChipLogProgress(chipTool, " ***** Test Step 3 : Turn off light that we turned on\n"); + err = TestTurnOffLightThatWeTurnedOn_3(); + break; + case 4: + ChipLogProgress(chipTool, " ***** Test Step 4 : Check on/off attribute value is false after off command\n"); + err = TestCheckOnOffAttributeValueIsFalseAfterOffCommand_4(); break; } @@ -10868,88 +13388,144 @@ class Test_TC_WNCV_3_1 : public TestCommand private: std::atomic_uint16_t mTestIndex; - const uint16_t mTestCount = 3; + const uint16_t mTestCount = 5; chip::Callback::Callback mOnFailureCallback_0{ OnFailureCallback_0, this }; chip::Callback::Callback mOnSuccessCallback_0{ OnSuccessCallback_0, this }; chip::Callback::Callback mOnFailureCallback_1{ OnFailureCallback_1, this }; - chip::Callback::Callback mOnSuccessCallback_1{ OnSuccessCallback_1, this }; + chip::Callback::Callback mOnSuccessCallback_1{ OnSuccessCallback_1, this }; chip::Callback::Callback mOnFailureCallback_2{ OnFailureCallback_2, this }; - chip::Callback::Callback mOnSuccessCallback_2{ OnSuccessCallback_2, this }; + chip::Callback::Callback mOnSuccessCallback_2{ OnSuccessCallback_2, this }; + chip::Callback::Callback mOnFailureCallback_3{ OnFailureCallback_3, this }; + chip::Callback::Callback mOnSuccessCallback_3{ OnSuccessCallback_3, this }; + chip::Callback::Callback mOnFailureCallback_4{ OnFailureCallback_4, this }; + chip::Callback::Callback mOnSuccessCallback_4{ OnSuccessCallback_4, this }; static void OnFailureCallback_0(void * context, uint8_t status) { - (static_cast(context))->OnFailureResponse_0(status); + (static_cast(context))->OnFailureResponse_0(status); } - static void OnSuccessCallback_0(void * context) { (static_cast(context))->OnSuccessResponse_0(); } + static void OnSuccessCallback_0(void * context) { (static_cast(context))->OnSuccessResponse_0(); } static void OnFailureCallback_1(void * context, uint8_t status) { - (static_cast(context))->OnFailureResponse_1(status); + (static_cast(context))->OnFailureResponse_1(status); } - static void OnSuccessCallback_1(void * context) { (static_cast(context))->OnSuccessResponse_1(); } + static void OnSuccessCallback_1(void * context, bool onOff) + { + (static_cast(context))->OnSuccessResponse_1(onOff); + } static void OnFailureCallback_2(void * context, uint8_t status) { - (static_cast(context))->OnFailureResponse_2(status); + (static_cast(context))->OnFailureResponse_2(status); } - static void OnSuccessCallback_2(void * context, uint8_t operationalStatus) + static void OnSuccessCallback_2(void * context) { (static_cast(context))->OnSuccessResponse_2(); } + + static void OnFailureCallback_3(void * context, uint8_t status) { - (static_cast(context))->OnSuccessResponse_2(operationalStatus); + (static_cast(context))->OnFailureResponse_3(status); + } + + static void OnSuccessCallback_3(void * context) { (static_cast(context))->OnSuccessResponse_3(); } + + static void OnFailureCallback_4(void * context, uint8_t status) + { + (static_cast(context))->OnFailureResponse_4(status); + } + + static void OnSuccessCallback_4(void * context, bool onOff) + { + (static_cast(context))->OnSuccessResponse_4(onOff); } // // Tests methods // - CHIP_ERROR Test1aThAdjustsTheTheDutToANonOpenPosition_0() + CHIP_ERROR TestTurnOnLightForColorControlTests_0() { - chip::Controller::WindowCoveringClusterTest cluster; + chip::Controller::OnOffClusterTest cluster; cluster.Associate(mDevice, 1); - return cluster.DownOrClose(mOnSuccessCallback_0.Cancel(), mOnFailureCallback_0.Cancel()); + return cluster.On(mOnSuccessCallback_0.Cancel(), mOnFailureCallback_0.Cancel()); } void OnFailureResponse_0(uint8_t status) { ThrowFailureResponse(); } void OnSuccessResponse_0() { NextTest(); } - CHIP_ERROR Test2aThSendsUpOrOpenCommandToDut_1() + CHIP_ERROR TestCheckOnOffAttributeValueIsTrueAfterOnCommand_1() { - chip::Controller::WindowCoveringClusterTest cluster; + chip::Controller::OnOffClusterTest cluster; cluster.Associate(mDevice, 1); - return cluster.UpOrOpen(mOnSuccessCallback_1.Cancel(), mOnFailureCallback_1.Cancel()); + return cluster.ReadAttributeOnOff(mOnSuccessCallback_1.Cancel(), mOnFailureCallback_1.Cancel()); } void OnFailureResponse_1(uint8_t status) { ThrowFailureResponse(); } - void OnSuccessResponse_1() { NextTest(); } + void OnSuccessResponse_1(bool onOff) + { + VerifyOrReturn(CheckValue("onOff", onOff, 1)); + NextTest(); + } + + CHIP_ERROR TestMoveToColorTemperatureCommand_2() + { + chip::Controller::ColorControlClusterTest cluster; + cluster.Associate(mDevice, 1); + + uint16_t colorTemperatureArgument = 100U; + uint16_t transitionTimeArgument = 10U; + uint8_t optionsMaskArgument = 0; + uint8_t optionsOverrideArgument = 0; + + return cluster.MoveToColorTemperature(mOnSuccessCallback_2.Cancel(), mOnFailureCallback_2.Cancel(), + colorTemperatureArgument, transitionTimeArgument, optionsMaskArgument, + optionsOverrideArgument); + } + + void OnFailureResponse_2(uint8_t status) { ThrowFailureResponse(); } + + void OnSuccessResponse_2() { NextTest(); } + + CHIP_ERROR TestTurnOffLightThatWeTurnedOn_3() + { + chip::Controller::OnOffClusterTest cluster; + cluster.Associate(mDevice, 1); + + return cluster.Off(mOnSuccessCallback_3.Cancel(), mOnFailureCallback_3.Cancel()); + } + + void OnFailureResponse_3(uint8_t status) { ThrowFailureResponse(); } + + void OnSuccessResponse_3() { NextTest(); } - CHIP_ERROR Test3aThReadsOperationalStatusAttributeFromDut_2() + CHIP_ERROR TestCheckOnOffAttributeValueIsFalseAfterOffCommand_4() { - chip::Controller::WindowCoveringClusterTest cluster; + chip::Controller::OnOffClusterTest cluster; cluster.Associate(mDevice, 1); - return cluster.ReadAttributeOperationalStatus(mOnSuccessCallback_2.Cancel(), mOnFailureCallback_2.Cancel()); + return cluster.ReadAttributeOnOff(mOnSuccessCallback_4.Cancel(), mOnFailureCallback_4.Cancel()); } - void OnFailureResponse_2(uint8_t status) { ThrowFailureResponse(); } + void OnFailureResponse_4(uint8_t status) { ThrowFailureResponse(); } - void OnSuccessResponse_2(uint8_t operationalStatus) + void OnSuccessResponse_4(bool onOff) { - VerifyOrReturn(CheckValue("operationalStatus", operationalStatus, 0)); + VerifyOrReturn(CheckValue("onOff", onOff, 0)); NextTest(); } }; -class Test_TC_WNCV_3_2 : public TestCommand +class Test_TC_CC_6_2 : public TestCommand { public: - Test_TC_WNCV_3_2() : TestCommand("Test_TC_WNCV_3_2"), mTestIndex(0) {} + Test_TC_CC_6_2() : TestCommand("Test_TC_CC_6_2"), mTestIndex(0) {} /////////// TestCommand Interface ///////// void NextTest() override @@ -10958,12 +13534,12 @@ class Test_TC_WNCV_3_2 : public TestCommand if (0 == mTestIndex) { - ChipLogProgress(chipTool, " **** Test Start: Test_TC_WNCV_3_2\n"); + ChipLogProgress(chipTool, " **** Test Start: Test_TC_CC_6_2\n"); } if (mTestCount == mTestIndex) { - ChipLogProgress(chipTool, " **** Test Complete: Test_TC_WNCV_3_2\n"); + ChipLogProgress(chipTool, " **** Test Complete: Test_TC_CC_6_2\n"); SetCommandExitStatus(CHIP_NO_ERROR); return; } @@ -10975,16 +13551,32 @@ class Test_TC_WNCV_3_2 : public TestCommand switch (mTestIndex++) { case 0: - ChipLogProgress(chipTool, " ***** Test Step 0 : 1a: TH adjusts the the DUT to a non-closed position\n"); - err = Test1aThAdjustsTheTheDutToANonClosedPosition_0(); + ChipLogProgress(chipTool, " ***** Test Step 0 : Turn on light for color control tests\n"); + err = TestTurnOnLightForColorControlTests_0(); break; case 1: - ChipLogProgress(chipTool, " ***** Test Step 1 : 2a: TH sends DownOrClose command to DUT\n"); - err = Test2aThSendsDownOrCloseCommandToDut_1(); + ChipLogProgress(chipTool, " ***** Test Step 1 : Check on/off attribute value is true after on command\n"); + err = TestCheckOnOffAttributeValueIsTrueAfterOnCommand_1(); break; case 2: - ChipLogProgress(chipTool, " ***** Test Step 2 : 3a: TH reads OperationalStatus attribute from DUT\n"); - err = Test3aThReadsOperationalStatusAttributeFromDut_2(); + ChipLogProgress(chipTool, " ***** Test Step 2 : Move up color temperature command\n"); + err = TestMoveUpColorTemperatureCommand_2(); + break; + case 3: + ChipLogProgress(chipTool, " ***** Test Step 3 : Stop Color Temperature command\n"); + err = TestStopColorTemperatureCommand_3(); + break; + case 4: + ChipLogProgress(chipTool, " ***** Test Step 4 : Move down color temperature command\n"); + err = TestMoveDownColorTemperatureCommand_4(); + break; + case 5: + ChipLogProgress(chipTool, " ***** Test Step 5 : Turn off light that we turned on\n"); + err = TestTurnOffLightThatWeTurnedOn_5(); + break; + case 6: + ChipLogProgress(chipTool, " ***** Test Step 6 : Check on/off attribute value is false after off command\n"); + err = TestCheckOnOffAttributeValueIsFalseAfterOffCommand_6(); break; } @@ -10997,88 +13589,206 @@ class Test_TC_WNCV_3_2 : public TestCommand private: std::atomic_uint16_t mTestIndex; - const uint16_t mTestCount = 3; + const uint16_t mTestCount = 7; chip::Callback::Callback mOnFailureCallback_0{ OnFailureCallback_0, this }; chip::Callback::Callback mOnSuccessCallback_0{ OnSuccessCallback_0, this }; chip::Callback::Callback mOnFailureCallback_1{ OnFailureCallback_1, this }; - chip::Callback::Callback mOnSuccessCallback_1{ OnSuccessCallback_1, this }; + chip::Callback::Callback mOnSuccessCallback_1{ OnSuccessCallback_1, this }; chip::Callback::Callback mOnFailureCallback_2{ OnFailureCallback_2, this }; - chip::Callback::Callback mOnSuccessCallback_2{ OnSuccessCallback_2, this }; + chip::Callback::Callback mOnSuccessCallback_2{ OnSuccessCallback_2, this }; + chip::Callback::Callback mOnFailureCallback_3{ OnFailureCallback_3, this }; + chip::Callback::Callback mOnSuccessCallback_3{ OnSuccessCallback_3, this }; + chip::Callback::Callback mOnFailureCallback_4{ OnFailureCallback_4, this }; + chip::Callback::Callback mOnSuccessCallback_4{ OnSuccessCallback_4, this }; + chip::Callback::Callback mOnFailureCallback_5{ OnFailureCallback_5, this }; + chip::Callback::Callback mOnSuccessCallback_5{ OnSuccessCallback_5, this }; + chip::Callback::Callback mOnFailureCallback_6{ OnFailureCallback_6, this }; + chip::Callback::Callback mOnSuccessCallback_6{ OnSuccessCallback_6, this }; static void OnFailureCallback_0(void * context, uint8_t status) { - (static_cast(context))->OnFailureResponse_0(status); + (static_cast(context))->OnFailureResponse_0(status); } - static void OnSuccessCallback_0(void * context) { (static_cast(context))->OnSuccessResponse_0(); } + static void OnSuccessCallback_0(void * context) { (static_cast(context))->OnSuccessResponse_0(); } static void OnFailureCallback_1(void * context, uint8_t status) { - (static_cast(context))->OnFailureResponse_1(status); + (static_cast(context))->OnFailureResponse_1(status); } - static void OnSuccessCallback_1(void * context) { (static_cast(context))->OnSuccessResponse_1(); } + static void OnSuccessCallback_1(void * context, bool onOff) + { + (static_cast(context))->OnSuccessResponse_1(onOff); + } static void OnFailureCallback_2(void * context, uint8_t status) { - (static_cast(context))->OnFailureResponse_2(status); + (static_cast(context))->OnFailureResponse_2(status); } - static void OnSuccessCallback_2(void * context, uint8_t operationalStatus) + static void OnSuccessCallback_2(void * context) { (static_cast(context))->OnSuccessResponse_2(); } + + static void OnFailureCallback_3(void * context, uint8_t status) { - (static_cast(context))->OnSuccessResponse_2(operationalStatus); + (static_cast(context))->OnFailureResponse_3(status); + } + + static void OnSuccessCallback_3(void * context) { (static_cast(context))->OnSuccessResponse_3(); } + + static void OnFailureCallback_4(void * context, uint8_t status) + { + (static_cast(context))->OnFailureResponse_4(status); + } + + static void OnSuccessCallback_4(void * context) { (static_cast(context))->OnSuccessResponse_4(); } + + static void OnFailureCallback_5(void * context, uint8_t status) + { + (static_cast(context))->OnFailureResponse_5(status); + } + + static void OnSuccessCallback_5(void * context) { (static_cast(context))->OnSuccessResponse_5(); } + + static void OnFailureCallback_6(void * context, uint8_t status) + { + (static_cast(context))->OnFailureResponse_6(status); + } + + static void OnSuccessCallback_6(void * context, bool onOff) + { + (static_cast(context))->OnSuccessResponse_6(onOff); } // // Tests methods // - CHIP_ERROR Test1aThAdjustsTheTheDutToANonClosedPosition_0() + CHIP_ERROR TestTurnOnLightForColorControlTests_0() { - chip::Controller::WindowCoveringClusterTest cluster; + chip::Controller::OnOffClusterTest cluster; cluster.Associate(mDevice, 1); - return cluster.UpOrOpen(mOnSuccessCallback_0.Cancel(), mOnFailureCallback_0.Cancel()); + return cluster.On(mOnSuccessCallback_0.Cancel(), mOnFailureCallback_0.Cancel()); } void OnFailureResponse_0(uint8_t status) { ThrowFailureResponse(); } void OnSuccessResponse_0() { NextTest(); } - CHIP_ERROR Test2aThSendsDownOrCloseCommandToDut_1() + CHIP_ERROR TestCheckOnOffAttributeValueIsTrueAfterOnCommand_1() { - chip::Controller::WindowCoveringClusterTest cluster; + chip::Controller::OnOffClusterTest cluster; cluster.Associate(mDevice, 1); - return cluster.DownOrClose(mOnSuccessCallback_1.Cancel(), mOnFailureCallback_1.Cancel()); + return cluster.ReadAttributeOnOff(mOnSuccessCallback_1.Cancel(), mOnFailureCallback_1.Cancel()); } void OnFailureResponse_1(uint8_t status) { ThrowFailureResponse(); } - void OnSuccessResponse_1() { NextTest(); } + void OnSuccessResponse_1(bool onOff) + { + VerifyOrReturn(CheckValue("onOff", onOff, 1)); + NextTest(); + } - CHIP_ERROR Test3aThReadsOperationalStatusAttributeFromDut_2() + CHIP_ERROR TestMoveUpColorTemperatureCommand_2() { - chip::Controller::WindowCoveringClusterTest cluster; + chip::Controller::ColorControlClusterTest cluster; cluster.Associate(mDevice, 1); - return cluster.ReadAttributeOperationalStatus(mOnSuccessCallback_2.Cancel(), mOnFailureCallback_2.Cancel()); + uint8_t moveModeArgument = 1; + uint16_t rateArgument = 10U; + uint16_t colorTemperatureMinimumArgument = 1U; + uint16_t colorTemperatureMaximumArgument = 255U; + uint8_t optionsMaskArgument = 0; + uint8_t optionsOverrideArgument = 0; + + return cluster.MoveColorTemperature(mOnSuccessCallback_2.Cancel(), mOnFailureCallback_2.Cancel(), moveModeArgument, + rateArgument, colorTemperatureMinimumArgument, colorTemperatureMaximumArgument, + optionsMaskArgument, optionsOverrideArgument); } void OnFailureResponse_2(uint8_t status) { ThrowFailureResponse(); } - void OnSuccessResponse_2(uint8_t operationalStatus) + void OnSuccessResponse_2() { NextTest(); } + + CHIP_ERROR TestStopColorTemperatureCommand_3() { - VerifyOrReturn(CheckValue("operationalStatus", operationalStatus, 0)); + chip::Controller::ColorControlClusterTest cluster; + cluster.Associate(mDevice, 1); + + uint8_t moveModeArgument = 0; + uint16_t rateArgument = 10U; + uint16_t colorTemperatureMinimumArgument = 1U; + uint16_t colorTemperatureMaximumArgument = 255U; + uint8_t optionsMaskArgument = 0; + uint8_t optionsOverrideArgument = 0; + + return cluster.MoveColorTemperature(mOnSuccessCallback_3.Cancel(), mOnFailureCallback_3.Cancel(), moveModeArgument, + rateArgument, colorTemperatureMinimumArgument, colorTemperatureMaximumArgument, + optionsMaskArgument, optionsOverrideArgument); + } + + void OnFailureResponse_3(uint8_t status) { ThrowFailureResponse(); } + + void OnSuccessResponse_3() { NextTest(); } + + CHIP_ERROR TestMoveDownColorTemperatureCommand_4() + { + chip::Controller::ColorControlClusterTest cluster; + cluster.Associate(mDevice, 1); + + uint8_t moveModeArgument = 3; + uint16_t rateArgument = 20U; + uint16_t colorTemperatureMinimumArgument = 1U; + uint16_t colorTemperatureMaximumArgument = 255U; + uint8_t optionsMaskArgument = 0; + uint8_t optionsOverrideArgument = 0; + + return cluster.MoveColorTemperature(mOnSuccessCallback_4.Cancel(), mOnFailureCallback_4.Cancel(), moveModeArgument, + rateArgument, colorTemperatureMinimumArgument, colorTemperatureMaximumArgument, + optionsMaskArgument, optionsOverrideArgument); + } + + void OnFailureResponse_4(uint8_t status) { ThrowFailureResponse(); } + + void OnSuccessResponse_4() { NextTest(); } + + CHIP_ERROR TestTurnOffLightThatWeTurnedOn_5() + { + chip::Controller::OnOffClusterTest cluster; + cluster.Associate(mDevice, 1); + + return cluster.Off(mOnSuccessCallback_5.Cancel(), mOnFailureCallback_5.Cancel()); + } + + void OnFailureResponse_5(uint8_t status) { ThrowFailureResponse(); } + + void OnSuccessResponse_5() { NextTest(); } + + CHIP_ERROR TestCheckOnOffAttributeValueIsFalseAfterOffCommand_6() + { + chip::Controller::OnOffClusterTest cluster; + cluster.Associate(mDevice, 1); + + return cluster.ReadAttributeOnOff(mOnSuccessCallback_6.Cancel(), mOnFailureCallback_6.Cancel()); + } + + void OnFailureResponse_6(uint8_t status) { ThrowFailureResponse(); } + + void OnSuccessResponse_6(bool onOff) + { + VerifyOrReturn(CheckValue("onOff", onOff, 0)); NextTest(); } }; -class Test_TC_WNCV_3_3 : public TestCommand +class Test_TC_CC_6_3 : public TestCommand { public: - Test_TC_WNCV_3_3() : TestCommand("Test_TC_WNCV_3_3"), mTestIndex(0) {} + Test_TC_CC_6_3() : TestCommand("Test_TC_CC_6_3"), mTestIndex(0) {} /////////// TestCommand Interface ///////// void NextTest() override @@ -11087,12 +13797,12 @@ class Test_TC_WNCV_3_3 : public TestCommand if (0 == mTestIndex) { - ChipLogProgress(chipTool, " **** Test Start: Test_TC_WNCV_3_3\n"); + ChipLogProgress(chipTool, " **** Test Start: Test_TC_CC_6_3\n"); } if (mTestCount == mTestIndex) { - ChipLogProgress(chipTool, " **** Test Complete: Test_TC_WNCV_3_3\n"); + ChipLogProgress(chipTool, " **** Test Complete: Test_TC_CC_6_3\n"); SetCommandExitStatus(CHIP_NO_ERROR); return; } @@ -11104,16 +13814,28 @@ class Test_TC_WNCV_3_3 : public TestCommand switch (mTestIndex++) { case 0: - ChipLogProgress(chipTool, " ***** Test Step 0 : 1a: TH adjusts the the DUT to a non-open position\n"); - err = Test1aThAdjustsTheTheDutToANonOpenPosition_0(); + ChipLogProgress(chipTool, " ***** Test Step 0 : Turn on light for color control tests\n"); + err = TestTurnOnLightForColorControlTests_0(); break; case 1: - ChipLogProgress(chipTool, " ***** Test Step 1 : 2a: TH sends StopMotion command to DUT\n"); - err = Test2aThSendsStopMotionCommandToDut_1(); + ChipLogProgress(chipTool, " ***** Test Step 1 : Check on/off attribute value is true after on command\n"); + err = TestCheckOnOffAttributeValueIsTrueAfterOnCommand_1(); break; case 2: - ChipLogProgress(chipTool, " ***** Test Step 2 : 2b: TH reads OperationalStatus attribute from DUT\n"); - err = Test2bThReadsOperationalStatusAttributeFromDut_2(); + ChipLogProgress(chipTool, " ***** Test Step 2 : Step up color temperature command\n"); + err = TestStepUpColorTemperatureCommand_2(); + break; + case 3: + ChipLogProgress(chipTool, " ***** Test Step 3 : Step down color temperature command\n"); + err = TestStepDownColorTemperatureCommand_3(); + break; + case 4: + ChipLogProgress(chipTool, " ***** Test Step 4 : Turn off light that we turned on\n"); + err = TestTurnOffLightThatWeTurnedOn_4(); + break; + case 5: + ChipLogProgress(chipTool, " ***** Test Step 5 : Check on/off attribute value is false after off command\n"); + err = TestCheckOnOffAttributeValueIsFalseAfterOffCommand_5(); break; } @@ -11126,88 +13848,178 @@ class Test_TC_WNCV_3_3 : public TestCommand private: std::atomic_uint16_t mTestIndex; - const uint16_t mTestCount = 3; + const uint16_t mTestCount = 6; chip::Callback::Callback mOnFailureCallback_0{ OnFailureCallback_0, this }; chip::Callback::Callback mOnSuccessCallback_0{ OnSuccessCallback_0, this }; chip::Callback::Callback mOnFailureCallback_1{ OnFailureCallback_1, this }; - chip::Callback::Callback mOnSuccessCallback_1{ OnSuccessCallback_1, this }; + chip::Callback::Callback mOnSuccessCallback_1{ OnSuccessCallback_1, this }; chip::Callback::Callback mOnFailureCallback_2{ OnFailureCallback_2, this }; - chip::Callback::Callback mOnSuccessCallback_2{ OnSuccessCallback_2, this }; + chip::Callback::Callback mOnSuccessCallback_2{ OnSuccessCallback_2, this }; + chip::Callback::Callback mOnFailureCallback_3{ OnFailureCallback_3, this }; + chip::Callback::Callback mOnSuccessCallback_3{ OnSuccessCallback_3, this }; + chip::Callback::Callback mOnFailureCallback_4{ OnFailureCallback_4, this }; + chip::Callback::Callback mOnSuccessCallback_4{ OnSuccessCallback_4, this }; + chip::Callback::Callback mOnFailureCallback_5{ OnFailureCallback_5, this }; + chip::Callback::Callback mOnSuccessCallback_5{ OnSuccessCallback_5, this }; static void OnFailureCallback_0(void * context, uint8_t status) { - (static_cast(context))->OnFailureResponse_0(status); + (static_cast(context))->OnFailureResponse_0(status); } - static void OnSuccessCallback_0(void * context) { (static_cast(context))->OnSuccessResponse_0(); } + static void OnSuccessCallback_0(void * context) { (static_cast(context))->OnSuccessResponse_0(); } + + static void OnFailureCallback_1(void * context, uint8_t status) + { + (static_cast(context))->OnFailureResponse_1(status); + } + + static void OnSuccessCallback_1(void * context, bool onOff) + { + (static_cast(context))->OnSuccessResponse_1(onOff); + } + + static void OnFailureCallback_2(void * context, uint8_t status) + { + (static_cast(context))->OnFailureResponse_2(status); + } + + static void OnSuccessCallback_2(void * context) { (static_cast(context))->OnSuccessResponse_2(); } + + static void OnFailureCallback_3(void * context, uint8_t status) + { + (static_cast(context))->OnFailureResponse_3(status); + } + + static void OnSuccessCallback_3(void * context) { (static_cast(context))->OnSuccessResponse_3(); } + + static void OnFailureCallback_4(void * context, uint8_t status) + { + (static_cast(context))->OnFailureResponse_4(status); + } + + static void OnSuccessCallback_4(void * context) { (static_cast(context))->OnSuccessResponse_4(); } + + static void OnFailureCallback_5(void * context, uint8_t status) + { + (static_cast(context))->OnFailureResponse_5(status); + } + + static void OnSuccessCallback_5(void * context, bool onOff) + { + (static_cast(context))->OnSuccessResponse_5(onOff); + } + + // + // Tests methods + // + + CHIP_ERROR TestTurnOnLightForColorControlTests_0() + { + chip::Controller::OnOffClusterTest cluster; + cluster.Associate(mDevice, 1); + + return cluster.On(mOnSuccessCallback_0.Cancel(), mOnFailureCallback_0.Cancel()); + } + + void OnFailureResponse_0(uint8_t status) { ThrowFailureResponse(); } + + void OnSuccessResponse_0() { NextTest(); } - static void OnFailureCallback_1(void * context, uint8_t status) + CHIP_ERROR TestCheckOnOffAttributeValueIsTrueAfterOnCommand_1() { - (static_cast(context))->OnFailureResponse_1(status); + chip::Controller::OnOffClusterTest cluster; + cluster.Associate(mDevice, 1); + + return cluster.ReadAttributeOnOff(mOnSuccessCallback_1.Cancel(), mOnFailureCallback_1.Cancel()); } - static void OnSuccessCallback_1(void * context) { (static_cast(context))->OnSuccessResponse_1(); } + void OnFailureResponse_1(uint8_t status) { ThrowFailureResponse(); } - static void OnFailureCallback_2(void * context, uint8_t status) + void OnSuccessResponse_1(bool onOff) { - (static_cast(context))->OnFailureResponse_2(status); + VerifyOrReturn(CheckValue("onOff", onOff, 1)); + NextTest(); } - static void OnSuccessCallback_2(void * context, uint8_t operationalStatus) + CHIP_ERROR TestStepUpColorTemperatureCommand_2() { - (static_cast(context))->OnSuccessResponse_2(operationalStatus); + chip::Controller::ColorControlClusterTest cluster; + cluster.Associate(mDevice, 1); + + uint8_t stepModeArgument = 1; + uint16_t stepSizeArgument = 5U; + uint16_t transitionTimeArgument = 50U; + uint16_t colorTemperatureMinimumArgument = 5U; + uint16_t colorTemperatureMaximumArgument = 100U; + uint8_t optionsMaskArgument = 0; + uint8_t optionsOverrideArgument = 0; + + return cluster.StepColorTemperature(mOnSuccessCallback_2.Cancel(), mOnFailureCallback_2.Cancel(), stepModeArgument, + stepSizeArgument, transitionTimeArgument, colorTemperatureMinimumArgument, + colorTemperatureMaximumArgument, optionsMaskArgument, optionsOverrideArgument); } - // - // Tests methods - // + void OnFailureResponse_2(uint8_t status) { ThrowFailureResponse(); } - CHIP_ERROR Test1aThAdjustsTheTheDutToANonOpenPosition_0() + void OnSuccessResponse_2() { NextTest(); } + + CHIP_ERROR TestStepDownColorTemperatureCommand_3() { - chip::Controller::WindowCoveringClusterTest cluster; + chip::Controller::ColorControlClusterTest cluster; cluster.Associate(mDevice, 1); - return cluster.UpOrOpen(mOnSuccessCallback_0.Cancel(), mOnFailureCallback_0.Cancel()); + uint8_t stepModeArgument = 3; + uint16_t stepSizeArgument = 5U; + uint16_t transitionTimeArgument = 50U; + uint16_t colorTemperatureMinimumArgument = 5U; + uint16_t colorTemperatureMaximumArgument = 100U; + uint8_t optionsMaskArgument = 0; + uint8_t optionsOverrideArgument = 0; + + return cluster.StepColorTemperature(mOnSuccessCallback_3.Cancel(), mOnFailureCallback_3.Cancel(), stepModeArgument, + stepSizeArgument, transitionTimeArgument, colorTemperatureMinimumArgument, + colorTemperatureMaximumArgument, optionsMaskArgument, optionsOverrideArgument); } - void OnFailureResponse_0(uint8_t status) { ThrowFailureResponse(); } + void OnFailureResponse_3(uint8_t status) { ThrowFailureResponse(); } - void OnSuccessResponse_0() { NextTest(); } + void OnSuccessResponse_3() { NextTest(); } - CHIP_ERROR Test2aThSendsStopMotionCommandToDut_1() + CHIP_ERROR TestTurnOffLightThatWeTurnedOn_4() { - chip::Controller::WindowCoveringClusterTest cluster; + chip::Controller::OnOffClusterTest cluster; cluster.Associate(mDevice, 1); - return cluster.StopMotion(mOnSuccessCallback_1.Cancel(), mOnFailureCallback_1.Cancel()); + return cluster.Off(mOnSuccessCallback_4.Cancel(), mOnFailureCallback_4.Cancel()); } - void OnFailureResponse_1(uint8_t status) { ThrowFailureResponse(); } + void OnFailureResponse_4(uint8_t status) { ThrowFailureResponse(); } - void OnSuccessResponse_1() { NextTest(); } + void OnSuccessResponse_4() { NextTest(); } - CHIP_ERROR Test2bThReadsOperationalStatusAttributeFromDut_2() + CHIP_ERROR TestCheckOnOffAttributeValueIsFalseAfterOffCommand_5() { - chip::Controller::WindowCoveringClusterTest cluster; + chip::Controller::OnOffClusterTest cluster; cluster.Associate(mDevice, 1); - return cluster.ReadAttributeOperationalStatus(mOnSuccessCallback_2.Cancel(), mOnFailureCallback_2.Cancel()); + return cluster.ReadAttributeOnOff(mOnSuccessCallback_5.Cancel(), mOnFailureCallback_5.Cancel()); } - void OnFailureResponse_2(uint8_t status) { ThrowFailureResponse(); } + void OnFailureResponse_5(uint8_t status) { ThrowFailureResponse(); } - void OnSuccessResponse_2(uint8_t operationalStatus) + void OnSuccessResponse_5(bool onOff) { - VerifyOrReturn(CheckValue("operationalStatus", operationalStatus, 0)); + VerifyOrReturn(CheckValue("onOff", onOff, 0)); NextTest(); } }; -class Test_TC_BI_1_1 : public TestCommand +class Test_TC_CC_7_1 : public TestCommand { public: - Test_TC_BI_1_1() : TestCommand("Test_TC_BI_1_1"), mTestIndex(0) {} + Test_TC_CC_7_1() : TestCommand("Test_TC_CC_7_1"), mTestIndex(0) {} /////////// TestCommand Interface ///////// void NextTest() override @@ -11216,12 +14028,12 @@ class Test_TC_BI_1_1 : public TestCommand if (0 == mTestIndex) { - ChipLogProgress(chipTool, " **** Test Start: Test_TC_BI_1_1\n"); + ChipLogProgress(chipTool, " **** Test Start: Test_TC_CC_7_1\n"); } if (mTestCount == mTestIndex) { - ChipLogProgress(chipTool, " **** Test Complete: Test_TC_BI_1_1\n"); + ChipLogProgress(chipTool, " **** Test Complete: Test_TC_CC_7_1\n"); SetCommandExitStatus(CHIP_NO_ERROR); return; } @@ -11233,17 +14045,29 @@ class Test_TC_BI_1_1 : public TestCommand switch (mTestIndex++) { case 0: - ChipLogProgress(chipTool, " ***** Test Step 0 : read the global attribute: ClusterRevision\n"); - err = TestReadTheGlobalAttributeClusterRevision_0(); + ChipLogProgress(chipTool, " ***** Test Step 0 : Turn on light for color control tests\n"); + err = TestTurnOnLightForColorControlTests_0(); break; case 1: - ChipLogProgress(chipTool, - " ***** Test Step 1 : write the default values to mandatory global attribute: ClusterRevision\n"); - err = TestWriteTheDefaultValuesToMandatoryGlobalAttributeClusterRevision_1(); + ChipLogProgress(chipTool, " ***** Test Step 1 : Check on/off attribute value is true after on command\n"); + err = TestCheckOnOffAttributeValueIsTrueAfterOnCommand_1(); break; case 2: - ChipLogProgress(chipTool, " ***** Test Step 2 : reads back global attribute: ClusterRevision\n"); - err = TestReadsBackGlobalAttributeClusterRevision_2(); + ChipLogProgress(chipTool, " ***** Test Step 2 : Enhanced Move To Hue command\n"); + err = TestEnhancedMoveToHueCommand_2(); + break; + case 3: + ChipLogProgress( + chipTool, " ***** Test Step 3 : Check Remaining time attribute value matched the value sent by the last command\n"); + err = TestCheckRemainingTimeAttributeValueMatchedTheValueSentByTheLastCommand_3(); + break; + case 4: + ChipLogProgress(chipTool, " ***** Test Step 4 : Turn off light that we turned on\n"); + err = TestTurnOffLightThatWeTurnedOn_4(); + break; + case 5: + ChipLogProgress(chipTool, " ***** Test Step 5 : Check on/off attribute value is false after off command\n"); + err = TestCheckOnOffAttributeValueIsFalseAfterOffCommand_5(); break; } @@ -11256,180 +14080,172 @@ class Test_TC_BI_1_1 : public TestCommand private: std::atomic_uint16_t mTestIndex; - const uint16_t mTestCount = 3; + const uint16_t mTestCount = 6; chip::Callback::Callback mOnFailureCallback_0{ OnFailureCallback_0, this }; - chip::Callback::Callback mOnSuccessCallback_0{ OnSuccessCallback_0, this }; + chip::Callback::Callback mOnSuccessCallback_0{ OnSuccessCallback_0, this }; chip::Callback::Callback mOnFailureCallback_1{ OnFailureCallback_1, this }; - chip::Callback::Callback mOnSuccessCallback_1{ OnSuccessCallback_1, this }; + chip::Callback::Callback mOnSuccessCallback_1{ OnSuccessCallback_1, this }; chip::Callback::Callback mOnFailureCallback_2{ OnFailureCallback_2, this }; - chip::Callback::Callback mOnSuccessCallback_2{ OnSuccessCallback_2, this }; + chip::Callback::Callback mOnSuccessCallback_2{ OnSuccessCallback_2, this }; + chip::Callback::Callback mOnFailureCallback_3{ OnFailureCallback_3, this }; + chip::Callback::Callback mOnSuccessCallback_3{ OnSuccessCallback_3, this }; + chip::Callback::Callback mOnFailureCallback_4{ OnFailureCallback_4, this }; + chip::Callback::Callback mOnSuccessCallback_4{ OnSuccessCallback_4, this }; + chip::Callback::Callback mOnFailureCallback_5{ OnFailureCallback_5, this }; + chip::Callback::Callback mOnSuccessCallback_5{ OnSuccessCallback_5, this }; static void OnFailureCallback_0(void * context, uint8_t status) { - (static_cast(context))->OnFailureResponse_0(status); + (static_cast(context))->OnFailureResponse_0(status); } - static void OnSuccessCallback_0(void * context, uint16_t clusterRevision) - { - (static_cast(context))->OnSuccessResponse_0(clusterRevision); - } + static void OnSuccessCallback_0(void * context) { (static_cast(context))->OnSuccessResponse_0(); } static void OnFailureCallback_1(void * context, uint8_t status) { - (static_cast(context))->OnFailureResponse_1(status); + (static_cast(context))->OnFailureResponse_1(status); } - static void OnSuccessCallback_1(void * context, uint16_t clusterRevision) + static void OnSuccessCallback_1(void * context, bool onOff) { - (static_cast(context))->OnSuccessResponse_1(clusterRevision); + (static_cast(context))->OnSuccessResponse_1(onOff); } static void OnFailureCallback_2(void * context, uint8_t status) { - (static_cast(context))->OnFailureResponse_2(status); + (static_cast(context))->OnFailureResponse_2(status); } - static void OnSuccessCallback_2(void * context, uint16_t clusterRevision) + static void OnSuccessCallback_2(void * context) { (static_cast(context))->OnSuccessResponse_2(); } + + static void OnFailureCallback_3(void * context, uint8_t status) { - (static_cast(context))->OnSuccessResponse_2(clusterRevision); + (static_cast(context))->OnFailureResponse_3(status); } - // - // Tests methods - // - - CHIP_ERROR TestReadTheGlobalAttributeClusterRevision_0() + static void OnSuccessCallback_3(void * context, uint16_t remainingTime) { - chip::Controller::BinaryInputBasicClusterTest cluster; - cluster.Associate(mDevice, 1); + (static_cast(context))->OnSuccessResponse_3(remainingTime); + } - return cluster.ReadAttributeClusterRevision(mOnSuccessCallback_0.Cancel(), mOnFailureCallback_0.Cancel()); + static void OnFailureCallback_4(void * context, uint8_t status) + { + (static_cast(context))->OnFailureResponse_4(status); } - void OnFailureResponse_0(uint8_t status) { ThrowFailureResponse(); } + static void OnSuccessCallback_4(void * context) { (static_cast(context))->OnSuccessResponse_4(); } - void OnSuccessResponse_0(uint16_t clusterRevision) + static void OnFailureCallback_5(void * context, uint8_t status) { - VerifyOrReturn(CheckValue("clusterRevision", clusterRevision, 1U)); - NextTest(); + (static_cast(context))->OnFailureResponse_5(status); } - CHIP_ERROR TestWriteTheDefaultValuesToMandatoryGlobalAttributeClusterRevision_1() + static void OnSuccessCallback_5(void * context, bool onOff) { - chip::Controller::BinaryInputBasicClusterTest cluster; - cluster.Associate(mDevice, 1); + (static_cast(context))->OnSuccessResponse_5(onOff); + } - uint16_t clusterRevisionArgument = 1U; + // + // Tests methods + // - return cluster.WriteAttributeClusterRevision(mOnSuccessCallback_1.Cancel(), mOnFailureCallback_1.Cancel(), - clusterRevisionArgument); + CHIP_ERROR TestTurnOnLightForColorControlTests_0() + { + chip::Controller::OnOffClusterTest cluster; + cluster.Associate(mDevice, 1); + + return cluster.On(mOnSuccessCallback_0.Cancel(), mOnFailureCallback_0.Cancel()); } - void OnFailureResponse_1(uint8_t status) { NextTest(); } + void OnFailureResponse_0(uint8_t status) { ThrowFailureResponse(); } - void OnSuccessResponse_1(uint16_t clusterRevision) { ThrowSuccessResponse(); } + void OnSuccessResponse_0() { NextTest(); } - CHIP_ERROR TestReadsBackGlobalAttributeClusterRevision_2() + CHIP_ERROR TestCheckOnOffAttributeValueIsTrueAfterOnCommand_1() { - chip::Controller::BinaryInputBasicClusterTest cluster; + chip::Controller::OnOffClusterTest cluster; cluster.Associate(mDevice, 1); - return cluster.ReadAttributeClusterRevision(mOnSuccessCallback_2.Cancel(), mOnFailureCallback_2.Cancel()); + return cluster.ReadAttributeOnOff(mOnSuccessCallback_1.Cancel(), mOnFailureCallback_1.Cancel()); } - void OnFailureResponse_2(uint8_t status) { ThrowFailureResponse(); } + void OnFailureResponse_1(uint8_t status) { ThrowFailureResponse(); } - void OnSuccessResponse_2(uint16_t clusterRevision) + void OnSuccessResponse_1(bool onOff) { - VerifyOrReturn(CheckValue("clusterRevision", clusterRevision, 1U)); + VerifyOrReturn(CheckValue("onOff", onOff, 1)); NextTest(); } -}; - -class Test_TC_FLW_1_1 : public TestCommand -{ -public: - Test_TC_FLW_1_1() : TestCommand("Test_TC_FLW_1_1"), mTestIndex(0) {} - /////////// TestCommand Interface ///////// - void NextTest() override + CHIP_ERROR TestEnhancedMoveToHueCommand_2() { - CHIP_ERROR err = CHIP_NO_ERROR; + chip::Controller::ColorControlClusterTest cluster; + cluster.Associate(mDevice, 1); - if (0 == mTestIndex) - { - ChipLogProgress(chipTool, " **** Test Start: Test_TC_FLW_1_1\n"); - } + uint16_t enhancedHueArgument = 1025U; + uint8_t directionArgument = 0; + uint16_t transitionTimeArgument = 1U; + uint8_t optionsMaskArgument = 0; + uint8_t optionsOverrideArgument = 0; - if (mTestCount == mTestIndex) - { - ChipLogProgress(chipTool, " **** Test Complete: Test_TC_FLW_1_1\n"); - SetCommandExitStatus(CHIP_NO_ERROR); - return; - } + return cluster.EnhancedMoveToHue(mOnSuccessCallback_2.Cancel(), mOnFailureCallback_2.Cancel(), enhancedHueArgument, + directionArgument, transitionTimeArgument, optionsMaskArgument, optionsOverrideArgument); + } - // Ensure we increment mTestIndex before we start running the relevant - // command. That way if we lose the timeslice after we send the message - // but before our function call returns, we won't end up with an - // incorrect mTestIndex value observed when we get the response. - switch (mTestIndex++) - { - case 0: - ChipLogProgress(chipTool, - " ***** Test Step 0 : write the default values to mandatory global attribute: ClusterRevision\n"); - err = TestWriteTheDefaultValuesToMandatoryGlobalAttributeClusterRevision_0(); - break; - } + void OnFailureResponse_2(uint8_t status) { ThrowFailureResponse(); } - if (CHIP_NO_ERROR != err) - { - ChipLogError(chipTool, " ***** Test Failure: %s\n", chip::ErrorStr(err)); - SetCommandExitStatus(err); - } - } + void OnSuccessResponse_2() { NextTest(); } -private: - std::atomic_uint16_t mTestIndex; - const uint16_t mTestCount = 1; + CHIP_ERROR TestCheckRemainingTimeAttributeValueMatchedTheValueSentByTheLastCommand_3() + { + chip::Controller::ColorControlClusterTest cluster; + cluster.Associate(mDevice, 1); - chip::Callback::Callback mOnFailureCallback_0{ OnFailureCallback_0, this }; - chip::Callback::Callback mOnSuccessCallback_0{ OnSuccessCallback_0, this }; + return cluster.ReadAttributeRemainingTime(mOnSuccessCallback_3.Cancel(), mOnFailureCallback_3.Cancel()); + } - static void OnFailureCallback_0(void * context, uint8_t status) + void OnFailureResponse_3(uint8_t status) { ThrowFailureResponse(); } + + void OnSuccessResponse_3(uint16_t remainingTime) { - (static_cast(context))->OnFailureResponse_0(status); + VerifyOrReturn(CheckValue("remainingTime", remainingTime, 1U)); + NextTest(); } - static void OnSuccessCallback_0(void * context, uint16_t clusterRevision) + CHIP_ERROR TestTurnOffLightThatWeTurnedOn_4() { - (static_cast(context))->OnSuccessResponse_0(clusterRevision); + chip::Controller::OnOffClusterTest cluster; + cluster.Associate(mDevice, 1); + + return cluster.Off(mOnSuccessCallback_4.Cancel(), mOnFailureCallback_4.Cancel()); } - // - // Tests methods - // + void OnFailureResponse_4(uint8_t status) { ThrowFailureResponse(); } + + void OnSuccessResponse_4() { NextTest(); } - CHIP_ERROR TestWriteTheDefaultValuesToMandatoryGlobalAttributeClusterRevision_0() + CHIP_ERROR TestCheckOnOffAttributeValueIsFalseAfterOffCommand_5() { - chip::Controller::FlowMeasurementClusterTest cluster; + chip::Controller::OnOffClusterTest cluster; cluster.Associate(mDevice, 1); - uint16_t clusterRevisionArgument = 2U; - - return cluster.WriteAttributeClusterRevision(mOnSuccessCallback_0.Cancel(), mOnFailureCallback_0.Cancel(), - clusterRevisionArgument); + return cluster.ReadAttributeOnOff(mOnSuccessCallback_5.Cancel(), mOnFailureCallback_5.Cancel()); } - void OnFailureResponse_0(uint8_t status) { NextTest(); } + void OnFailureResponse_5(uint8_t status) { ThrowFailureResponse(); } - void OnSuccessResponse_0(uint16_t clusterRevision) { ThrowSuccessResponse(); } + void OnSuccessResponse_5(bool onOff) + { + VerifyOrReturn(CheckValue("onOff", onOff, 0)); + NextTest(); + } }; -class Test_TC_TM_1_1 : public TestCommand +class Test_TC_CC_7_2 : public TestCommand { public: - Test_TC_TM_1_1() : TestCommand("Test_TC_TM_1_1"), mTestIndex(0) {} + Test_TC_CC_7_2() : TestCommand("Test_TC_CC_7_2"), mTestIndex(0) {} /////////// TestCommand Interface ///////// void NextTest() override @@ -11438,12 +14254,12 @@ class Test_TC_TM_1_1 : public TestCommand if (0 == mTestIndex) { - ChipLogProgress(chipTool, " **** Test Start: Test_TC_TM_1_1\n"); + ChipLogProgress(chipTool, " **** Test Start: Test_TC_CC_7_2\n"); } if (mTestCount == mTestIndex) { - ChipLogProgress(chipTool, " **** Test Complete: Test_TC_TM_1_1\n"); + ChipLogProgress(chipTool, " **** Test Complete: Test_TC_CC_7_2\n"); SetCommandExitStatus(CHIP_NO_ERROR); return; } @@ -11455,17 +14271,36 @@ class Test_TC_TM_1_1 : public TestCommand switch (mTestIndex++) { case 0: - ChipLogProgress(chipTool, " ***** Test Step 0 : read the global attribute: ClusterRevision\n"); - err = TestReadTheGlobalAttributeClusterRevision_0(); + ChipLogProgress(chipTool, " ***** Test Step 0 : Turn on light for color control tests\n"); + err = TestTurnOnLightForColorControlTests_0(); break; case 1: - ChipLogProgress(chipTool, - " ***** Test Step 1 : write the default values to mandatory global attribute: ClusterRevision\n"); - err = TestWriteTheDefaultValuesToMandatoryGlobalAttributeClusterRevision_1(); + ChipLogProgress(chipTool, " ***** Test Step 1 : Check on/off attribute value is true after on command\n"); + err = TestCheckOnOffAttributeValueIsTrueAfterOnCommand_1(); break; case 2: - ChipLogProgress(chipTool, " ***** Test Step 2 : reads back global attribute: ClusterRevision\n"); - err = TestReadsBackGlobalAttributeClusterRevision_2(); + ChipLogProgress(chipTool, " ***** Test Step 2 : Enhanced Move Hue Down command \n"); + err = TestEnhancedMoveHueDownCommand_2(); + break; + case 3: + ChipLogProgress(chipTool, " ***** Test Step 3 : Enhanced Move Hue Stop command\n"); + err = TestEnhancedMoveHueStopCommand_3(); + break; + case 4: + ChipLogProgress(chipTool, " ***** Test Step 4 : Enhanced Move Hue Up command\n"); + err = TestEnhancedMoveHueUpCommand_4(); + break; + case 5: + ChipLogProgress(chipTool, " ***** Test Step 5 : Enhanced Move Hue Stop command\n"); + err = TestEnhancedMoveHueStopCommand_5(); + break; + case 6: + ChipLogProgress(chipTool, " ***** Test Step 6 : Turn off light that we turned on\n"); + err = TestTurnOffLightThatWeTurnedOn_6(); + break; + case 7: + ChipLogProgress(chipTool, " ***** Test Step 7 : Check on/off attribute value is false after off command\n"); + err = TestCheckOnOffAttributeValueIsFalseAfterOffCommand_7(); break; } @@ -11478,212 +14313,224 @@ class Test_TC_TM_1_1 : public TestCommand private: std::atomic_uint16_t mTestIndex; - const uint16_t mTestCount = 3; + const uint16_t mTestCount = 8; chip::Callback::Callback mOnFailureCallback_0{ OnFailureCallback_0, this }; - chip::Callback::Callback mOnSuccessCallback_0{ OnSuccessCallback_0, this }; + chip::Callback::Callback mOnSuccessCallback_0{ OnSuccessCallback_0, this }; chip::Callback::Callback mOnFailureCallback_1{ OnFailureCallback_1, this }; - chip::Callback::Callback mOnSuccessCallback_1{ OnSuccessCallback_1, this }; + chip::Callback::Callback mOnSuccessCallback_1{ OnSuccessCallback_1, this }; chip::Callback::Callback mOnFailureCallback_2{ OnFailureCallback_2, this }; - chip::Callback::Callback mOnSuccessCallback_2{ OnSuccessCallback_2, this }; + chip::Callback::Callback mOnSuccessCallback_2{ OnSuccessCallback_2, this }; + chip::Callback::Callback mOnFailureCallback_3{ OnFailureCallback_3, this }; + chip::Callback::Callback mOnSuccessCallback_3{ OnSuccessCallback_3, this }; + chip::Callback::Callback mOnFailureCallback_4{ OnFailureCallback_4, this }; + chip::Callback::Callback mOnSuccessCallback_4{ OnSuccessCallback_4, this }; + chip::Callback::Callback mOnFailureCallback_5{ OnFailureCallback_5, this }; + chip::Callback::Callback mOnSuccessCallback_5{ OnSuccessCallback_5, this }; + chip::Callback::Callback mOnFailureCallback_6{ OnFailureCallback_6, this }; + chip::Callback::Callback mOnSuccessCallback_6{ OnSuccessCallback_6, this }; + chip::Callback::Callback mOnFailureCallback_7{ OnFailureCallback_7, this }; + chip::Callback::Callback mOnSuccessCallback_7{ OnSuccessCallback_7, this }; static void OnFailureCallback_0(void * context, uint8_t status) { - (static_cast(context))->OnFailureResponse_0(status); + (static_cast(context))->OnFailureResponse_0(status); } - static void OnSuccessCallback_0(void * context, uint16_t clusterRevision) - { - (static_cast(context))->OnSuccessResponse_0(clusterRevision); - } + static void OnSuccessCallback_0(void * context) { (static_cast(context))->OnSuccessResponse_0(); } static void OnFailureCallback_1(void * context, uint8_t status) { - (static_cast(context))->OnFailureResponse_1(status); + (static_cast(context))->OnFailureResponse_1(status); } - static void OnSuccessCallback_1(void * context, uint16_t clusterRevision) + static void OnSuccessCallback_1(void * context, bool onOff) { - (static_cast(context))->OnSuccessResponse_1(clusterRevision); + (static_cast(context))->OnSuccessResponse_1(onOff); } static void OnFailureCallback_2(void * context, uint8_t status) { - (static_cast(context))->OnFailureResponse_2(status); + (static_cast(context))->OnFailureResponse_2(status); } - static void OnSuccessCallback_2(void * context, uint16_t clusterRevision) + static void OnSuccessCallback_2(void * context) { (static_cast(context))->OnSuccessResponse_2(); } + + static void OnFailureCallback_3(void * context, uint8_t status) { - (static_cast(context))->OnSuccessResponse_2(clusterRevision); + (static_cast(context))->OnFailureResponse_3(status); } - // - // Tests methods - // + static void OnSuccessCallback_3(void * context) { (static_cast(context))->OnSuccessResponse_3(); } - CHIP_ERROR TestReadTheGlobalAttributeClusterRevision_0() + static void OnFailureCallback_4(void * context, uint8_t status) { - chip::Controller::TemperatureMeasurementClusterTest cluster; - cluster.Associate(mDevice, 1); - - return cluster.ReadAttributeClusterRevision(mOnSuccessCallback_0.Cancel(), mOnFailureCallback_0.Cancel()); + (static_cast(context))->OnFailureResponse_4(status); } - void OnFailureResponse_0(uint8_t status) { ThrowFailureResponse(); } + static void OnSuccessCallback_4(void * context) { (static_cast(context))->OnSuccessResponse_4(); } - void OnSuccessResponse_0(uint16_t clusterRevision) + static void OnFailureCallback_5(void * context, uint8_t status) { - VerifyOrReturn(CheckValue("clusterRevision", clusterRevision, 3U)); - NextTest(); + (static_cast(context))->OnFailureResponse_5(status); } - CHIP_ERROR TestWriteTheDefaultValuesToMandatoryGlobalAttributeClusterRevision_1() + static void OnSuccessCallback_5(void * context) { (static_cast(context))->OnSuccessResponse_5(); } + + static void OnFailureCallback_6(void * context, uint8_t status) { - chip::Controller::TemperatureMeasurementClusterTest cluster; - cluster.Associate(mDevice, 1); + (static_cast(context))->OnFailureResponse_6(status); + } - uint16_t clusterRevisionArgument = 3U; + static void OnSuccessCallback_6(void * context) { (static_cast(context))->OnSuccessResponse_6(); } - return cluster.WriteAttributeClusterRevision(mOnSuccessCallback_1.Cancel(), mOnFailureCallback_1.Cancel(), - clusterRevisionArgument); + static void OnFailureCallback_7(void * context, uint8_t status) + { + (static_cast(context))->OnFailureResponse_7(status); } - void OnFailureResponse_1(uint8_t status) { NextTest(); } + static void OnSuccessCallback_7(void * context, bool onOff) + { + (static_cast(context))->OnSuccessResponse_7(onOff); + } - void OnSuccessResponse_1(uint16_t clusterRevision) { ThrowSuccessResponse(); } + // + // Tests methods + // - CHIP_ERROR TestReadsBackGlobalAttributeClusterRevision_2() + CHIP_ERROR TestTurnOnLightForColorControlTests_0() { - chip::Controller::TemperatureMeasurementClusterTest cluster; + chip::Controller::OnOffClusterTest cluster; cluster.Associate(mDevice, 1); - return cluster.ReadAttributeClusterRevision(mOnSuccessCallback_2.Cancel(), mOnFailureCallback_2.Cancel()); + return cluster.On(mOnSuccessCallback_0.Cancel(), mOnFailureCallback_0.Cancel()); } - void OnFailureResponse_2(uint8_t status) { ThrowFailureResponse(); } + void OnFailureResponse_0(uint8_t status) { ThrowFailureResponse(); } - void OnSuccessResponse_2(uint16_t clusterRevision) + void OnSuccessResponse_0() { NextTest(); } + + CHIP_ERROR TestCheckOnOffAttributeValueIsTrueAfterOnCommand_1() { - VerifyOrReturn(CheckValue("clusterRevision", clusterRevision, 3U)); - NextTest(); + chip::Controller::OnOffClusterTest cluster; + cluster.Associate(mDevice, 1); + + return cluster.ReadAttributeOnOff(mOnSuccessCallback_1.Cancel(), mOnFailureCallback_1.Cancel()); } -}; -class Test_TC_OCC_1_1 : public TestCommand -{ -public: - Test_TC_OCC_1_1() : TestCommand("Test_TC_OCC_1_1"), mTestIndex(0) {} + void OnFailureResponse_1(uint8_t status) { ThrowFailureResponse(); } - /////////// TestCommand Interface ///////// - void NextTest() override + void OnSuccessResponse_1(bool onOff) { - CHIP_ERROR err = CHIP_NO_ERROR; - - if (0 == mTestIndex) - { - ChipLogProgress(chipTool, " **** Test Start: Test_TC_OCC_1_1\n"); - } + VerifyOrReturn(CheckValue("onOff", onOff, 1)); + NextTest(); + } - if (mTestCount == mTestIndex) - { - ChipLogProgress(chipTool, " **** Test Complete: Test_TC_OCC_1_1\n"); - SetCommandExitStatus(CHIP_NO_ERROR); - return; - } + CHIP_ERROR TestEnhancedMoveHueDownCommand_2() + { + chip::Controller::ColorControlClusterTest cluster; + cluster.Associate(mDevice, 1); - // Ensure we increment mTestIndex before we start running the relevant - // command. That way if we lose the timeslice after we send the message - // but before our function call returns, we won't end up with an - // incorrect mTestIndex value observed when we get the response. - switch (mTestIndex++) - { - case 0: - ChipLogProgress(chipTool, " ***** Test Step 0 : read the global attribute: ClusterRevision\n"); - err = TestReadTheGlobalAttributeClusterRevision_0(); - break; - case 1: - ChipLogProgress(chipTool, - " ***** Test Step 1 : write the default values to mandatory global attribute: ClusterRevision\n"); - err = TestWriteTheDefaultValuesToMandatoryGlobalAttributeClusterRevision_1(); - break; - } + uint8_t moveModeArgument = 3; + uint16_t rateArgument = 5U; + uint8_t optionsMaskArgument = 0; + uint8_t optionsOverrideArgument = 0; - if (CHIP_NO_ERROR != err) - { - ChipLogError(chipTool, " ***** Test Failure: %s\n", chip::ErrorStr(err)); - SetCommandExitStatus(err); - } + return cluster.EnhancedMoveHue(mOnSuccessCallback_2.Cancel(), mOnFailureCallback_2.Cancel(), moveModeArgument, rateArgument, + optionsMaskArgument, optionsOverrideArgument); } -private: - std::atomic_uint16_t mTestIndex; - const uint16_t mTestCount = 2; + void OnFailureResponse_2(uint8_t status) { ThrowFailureResponse(); } - chip::Callback::Callback mOnFailureCallback_0{ OnFailureCallback_0, this }; - chip::Callback::Callback mOnSuccessCallback_0{ OnSuccessCallback_0, this }; - chip::Callback::Callback mOnFailureCallback_1{ OnFailureCallback_1, this }; - chip::Callback::Callback mOnSuccessCallback_1{ OnSuccessCallback_1, this }; + void OnSuccessResponse_2() { NextTest(); } - static void OnFailureCallback_0(void * context, uint8_t status) + CHIP_ERROR TestEnhancedMoveHueStopCommand_3() { - (static_cast(context))->OnFailureResponse_0(status); - } + chip::Controller::ColorControlClusterTest cluster; + cluster.Associate(mDevice, 1); - static void OnSuccessCallback_0(void * context, uint16_t clusterRevision) - { - (static_cast(context))->OnSuccessResponse_0(clusterRevision); + uint8_t moveModeArgument = 0; + uint16_t rateArgument = 0U; + uint8_t optionsMaskArgument = 0; + uint8_t optionsOverrideArgument = 0; + + return cluster.EnhancedMoveHue(mOnSuccessCallback_3.Cancel(), mOnFailureCallback_3.Cancel(), moveModeArgument, rateArgument, + optionsMaskArgument, optionsOverrideArgument); } - static void OnFailureCallback_1(void * context, uint8_t status) + void OnFailureResponse_3(uint8_t status) { ThrowFailureResponse(); } + + void OnSuccessResponse_3() { NextTest(); } + + CHIP_ERROR TestEnhancedMoveHueUpCommand_4() { - (static_cast(context))->OnFailureResponse_1(status); + chip::Controller::ColorControlClusterTest cluster; + cluster.Associate(mDevice, 1); + + uint8_t moveModeArgument = 1; + uint16_t rateArgument = 50U; + uint8_t optionsMaskArgument = 0; + uint8_t optionsOverrideArgument = 0; + + return cluster.EnhancedMoveHue(mOnSuccessCallback_4.Cancel(), mOnFailureCallback_4.Cancel(), moveModeArgument, rateArgument, + optionsMaskArgument, optionsOverrideArgument); } - static void OnSuccessCallback_1(void * context, uint16_t clusterRevision) + void OnFailureResponse_4(uint8_t status) { ThrowFailureResponse(); } + + void OnSuccessResponse_4() { NextTest(); } + + CHIP_ERROR TestEnhancedMoveHueStopCommand_5() { - (static_cast(context))->OnSuccessResponse_1(clusterRevision); + chip::Controller::ColorControlClusterTest cluster; + cluster.Associate(mDevice, 1); + + uint8_t moveModeArgument = 0; + uint16_t rateArgument = 0U; + uint8_t optionsMaskArgument = 0; + uint8_t optionsOverrideArgument = 0; + + return cluster.EnhancedMoveHue(mOnSuccessCallback_5.Cancel(), mOnFailureCallback_5.Cancel(), moveModeArgument, rateArgument, + optionsMaskArgument, optionsOverrideArgument); } - // - // Tests methods - // + void OnFailureResponse_5(uint8_t status) { ThrowFailureResponse(); } - CHIP_ERROR TestReadTheGlobalAttributeClusterRevision_0() + void OnSuccessResponse_5() { NextTest(); } + + CHIP_ERROR TestTurnOffLightThatWeTurnedOn_6() { - chip::Controller::OccupancySensingClusterTest cluster; + chip::Controller::OnOffClusterTest cluster; cluster.Associate(mDevice, 1); - return cluster.ReadAttributeClusterRevision(mOnSuccessCallback_0.Cancel(), mOnFailureCallback_0.Cancel()); + return cluster.Off(mOnSuccessCallback_6.Cancel(), mOnFailureCallback_6.Cancel()); } - void OnFailureResponse_0(uint8_t status) { ThrowFailureResponse(); } + void OnFailureResponse_6(uint8_t status) { ThrowFailureResponse(); } - void OnSuccessResponse_0(uint16_t clusterRevision) - { - VerifyOrReturn(CheckValue("clusterRevision", clusterRevision, 2U)); - NextTest(); - } + void OnSuccessResponse_6() { NextTest(); } - CHIP_ERROR TestWriteTheDefaultValuesToMandatoryGlobalAttributeClusterRevision_1() + CHIP_ERROR TestCheckOnOffAttributeValueIsFalseAfterOffCommand_7() { - chip::Controller::OccupancySensingClusterTest cluster; + chip::Controller::OnOffClusterTest cluster; cluster.Associate(mDevice, 1); - uint16_t clusterRevisionArgument = 2U; - - return cluster.WriteAttributeClusterRevision(mOnSuccessCallback_1.Cancel(), mOnFailureCallback_1.Cancel(), - clusterRevisionArgument); + return cluster.ReadAttributeOnOff(mOnSuccessCallback_7.Cancel(), mOnFailureCallback_7.Cancel()); } - void OnFailureResponse_1(uint8_t status) { NextTest(); } + void OnFailureResponse_7(uint8_t status) { ThrowFailureResponse(); } - void OnSuccessResponse_1(uint16_t clusterRevision) { ThrowSuccessResponse(); } + void OnSuccessResponse_7(bool onOff) + { + VerifyOrReturn(CheckValue("onOff", onOff, 0)); + NextTest(); + } }; -class TestOperationalCredentialsCluster : public TestCommand +class Test_TC_CC_7_3 : public TestCommand { public: - TestOperationalCredentialsCluster() : TestCommand("TestOperationalCredentialsCluster"), mTestIndex(0) {} + Test_TC_CC_7_3() : TestCommand("Test_TC_CC_7_3"), mTestIndex(0) {} /////////// TestCommand Interface ///////// void NextTest() override @@ -11692,12 +14539,12 @@ class TestOperationalCredentialsCluster : public TestCommand if (0 == mTestIndex) { - ChipLogProgress(chipTool, " **** Test Start: TestOperationalCredentialsCluster\n"); + ChipLogProgress(chipTool, " **** Test Start: Test_TC_CC_7_3\n"); } if (mTestCount == mTestIndex) { - ChipLogProgress(chipTool, " **** Test Complete: TestOperationalCredentialsCluster\n"); + ChipLogProgress(chipTool, " **** Test Complete: Test_TC_CC_7_3\n"); SetCommandExitStatus(CHIP_NO_ERROR); return; } @@ -11709,12 +14556,28 @@ class TestOperationalCredentialsCluster : public TestCommand switch (mTestIndex++) { case 0: - ChipLogProgress(chipTool, " ***** Test Step 0 : Read number of supported fabrics\n"); - err = TestReadNumberOfSupportedFabrics_0(); + ChipLogProgress(chipTool, " ***** Test Step 0 : Turn on light for color control tests\n"); + err = TestTurnOnLightForColorControlTests_0(); break; case 1: - ChipLogProgress(chipTool, " ***** Test Step 1 : Read number of commissioned fabrics\n"); - err = TestReadNumberOfCommissionedFabrics_1(); + ChipLogProgress(chipTool, " ***** Test Step 1 : Check on/off attribute value is true after on command\n"); + err = TestCheckOnOffAttributeValueIsTrueAfterOnCommand_1(); + break; + case 2: + ChipLogProgress(chipTool, " ***** Test Step 2 : Enhanced Step Hue Up command\n"); + err = TestEnhancedStepHueUpCommand_2(); + break; + case 3: + ChipLogProgress(chipTool, " ***** Test Step 3 : Enhanced Step Hue Down command\n"); + err = TestEnhancedStepHueDownCommand_3(); + break; + case 4: + ChipLogProgress(chipTool, " ***** Test Step 4 : Turn off light that we turned on\n"); + err = TestTurnOffLightThatWeTurnedOn_4(); + break; + case 5: + ChipLogProgress(chipTool, " ***** Test Step 5 : Check on/off attribute value is false after off command\n"); + err = TestCheckOnOffAttributeValueIsFalseAfterOffCommand_5(); break; } @@ -11727,235 +14590,172 @@ class TestOperationalCredentialsCluster : public TestCommand private: std::atomic_uint16_t mTestIndex; - const uint16_t mTestCount = 2; + const uint16_t mTestCount = 6; chip::Callback::Callback mOnFailureCallback_0{ OnFailureCallback_0, this }; - chip::Callback::Callback mOnSuccessCallback_0{ OnSuccessCallback_0, this }; + chip::Callback::Callback mOnSuccessCallback_0{ OnSuccessCallback_0, this }; chip::Callback::Callback mOnFailureCallback_1{ OnFailureCallback_1, this }; - chip::Callback::Callback mOnSuccessCallback_1{ OnSuccessCallback_1, - this }; + chip::Callback::Callback mOnSuccessCallback_1{ OnSuccessCallback_1, this }; + chip::Callback::Callback mOnFailureCallback_2{ OnFailureCallback_2, this }; + chip::Callback::Callback mOnSuccessCallback_2{ OnSuccessCallback_2, this }; + chip::Callback::Callback mOnFailureCallback_3{ OnFailureCallback_3, this }; + chip::Callback::Callback mOnSuccessCallback_3{ OnSuccessCallback_3, this }; + chip::Callback::Callback mOnFailureCallback_4{ OnFailureCallback_4, this }; + chip::Callback::Callback mOnSuccessCallback_4{ OnSuccessCallback_4, this }; + chip::Callback::Callback mOnFailureCallback_5{ OnFailureCallback_5, this }; + chip::Callback::Callback mOnSuccessCallback_5{ OnSuccessCallback_5, this }; static void OnFailureCallback_0(void * context, uint8_t status) { - (static_cast(context))->OnFailureResponse_0(status); + (static_cast(context))->OnFailureResponse_0(status); } - static void OnSuccessCallback_0(void * context, uint8_t supportedFabrics) - { - (static_cast(context))->OnSuccessResponse_0(supportedFabrics); - } + static void OnSuccessCallback_0(void * context) { (static_cast(context))->OnSuccessResponse_0(); } static void OnFailureCallback_1(void * context, uint8_t status) { - (static_cast(context))->OnFailureResponse_1(status); + (static_cast(context))->OnFailureResponse_1(status); } - static void OnSuccessCallback_1(void * context, uint8_t commissionedFabrics) + static void OnSuccessCallback_1(void * context, bool onOff) { - (static_cast(context))->OnSuccessResponse_1(commissionedFabrics); + (static_cast(context))->OnSuccessResponse_1(onOff); } - // - // Tests methods - // - - CHIP_ERROR TestReadNumberOfSupportedFabrics_0() + static void OnFailureCallback_2(void * context, uint8_t status) { - chip::Controller::OperationalCredentialsClusterTest cluster; - cluster.Associate(mDevice, 0); - - return cluster.ReadAttributeSupportedFabrics(mOnSuccessCallback_0.Cancel(), mOnFailureCallback_0.Cancel()); + (static_cast(context))->OnFailureResponse_2(status); } - void OnFailureResponse_0(uint8_t status) { ThrowFailureResponse(); } + static void OnSuccessCallback_2(void * context) { (static_cast(context))->OnSuccessResponse_2(); } - void OnSuccessResponse_0(uint8_t supportedFabrics) + static void OnFailureCallback_3(void * context, uint8_t status) { - VerifyOrReturn(CheckConstraintType("supportedFabrics", "", "uint8")); - VerifyOrReturn(CheckConstraintMinValue("supportedFabrics", supportedFabrics, 4)); - NextTest(); + (static_cast(context))->OnFailureResponse_3(status); } - CHIP_ERROR TestReadNumberOfCommissionedFabrics_1() - { - chip::Controller::OperationalCredentialsClusterTest cluster; - cluster.Associate(mDevice, 0); + static void OnSuccessCallback_3(void * context) { (static_cast(context))->OnSuccessResponse_3(); } - return cluster.ReadAttributeCommissionedFabrics(mOnSuccessCallback_1.Cancel(), mOnFailureCallback_1.Cancel()); + static void OnFailureCallback_4(void * context, uint8_t status) + { + (static_cast(context))->OnFailureResponse_4(status); } - void OnFailureResponse_1(uint8_t status) { ThrowFailureResponse(); } + static void OnSuccessCallback_4(void * context) { (static_cast(context))->OnSuccessResponse_4(); } - void OnSuccessResponse_1(uint8_t commissionedFabrics) + static void OnFailureCallback_5(void * context, uint8_t status) { - VerifyOrReturn(CheckConstraintType("commissionedFabrics", "", "uint8")); - VerifyOrReturn(CheckConstraintMinValue("commissionedFabrics", commissionedFabrics, 1)); - NextTest(); + (static_cast(context))->OnFailureResponse_5(status); } -}; - -class Test_TC_LVL_1_1 : public TestCommand -{ -public: - Test_TC_LVL_1_1() : TestCommand("Test_TC_LVL_1_1"), mTestIndex(0) {} - /////////// TestCommand Interface ///////// - void NextTest() override + static void OnSuccessCallback_5(void * context, bool onOff) { - CHIP_ERROR err = CHIP_NO_ERROR; - - if (0 == mTestIndex) - { - ChipLogProgress(chipTool, " **** Test Start: Test_TC_LVL_1_1\n"); - } + (static_cast(context))->OnSuccessResponse_5(onOff); + } - if (mTestCount == mTestIndex) - { - ChipLogProgress(chipTool, " **** Test Complete: Test_TC_LVL_1_1\n"); - SetCommandExitStatus(CHIP_NO_ERROR); - return; - } + // + // Tests methods + // - // Ensure we increment mTestIndex before we start running the relevant - // command. That way if we lose the timeslice after we send the message - // but before our function call returns, we won't end up with an - // incorrect mTestIndex value observed when we get the response. - switch (mTestIndex++) - { - case 0: - ChipLogProgress(chipTool, - " ***** Test Step 0 : write the default values to mandatory global attribute: ClusterRevision\n"); - err = TestWriteTheDefaultValuesToMandatoryGlobalAttributeClusterRevision_0(); - break; - } + CHIP_ERROR TestTurnOnLightForColorControlTests_0() + { + chip::Controller::OnOffClusterTest cluster; + cluster.Associate(mDevice, 1); - if (CHIP_NO_ERROR != err) - { - ChipLogError(chipTool, " ***** Test Failure: %s\n", chip::ErrorStr(err)); - SetCommandExitStatus(err); - } + return cluster.On(mOnSuccessCallback_0.Cancel(), mOnFailureCallback_0.Cancel()); } -private: - std::atomic_uint16_t mTestIndex; - const uint16_t mTestCount = 1; + void OnFailureResponse_0(uint8_t status) { ThrowFailureResponse(); } - chip::Callback::Callback mOnFailureCallback_0{ OnFailureCallback_0, this }; - chip::Callback::Callback mOnSuccessCallback_0{ OnSuccessCallback_0, this }; + void OnSuccessResponse_0() { NextTest(); } - static void OnFailureCallback_0(void * context, uint8_t status) + CHIP_ERROR TestCheckOnOffAttributeValueIsTrueAfterOnCommand_1() { - (static_cast(context))->OnFailureResponse_0(status); + chip::Controller::OnOffClusterTest cluster; + cluster.Associate(mDevice, 1); + + return cluster.ReadAttributeOnOff(mOnSuccessCallback_1.Cancel(), mOnFailureCallback_1.Cancel()); } - static void OnSuccessCallback_0(void * context, uint16_t clusterRevision) + void OnFailureResponse_1(uint8_t status) { ThrowFailureResponse(); } + + void OnSuccessResponse_1(bool onOff) { - (static_cast(context))->OnSuccessResponse_0(clusterRevision); + VerifyOrReturn(CheckValue("onOff", onOff, 1)); + NextTest(); } - // - // Tests methods - // - - CHIP_ERROR TestWriteTheDefaultValuesToMandatoryGlobalAttributeClusterRevision_0() + CHIP_ERROR TestEnhancedStepHueUpCommand_2() { - chip::Controller::LevelControlClusterTest cluster; + chip::Controller::ColorControlClusterTest cluster; cluster.Associate(mDevice, 1); - uint16_t clusterRevisionArgument = 4U; + uint8_t stepModeArgument = 0; + uint16_t stepSizeArgument = 50U; + uint16_t transitionTimeArgument = 1U; + uint8_t optionsMaskArgument = 0; + uint8_t optionsOverrideArgument = 0; - return cluster.WriteAttributeClusterRevision(mOnSuccessCallback_0.Cancel(), mOnFailureCallback_0.Cancel(), - clusterRevisionArgument); + return cluster.EnhancedStepHue(mOnSuccessCallback_2.Cancel(), mOnFailureCallback_2.Cancel(), stepModeArgument, + stepSizeArgument, transitionTimeArgument, optionsMaskArgument, optionsOverrideArgument); } - void OnFailureResponse_0(uint8_t status) { NextTest(); } - - void OnSuccessResponse_0(uint16_t clusterRevision) { ThrowSuccessResponse(); } -}; + void OnFailureResponse_2(uint8_t status) { ThrowFailureResponse(); } -class Test_TC_CC_1_1 : public TestCommand -{ -public: - Test_TC_CC_1_1() : TestCommand("Test_TC_CC_1_1"), mTestIndex(0) {} + void OnSuccessResponse_2() { NextTest(); } - /////////// TestCommand Interface ///////// - void NextTest() override + CHIP_ERROR TestEnhancedStepHueDownCommand_3() { - CHIP_ERROR err = CHIP_NO_ERROR; - - if (0 == mTestIndex) - { - ChipLogProgress(chipTool, " **** Test Start: Test_TC_CC_1_1\n"); - } - - if (mTestCount == mTestIndex) - { - ChipLogProgress(chipTool, " **** Test Complete: Test_TC_CC_1_1\n"); - SetCommandExitStatus(CHIP_NO_ERROR); - return; - } + chip::Controller::ColorControlClusterTest cluster; + cluster.Associate(mDevice, 1); - // Ensure we increment mTestIndex before we start running the relevant - // command. That way if we lose the timeslice after we send the message - // but before our function call returns, we won't end up with an - // incorrect mTestIndex value observed when we get the response. - switch (mTestIndex++) - { - case 0: - ChipLogProgress(chipTool, - " ***** Test Step 0 : write the default values to mandatory global attribute: ClusterRevision\n"); - err = TestWriteTheDefaultValuesToMandatoryGlobalAttributeClusterRevision_0(); - break; - } + uint8_t stepModeArgument = 1; + uint16_t stepSizeArgument = 75U; + uint16_t transitionTimeArgument = 1U; + uint8_t optionsMaskArgument = 0; + uint8_t optionsOverrideArgument = 0; - if (CHIP_NO_ERROR != err) - { - ChipLogError(chipTool, " ***** Test Failure: %s\n", chip::ErrorStr(err)); - SetCommandExitStatus(err); - } + return cluster.EnhancedStepHue(mOnSuccessCallback_3.Cancel(), mOnFailureCallback_3.Cancel(), stepModeArgument, + stepSizeArgument, transitionTimeArgument, optionsMaskArgument, optionsOverrideArgument); } -private: - std::atomic_uint16_t mTestIndex; - const uint16_t mTestCount = 1; + void OnFailureResponse_3(uint8_t status) { ThrowFailureResponse(); } - chip::Callback::Callback mOnFailureCallback_0{ OnFailureCallback_0, this }; - chip::Callback::Callback mOnSuccessCallback_0{ OnSuccessCallback_0, this }; + void OnSuccessResponse_3() { NextTest(); } - static void OnFailureCallback_0(void * context, uint8_t status) + CHIP_ERROR TestTurnOffLightThatWeTurnedOn_4() { - (static_cast(context))->OnFailureResponse_0(status); - } + chip::Controller::OnOffClusterTest cluster; + cluster.Associate(mDevice, 1); - static void OnSuccessCallback_0(void * context, uint16_t clusterRevision) - { - (static_cast(context))->OnSuccessResponse_0(clusterRevision); + return cluster.Off(mOnSuccessCallback_4.Cancel(), mOnFailureCallback_4.Cancel()); } - // - // Tests methods - // + void OnFailureResponse_4(uint8_t status) { ThrowFailureResponse(); } + + void OnSuccessResponse_4() { NextTest(); } - CHIP_ERROR TestWriteTheDefaultValuesToMandatoryGlobalAttributeClusterRevision_0() + CHIP_ERROR TestCheckOnOffAttributeValueIsFalseAfterOffCommand_5() { - chip::Controller::ColorControlClusterTest cluster; + chip::Controller::OnOffClusterTest cluster; cluster.Associate(mDevice, 1); - uint16_t clusterRevisionArgument = 4U; - - return cluster.WriteAttributeClusterRevision(mOnSuccessCallback_0.Cancel(), mOnFailureCallback_0.Cancel(), - clusterRevisionArgument); + return cluster.ReadAttributeOnOff(mOnSuccessCallback_5.Cancel(), mOnFailureCallback_5.Cancel()); } - void OnFailureResponse_0(uint8_t status) { NextTest(); } + void OnFailureResponse_5(uint8_t status) { ThrowFailureResponse(); } - void OnSuccessResponse_0(uint16_t clusterRevision) { ThrowSuccessResponse(); } + void OnSuccessResponse_5(bool onOff) + { + VerifyOrReturn(CheckValue("onOff", onOff, 0)); + NextTest(); + } }; -class Test_TC_RH_1_1 : public TestCommand +class Test_TC_CC_7_4 : public TestCommand { public: - Test_TC_RH_1_1() : TestCommand("Test_TC_RH_1_1"), mTestIndex(0) {} + Test_TC_CC_7_4() : TestCommand("Test_TC_CC_7_4"), mTestIndex(0) {} /////////// TestCommand Interface ///////// void NextTest() override @@ -11964,12 +14764,12 @@ class Test_TC_RH_1_1 : public TestCommand if (0 == mTestIndex) { - ChipLogProgress(chipTool, " **** Test Start: Test_TC_RH_1_1\n"); + ChipLogProgress(chipTool, " **** Test Start: Test_TC_CC_7_4\n"); } if (mTestCount == mTestIndex) { - ChipLogProgress(chipTool, " **** Test Complete: Test_TC_RH_1_1\n"); + ChipLogProgress(chipTool, " **** Test Complete: Test_TC_CC_7_4\n"); SetCommandExitStatus(CHIP_NO_ERROR); return; } @@ -11981,9 +14781,24 @@ class Test_TC_RH_1_1 : public TestCommand switch (mTestIndex++) { case 0: - ChipLogProgress(chipTool, - " ***** Test Step 0 : write the default values to mandatory global attribute: ClusterRevision\n"); - err = TestWriteTheDefaultValuesToMandatoryGlobalAttributeClusterRevision_0(); + ChipLogProgress(chipTool, " ***** Test Step 0 : Turn on light for color control tests\n"); + err = TestTurnOnLightForColorControlTests_0(); + break; + case 1: + ChipLogProgress(chipTool, " ***** Test Step 1 : Check on/off attribute value is true after on command\n"); + err = TestCheckOnOffAttributeValueIsTrueAfterOnCommand_1(); + break; + case 2: + ChipLogProgress(chipTool, " ***** Test Step 2 : Enhanced move to hue and saturation command\n"); + err = TestEnhancedMoveToHueAndSaturationCommand_2(); + break; + case 3: + ChipLogProgress(chipTool, " ***** Test Step 3 : Turn off light that we turned on\n"); + err = TestTurnOffLightThatWeTurnedOn_3(); + break; + case 4: + ChipLogProgress(chipTool, " ***** Test Step 4 : Check on/off attribute value is false after off command\n"); + err = TestCheckOnOffAttributeValueIsFalseAfterOffCommand_4(); break; } @@ -11996,45 +14811,145 @@ class Test_TC_RH_1_1 : public TestCommand private: std::atomic_uint16_t mTestIndex; - const uint16_t mTestCount = 1; + const uint16_t mTestCount = 5; chip::Callback::Callback mOnFailureCallback_0{ OnFailureCallback_0, this }; - chip::Callback::Callback mOnSuccessCallback_0{ OnSuccessCallback_0, this }; + chip::Callback::Callback mOnSuccessCallback_0{ OnSuccessCallback_0, this }; + chip::Callback::Callback mOnFailureCallback_1{ OnFailureCallback_1, this }; + chip::Callback::Callback mOnSuccessCallback_1{ OnSuccessCallback_1, this }; + chip::Callback::Callback mOnFailureCallback_2{ OnFailureCallback_2, this }; + chip::Callback::Callback mOnSuccessCallback_2{ OnSuccessCallback_2, this }; + chip::Callback::Callback mOnFailureCallback_3{ OnFailureCallback_3, this }; + chip::Callback::Callback mOnSuccessCallback_3{ OnSuccessCallback_3, this }; + chip::Callback::Callback mOnFailureCallback_4{ OnFailureCallback_4, this }; + chip::Callback::Callback mOnSuccessCallback_4{ OnSuccessCallback_4, this }; static void OnFailureCallback_0(void * context, uint8_t status) { - (static_cast(context))->OnFailureResponse_0(status); + (static_cast(context))->OnFailureResponse_0(status); } - static void OnSuccessCallback_0(void * context, uint16_t clusterRevision) + static void OnSuccessCallback_0(void * context) { (static_cast(context))->OnSuccessResponse_0(); } + + static void OnFailureCallback_1(void * context, uint8_t status) { - (static_cast(context))->OnSuccessResponse_0(clusterRevision); + (static_cast(context))->OnFailureResponse_1(status); + } + + static void OnSuccessCallback_1(void * context, bool onOff) + { + (static_cast(context))->OnSuccessResponse_1(onOff); + } + + static void OnFailureCallback_2(void * context, uint8_t status) + { + (static_cast(context))->OnFailureResponse_2(status); + } + + static void OnSuccessCallback_2(void * context) { (static_cast(context))->OnSuccessResponse_2(); } + + static void OnFailureCallback_3(void * context, uint8_t status) + { + (static_cast(context))->OnFailureResponse_3(status); + } + + static void OnSuccessCallback_3(void * context) { (static_cast(context))->OnSuccessResponse_3(); } + + static void OnFailureCallback_4(void * context, uint8_t status) + { + (static_cast(context))->OnFailureResponse_4(status); + } + + static void OnSuccessCallback_4(void * context, bool onOff) + { + (static_cast(context))->OnSuccessResponse_4(onOff); } // // Tests methods // - CHIP_ERROR TestWriteTheDefaultValuesToMandatoryGlobalAttributeClusterRevision_0() + CHIP_ERROR TestTurnOnLightForColorControlTests_0() { - chip::Controller::RelativeHumidityMeasurementClusterTest cluster; + chip::Controller::OnOffClusterTest cluster; cluster.Associate(mDevice, 1); - uint16_t clusterRevisionArgument = 1U; + return cluster.On(mOnSuccessCallback_0.Cancel(), mOnFailureCallback_0.Cancel()); + } - return cluster.WriteAttributeClusterRevision(mOnSuccessCallback_0.Cancel(), mOnFailureCallback_0.Cancel(), - clusterRevisionArgument); + void OnFailureResponse_0(uint8_t status) { ThrowFailureResponse(); } + + void OnSuccessResponse_0() { NextTest(); } + + CHIP_ERROR TestCheckOnOffAttributeValueIsTrueAfterOnCommand_1() + { + chip::Controller::OnOffClusterTest cluster; + cluster.Associate(mDevice, 1); + + return cluster.ReadAttributeOnOff(mOnSuccessCallback_1.Cancel(), mOnFailureCallback_1.Cancel()); } - void OnFailureResponse_0(uint8_t status) { NextTest(); } + void OnFailureResponse_1(uint8_t status) { ThrowFailureResponse(); } - void OnSuccessResponse_0(uint16_t clusterRevision) { ThrowSuccessResponse(); } + void OnSuccessResponse_1(bool onOff) + { + VerifyOrReturn(CheckValue("onOff", onOff, 1)); + NextTest(); + } + + CHIP_ERROR TestEnhancedMoveToHueAndSaturationCommand_2() + { + chip::Controller::ColorControlClusterTest cluster; + cluster.Associate(mDevice, 1); + + uint16_t enhancedHueArgument = 1200U; + uint8_t saturationArgument = 90; + uint16_t transitionTimeArgument = 10U; + uint8_t optionsMaskArgument = 0; + uint8_t optionsOverrideArgument = 0; + + return cluster.EnhancedMoveToHueAndSaturation(mOnSuccessCallback_2.Cancel(), mOnFailureCallback_2.Cancel(), + enhancedHueArgument, saturationArgument, transitionTimeArgument, + optionsMaskArgument, optionsOverrideArgument); + } + + void OnFailureResponse_2(uint8_t status) { ThrowFailureResponse(); } + + void OnSuccessResponse_2() { NextTest(); } + + CHIP_ERROR TestTurnOffLightThatWeTurnedOn_3() + { + chip::Controller::OnOffClusterTest cluster; + cluster.Associate(mDevice, 1); + + return cluster.Off(mOnSuccessCallback_3.Cancel(), mOnFailureCallback_3.Cancel()); + } + + void OnFailureResponse_3(uint8_t status) { ThrowFailureResponse(); } + + void OnSuccessResponse_3() { NextTest(); } + + CHIP_ERROR TestCheckOnOffAttributeValueIsFalseAfterOffCommand_4() + { + chip::Controller::OnOffClusterTest cluster; + cluster.Associate(mDevice, 1); + + return cluster.ReadAttributeOnOff(mOnSuccessCallback_4.Cancel(), mOnFailureCallback_4.Cancel()); + } + + void OnFailureResponse_4(uint8_t status) { ThrowFailureResponse(); } + + void OnSuccessResponse_4(bool onOff) + { + VerifyOrReturn(CheckValue("onOff", onOff, 0)); + NextTest(); + } }; -class Test_TC_MC_1_1 : public TestCommand +class Test_TC_CC_8_1 : public TestCommand { public: - Test_TC_MC_1_1() : TestCommand("Test_TC_MC_1_1"), mTestIndex(0) {} + Test_TC_CC_8_1() : TestCommand("Test_TC_CC_8_1"), mTestIndex(0) {} /////////// TestCommand Interface ///////// void NextTest() override @@ -12043,12 +14958,12 @@ class Test_TC_MC_1_1 : public TestCommand if (0 == mTestIndex) { - ChipLogProgress(chipTool, " **** Test Start: Test_TC_MC_1_1\n"); + ChipLogProgress(chipTool, " **** Test Start: Test_TC_CC_8_1\n"); } if (mTestCount == mTestIndex) { - ChipLogProgress(chipTool, " **** Test Complete: Test_TC_MC_1_1\n"); + ChipLogProgress(chipTool, " **** Test Complete: Test_TC_CC_8_1\n"); SetCommandExitStatus(CHIP_NO_ERROR); return; } @@ -12060,9 +14975,68 @@ class Test_TC_MC_1_1 : public TestCommand switch (mTestIndex++) { case 0: - ChipLogProgress(chipTool, - " ***** Test Step 0 : write the default values to mandatory global attribute: ClusterRevision\n"); - err = TestWriteTheDefaultValuesToMandatoryGlobalAttributeClusterRevision_0(); + ChipLogProgress(chipTool, " ***** Test Step 0 : Turn on light for color control tests\n"); + err = TestTurnOnLightForColorControlTests_0(); + break; + case 1: + ChipLogProgress(chipTool, " ***** Test Step 1 : Check on/off attribute value is true after on command\n"); + err = TestCheckOnOffAttributeValueIsTrueAfterOnCommand_1(); + break; + case 2: + ChipLogProgress(chipTool, " ***** Test Step 2 : Color Loop Set Command - Set all Attributs\n"); + err = TestColorLoopSetCommandSetAllAttributs_2(); + break; + case 3: + ChipLogProgress(chipTool, " ***** Test Step 3 : Check ColorLoopDirection Value\n"); + err = TestCheckColorLoopDirectionValue_3(); + break; + case 4: + ChipLogProgress(chipTool, " ***** Test Step 4 : Check ColorLoopTime Value\n"); + err = TestCheckColorLoopTimeValue_4(); + break; + case 5: + ChipLogProgress(chipTool, " ***** Test Step 5 : Check ColorLoopStartEnhancedHue Value\n"); + err = TestCheckColorLoopStartEnhancedHueValue_5(); + break; + case 6: + ChipLogProgress(chipTool, " ***** Test Step 6 : Check ColorLoopActive Value\n"); + err = TestCheckColorLoopActiveValue_6(); + break; + case 7: + ChipLogProgress(chipTool, " ***** Test Step 7 : Color Loop Set Command - Start Color Loop\n"); + err = TestColorLoopSetCommandStartColorLoop_7(); + break; + case 8: + ChipLogProgress(chipTool, " ***** Test Step 8 : Check ColorLoopActive Value\n"); + err = TestCheckColorLoopActiveValue_8(); + break; + case 9: + ChipLogProgress(chipTool, " ***** Test Step 9 : Color Loop Set Command - Set direction and time while running\n"); + err = TestColorLoopSetCommandSetDirectionAndTimeWhileRunning_9(); + break; + case 10: + ChipLogProgress(chipTool, " ***** Test Step 10 : Check ColorLoopDirection Value\n"); + err = TestCheckColorLoopDirectionValue_10(); + break; + case 11: + ChipLogProgress(chipTool, " ***** Test Step 11 : Check ColorLoopTime Value\n"); + err = TestCheckColorLoopTimeValue_11(); + break; + case 12: + ChipLogProgress(chipTool, " ***** Test Step 12 : Color Loop Set Command - Set direction while running\n"); + err = TestColorLoopSetCommandSetDirectionWhileRunning_12(); + break; + case 13: + ChipLogProgress(chipTool, " ***** Test Step 13 : Check ColorLoopDirection Value\n"); + err = TestCheckColorLoopDirectionValue_13(); + break; + case 14: + ChipLogProgress(chipTool, " ***** Test Step 14 : Turn off light that we turned on\n"); + err = TestTurnOffLightThatWeTurnedOn_14(); + break; + case 15: + ChipLogProgress(chipTool, " ***** Test Step 15 : Check on/off attribute value is false after off command\n"); + err = TestCheckOnOffAttributeValueIsFalseAfterOffCommand_15(); break; } @@ -12075,417 +15049,461 @@ class Test_TC_MC_1_1 : public TestCommand private: std::atomic_uint16_t mTestIndex; - const uint16_t mTestCount = 1; + const uint16_t mTestCount = 16; chip::Callback::Callback mOnFailureCallback_0{ OnFailureCallback_0, this }; - chip::Callback::Callback mOnSuccessCallback_0{ OnSuccessCallback_0, this }; + chip::Callback::Callback mOnSuccessCallback_0{ OnSuccessCallback_0, this }; + chip::Callback::Callback mOnFailureCallback_1{ OnFailureCallback_1, this }; + chip::Callback::Callback mOnSuccessCallback_1{ OnSuccessCallback_1, this }; + chip::Callback::Callback mOnFailureCallback_2{ OnFailureCallback_2, this }; + chip::Callback::Callback mOnSuccessCallback_2{ OnSuccessCallback_2, this }; + chip::Callback::Callback mOnFailureCallback_3{ OnFailureCallback_3, this }; + chip::Callback::Callback mOnSuccessCallback_3{ OnSuccessCallback_3, + this }; + chip::Callback::Callback mOnFailureCallback_4{ OnFailureCallback_4, this }; + chip::Callback::Callback mOnSuccessCallback_4{ OnSuccessCallback_4, this }; + chip::Callback::Callback mOnFailureCallback_5{ OnFailureCallback_5, this }; + chip::Callback::Callback mOnSuccessCallback_5{ + OnSuccessCallback_5, this + }; + chip::Callback::Callback mOnFailureCallback_6{ OnFailureCallback_6, this }; + chip::Callback::Callback mOnSuccessCallback_6{ OnSuccessCallback_6, this }; + chip::Callback::Callback mOnFailureCallback_7{ OnFailureCallback_7, this }; + chip::Callback::Callback mOnSuccessCallback_7{ OnSuccessCallback_7, this }; + chip::Callback::Callback mOnFailureCallback_8{ OnFailureCallback_8, this }; + chip::Callback::Callback mOnSuccessCallback_8{ OnSuccessCallback_8, this }; + chip::Callback::Callback mOnFailureCallback_9{ OnFailureCallback_9, this }; + chip::Callback::Callback mOnSuccessCallback_9{ OnSuccessCallback_9, this }; + chip::Callback::Callback mOnFailureCallback_10{ OnFailureCallback_10, this }; + chip::Callback::Callback mOnSuccessCallback_10{ OnSuccessCallback_10, + this }; + chip::Callback::Callback mOnFailureCallback_11{ OnFailureCallback_11, this }; + chip::Callback::Callback mOnSuccessCallback_11{ OnSuccessCallback_11, this }; + chip::Callback::Callback mOnFailureCallback_12{ OnFailureCallback_12, this }; + chip::Callback::Callback mOnSuccessCallback_12{ OnSuccessCallback_12, this }; + chip::Callback::Callback mOnFailureCallback_13{ OnFailureCallback_13, this }; + chip::Callback::Callback mOnSuccessCallback_13{ OnSuccessCallback_13, + this }; + chip::Callback::Callback mOnFailureCallback_14{ OnFailureCallback_14, this }; + chip::Callback::Callback mOnSuccessCallback_14{ OnSuccessCallback_14, this }; + chip::Callback::Callback mOnFailureCallback_15{ OnFailureCallback_15, this }; + chip::Callback::Callback mOnSuccessCallback_15{ OnSuccessCallback_15, this }; static void OnFailureCallback_0(void * context, uint8_t status) { - (static_cast(context))->OnFailureResponse_0(status); + (static_cast(context))->OnFailureResponse_0(status); + } + + static void OnSuccessCallback_0(void * context) { (static_cast(context))->OnSuccessResponse_0(); } + + static void OnFailureCallback_1(void * context, uint8_t status) + { + (static_cast(context))->OnFailureResponse_1(status); } - static void OnSuccessCallback_0(void * context, uint16_t clusterRevision) + static void OnSuccessCallback_1(void * context, bool onOff) { - (static_cast(context))->OnSuccessResponse_0(clusterRevision); + (static_cast(context))->OnSuccessResponse_1(onOff); } - // - // Tests methods - // - - CHIP_ERROR TestWriteTheDefaultValuesToMandatoryGlobalAttributeClusterRevision_0() + static void OnFailureCallback_2(void * context, uint8_t status) { - chip::Controller::RelativeHumidityMeasurementClusterTest cluster; - cluster.Associate(mDevice, 1); + (static_cast(context))->OnFailureResponse_2(status); + } - uint16_t clusterRevisionArgument = 1U; + static void OnSuccessCallback_2(void * context) { (static_cast(context))->OnSuccessResponse_2(); } - return cluster.WriteAttributeClusterRevision(mOnSuccessCallback_0.Cancel(), mOnFailureCallback_0.Cancel(), - clusterRevisionArgument); + static void OnFailureCallback_3(void * context, uint8_t status) + { + (static_cast(context))->OnFailureResponse_3(status); } - void OnFailureResponse_0(uint8_t status) { NextTest(); } - - void OnSuccessResponse_0(uint16_t clusterRevision) { ThrowSuccessResponse(); } -}; + static void OnSuccessCallback_3(void * context, uint8_t colorLoopDirection) + { + (static_cast(context))->OnSuccessResponse_3(colorLoopDirection); + } -class Test_TC_TSTAT_1_1 : public TestCommand -{ -public: - Test_TC_TSTAT_1_1() : TestCommand("Test_TC_TSTAT_1_1"), mTestIndex(0) {} + static void OnFailureCallback_4(void * context, uint8_t status) + { + (static_cast(context))->OnFailureResponse_4(status); + } - /////////// TestCommand Interface ///////// - void NextTest() override + static void OnSuccessCallback_4(void * context, uint16_t colorLoopTime) { - CHIP_ERROR err = CHIP_NO_ERROR; + (static_cast(context))->OnSuccessResponse_4(colorLoopTime); + } - if (0 == mTestIndex) - { - ChipLogProgress(chipTool, " **** Test Start: Test_TC_TSTAT_1_1\n"); - } + static void OnFailureCallback_5(void * context, uint8_t status) + { + (static_cast(context))->OnFailureResponse_5(status); + } - if (mTestCount == mTestIndex) - { - ChipLogProgress(chipTool, " **** Test Complete: Test_TC_TSTAT_1_1\n"); - SetCommandExitStatus(CHIP_NO_ERROR); - return; - } + static void OnSuccessCallback_5(void * context, uint16_t colorLoopStartEnhancedHue) + { + (static_cast(context))->OnSuccessResponse_5(colorLoopStartEnhancedHue); + } - // Ensure we increment mTestIndex before we start running the relevant - // command. That way if we lose the timeslice after we send the message - // but before our function call returns, we won't end up with an - // incorrect mTestIndex value observed when we get the response. - switch (mTestIndex++) - { - case 0: - ChipLogProgress(chipTool, - " ***** Test Step 0 : write the default values to mandatory global attribute: ClusterRevision\n"); - err = TestWriteTheDefaultValuesToMandatoryGlobalAttributeClusterRevision_0(); - break; - } + static void OnFailureCallback_6(void * context, uint8_t status) + { + (static_cast(context))->OnFailureResponse_6(status); + } - if (CHIP_NO_ERROR != err) - { - ChipLogError(chipTool, " ***** Test Failure: %s\n", chip::ErrorStr(err)); - SetCommandExitStatus(err); - } + static void OnSuccessCallback_6(void * context, uint8_t colorLoopActive) + { + (static_cast(context))->OnSuccessResponse_6(colorLoopActive); } -private: - std::atomic_uint16_t mTestIndex; - const uint16_t mTestCount = 1; + static void OnFailureCallback_7(void * context, uint8_t status) + { + (static_cast(context))->OnFailureResponse_7(status); + } - chip::Callback::Callback mOnFailureCallback_0{ OnFailureCallback_0, this }; - chip::Callback::Callback mOnSuccessCallback_0{ OnSuccessCallback_0, this }; + static void OnSuccessCallback_7(void * context) { (static_cast(context))->OnSuccessResponse_7(); } - static void OnFailureCallback_0(void * context, uint8_t status) + static void OnFailureCallback_8(void * context, uint8_t status) { - (static_cast(context))->OnFailureResponse_0(status); + (static_cast(context))->OnFailureResponse_8(status); } - static void OnSuccessCallback_0(void * context, uint16_t clusterRevision) + static void OnSuccessCallback_8(void * context, uint8_t colorLoopActive) { - (static_cast(context))->OnSuccessResponse_0(clusterRevision); + (static_cast(context))->OnSuccessResponse_8(colorLoopActive); } - // - // Tests methods - // - - CHIP_ERROR TestWriteTheDefaultValuesToMandatoryGlobalAttributeClusterRevision_0() + static void OnFailureCallback_9(void * context, uint8_t status) { - chip::Controller::ThermostatClusterTest cluster; - cluster.Associate(mDevice, 1); + (static_cast(context))->OnFailureResponse_9(status); + } - uint16_t clusterRevisionArgument = 5U; + static void OnSuccessCallback_9(void * context) { (static_cast(context))->OnSuccessResponse_9(); } - return cluster.WriteAttributeClusterRevision(mOnSuccessCallback_0.Cancel(), mOnFailureCallback_0.Cancel(), - clusterRevisionArgument); + static void OnFailureCallback_10(void * context, uint8_t status) + { + (static_cast(context))->OnFailureResponse_10(status); } - void OnFailureResponse_0(uint8_t status) { NextTest(); } - - void OnSuccessResponse_0(uint16_t clusterRevision) { ThrowSuccessResponse(); } -}; + static void OnSuccessCallback_10(void * context, uint8_t colorLoopDirection) + { + (static_cast(context))->OnSuccessResponse_10(colorLoopDirection); + } -class Test_TC_PCC_1_1 : public TestCommand -{ -public: - Test_TC_PCC_1_1() : TestCommand("Test_TC_PCC_1_1"), mTestIndex(0) {} + static void OnFailureCallback_11(void * context, uint8_t status) + { + (static_cast(context))->OnFailureResponse_11(status); + } - /////////// TestCommand Interface ///////// - void NextTest() override + static void OnSuccessCallback_11(void * context, uint16_t colorLoopTime) { - CHIP_ERROR err = CHIP_NO_ERROR; + (static_cast(context))->OnSuccessResponse_11(colorLoopTime); + } - if (0 == mTestIndex) - { - ChipLogProgress(chipTool, " **** Test Start: Test_TC_PCC_1_1\n"); - } + static void OnFailureCallback_12(void * context, uint8_t status) + { + (static_cast(context))->OnFailureResponse_12(status); + } - if (mTestCount == mTestIndex) - { - ChipLogProgress(chipTool, " **** Test Complete: Test_TC_PCC_1_1\n"); - SetCommandExitStatus(CHIP_NO_ERROR); - return; - } + static void OnSuccessCallback_12(void * context) { (static_cast(context))->OnSuccessResponse_12(); } - // Ensure we increment mTestIndex before we start running the relevant - // command. That way if we lose the timeslice after we send the message - // but before our function call returns, we won't end up with an - // incorrect mTestIndex value observed when we get the response. - switch (mTestIndex++) - { - case 0: - ChipLogProgress(chipTool, - " ***** Test Step 0 : write the default values to mandatory global attribute: ClusterRevision\n"); - err = TestWriteTheDefaultValuesToMandatoryGlobalAttributeClusterRevision_0(); - break; - } + static void OnFailureCallback_13(void * context, uint8_t status) + { + (static_cast(context))->OnFailureResponse_13(status); + } - if (CHIP_NO_ERROR != err) - { - ChipLogError(chipTool, " ***** Test Failure: %s\n", chip::ErrorStr(err)); - SetCommandExitStatus(err); - } + static void OnSuccessCallback_13(void * context, uint8_t colorLoopDirection) + { + (static_cast(context))->OnSuccessResponse_13(colorLoopDirection); } -private: - std::atomic_uint16_t mTestIndex; - const uint16_t mTestCount = 1; + static void OnFailureCallback_14(void * context, uint8_t status) + { + (static_cast(context))->OnFailureResponse_14(status); + } - chip::Callback::Callback mOnFailureCallback_0{ OnFailureCallback_0, this }; - chip::Callback::Callback mOnSuccessCallback_0{ OnSuccessCallback_0, this }; + static void OnSuccessCallback_14(void * context) { (static_cast(context))->OnSuccessResponse_14(); } - static void OnFailureCallback_0(void * context, uint8_t status) + static void OnFailureCallback_15(void * context, uint8_t status) { - (static_cast(context))->OnFailureResponse_0(status); + (static_cast(context))->OnFailureResponse_15(status); } - static void OnSuccessCallback_0(void * context, uint16_t clusterRevision) + static void OnSuccessCallback_15(void * context, bool onOff) { - (static_cast(context))->OnSuccessResponse_0(clusterRevision); + (static_cast(context))->OnSuccessResponse_15(onOff); } // // Tests methods // - CHIP_ERROR TestWriteTheDefaultValuesToMandatoryGlobalAttributeClusterRevision_0() + CHIP_ERROR TestTurnOnLightForColorControlTests_0() { - chip::Controller::PumpConfigurationAndControlClusterTest cluster; + chip::Controller::OnOffClusterTest cluster; cluster.Associate(mDevice, 1); - uint16_t clusterRevisionArgument = 3U; - - return cluster.WriteAttributeClusterRevision(mOnSuccessCallback_0.Cancel(), mOnFailureCallback_0.Cancel(), - clusterRevisionArgument); + return cluster.On(mOnSuccessCallback_0.Cancel(), mOnFailureCallback_0.Cancel()); } - void OnFailureResponse_0(uint8_t status) { NextTest(); } - - void OnSuccessResponse_0(uint16_t clusterRevision) { ThrowSuccessResponse(); } -}; + void OnFailureResponse_0(uint8_t status) { ThrowFailureResponse(); } -class Test_TC_TSUIC_1_1 : public TestCommand -{ -public: - Test_TC_TSUIC_1_1() : TestCommand("Test_TC_TSUIC_1_1"), mTestIndex(0) {} + void OnSuccessResponse_0() { NextTest(); } - /////////// TestCommand Interface ///////// - void NextTest() override + CHIP_ERROR TestCheckOnOffAttributeValueIsTrueAfterOnCommand_1() { - CHIP_ERROR err = CHIP_NO_ERROR; + chip::Controller::OnOffClusterTest cluster; + cluster.Associate(mDevice, 1); - if (0 == mTestIndex) - { - ChipLogProgress(chipTool, " **** Test Start: Test_TC_TSUIC_1_1\n"); - } + return cluster.ReadAttributeOnOff(mOnSuccessCallback_1.Cancel(), mOnFailureCallback_1.Cancel()); + } - if (mTestCount == mTestIndex) - { - ChipLogProgress(chipTool, " **** Test Complete: Test_TC_TSUIC_1_1\n"); - SetCommandExitStatus(CHIP_NO_ERROR); - return; - } + void OnFailureResponse_1(uint8_t status) { ThrowFailureResponse(); } - // Ensure we increment mTestIndex before we start running the relevant - // command. That way if we lose the timeslice after we send the message - // but before our function call returns, we won't end up with an - // incorrect mTestIndex value observed when we get the response. - switch (mTestIndex++) - { - case 0: - ChipLogProgress(chipTool, - " ***** Test Step 0 : write the default values to mandatory global attribute: ClusterRevision\n"); - err = TestWriteTheDefaultValuesToMandatoryGlobalAttributeClusterRevision_0(); - break; - } + void OnSuccessResponse_1(bool onOff) + { + VerifyOrReturn(CheckValue("onOff", onOff, 1)); + NextTest(); + } - if (CHIP_NO_ERROR != err) - { - ChipLogError(chipTool, " ***** Test Failure: %s\n", chip::ErrorStr(err)); - SetCommandExitStatus(err); - } + CHIP_ERROR TestColorLoopSetCommandSetAllAttributs_2() + { + chip::Controller::ColorControlClusterTest cluster; + cluster.Associate(mDevice, 1); + + uint8_t updateFlagsArgument = 14; + uint8_t actionArgument = 0; + uint8_t directionArgument = 1; + uint16_t timeArgument = 100U; + uint16_t startHueArgument = 500U; + uint8_t optionsMaskArgument = 0; + uint8_t optionsOverrideArgument = 0; + + return cluster.ColorLoopSet(mOnSuccessCallback_2.Cancel(), mOnFailureCallback_2.Cancel(), updateFlagsArgument, + actionArgument, directionArgument, timeArgument, startHueArgument, optionsMaskArgument, + optionsOverrideArgument); } -private: - std::atomic_uint16_t mTestIndex; - const uint16_t mTestCount = 1; + void OnFailureResponse_2(uint8_t status) { ThrowFailureResponse(); } + + void OnSuccessResponse_2() { NextTest(); } + + CHIP_ERROR TestCheckColorLoopDirectionValue_3() + { + chip::Controller::ColorControlClusterTest cluster; + cluster.Associate(mDevice, 1); + + return cluster.ReadAttributeColorLoopDirection(mOnSuccessCallback_3.Cancel(), mOnFailureCallback_3.Cancel()); + } - chip::Callback::Callback mOnFailureCallback_0{ OnFailureCallback_0, this }; - chip::Callback::Callback mOnSuccessCallback_0{ OnSuccessCallback_0, this }; + void OnFailureResponse_3(uint8_t status) { ThrowFailureResponse(); } - static void OnFailureCallback_0(void * context, uint8_t status) + void OnSuccessResponse_3(uint8_t colorLoopDirection) { - (static_cast(context))->OnFailureResponse_0(status); + VerifyOrReturn(CheckValue("colorLoopDirection", colorLoopDirection, 1)); + NextTest(); } - static void OnSuccessCallback_0(void * context, uint16_t clusterRevision) + CHIP_ERROR TestCheckColorLoopTimeValue_4() { - (static_cast(context))->OnSuccessResponse_0(clusterRevision); + chip::Controller::ColorControlClusterTest cluster; + cluster.Associate(mDevice, 1); + + return cluster.ReadAttributeColorLoopTime(mOnSuccessCallback_4.Cancel(), mOnFailureCallback_4.Cancel()); } - // - // Tests methods - // + void OnFailureResponse_4(uint8_t status) { ThrowFailureResponse(); } - CHIP_ERROR TestWriteTheDefaultValuesToMandatoryGlobalAttributeClusterRevision_0() + void OnSuccessResponse_4(uint16_t colorLoopTime) { - chip::Controller::ThermostatUserInterfaceConfigurationClusterTest cluster; + VerifyOrReturn(CheckValue("colorLoopTime", colorLoopTime, 100U)); + NextTest(); + } + + CHIP_ERROR TestCheckColorLoopStartEnhancedHueValue_5() + { + chip::Controller::ColorControlClusterTest cluster; cluster.Associate(mDevice, 1); - uint16_t clusterRevisionArgument = 2U; + return cluster.ReadAttributeColorLoopStartEnhancedHue(mOnSuccessCallback_5.Cancel(), mOnFailureCallback_5.Cancel()); + } - return cluster.WriteAttributeClusterRevision(mOnSuccessCallback_0.Cancel(), mOnFailureCallback_0.Cancel(), - clusterRevisionArgument); + void OnFailureResponse_5(uint8_t status) { ThrowFailureResponse(); } + + void OnSuccessResponse_5(uint16_t colorLoopStartEnhancedHue) + { + VerifyOrReturn(CheckValue("colorLoopStartEnhancedHue", colorLoopStartEnhancedHue, 500U)); + NextTest(); } - void OnFailureResponse_0(uint8_t status) { NextTest(); } + CHIP_ERROR TestCheckColorLoopActiveValue_6() + { + chip::Controller::ColorControlClusterTest cluster; + cluster.Associate(mDevice, 1); - void OnSuccessResponse_0(uint16_t clusterRevision) { ThrowSuccessResponse(); } -}; + return cluster.ReadAttributeColorLoopActive(mOnSuccessCallback_6.Cancel(), mOnFailureCallback_6.Cancel()); + } -class Test_TC_DIAGTH_1_1 : public TestCommand -{ -public: - Test_TC_DIAGTH_1_1() : TestCommand("Test_TC_DIAGTH_1_1"), mTestIndex(0) {} + void OnFailureResponse_6(uint8_t status) { ThrowFailureResponse(); } - /////////// TestCommand Interface ///////// - void NextTest() override + void OnSuccessResponse_6(uint8_t colorLoopActive) { - CHIP_ERROR err = CHIP_NO_ERROR; + VerifyOrReturn(CheckValue("colorLoopActive", colorLoopActive, 0)); + NextTest(); + } - if (0 == mTestIndex) - { - ChipLogProgress(chipTool, " **** Test Start: Test_TC_DIAGTH_1_1\n"); - } + CHIP_ERROR TestColorLoopSetCommandStartColorLoop_7() + { + chip::Controller::ColorControlClusterTest cluster; + cluster.Associate(mDevice, 1); - if (mTestCount == mTestIndex) - { - ChipLogProgress(chipTool, " **** Test Complete: Test_TC_DIAGTH_1_1\n"); - SetCommandExitStatus(CHIP_NO_ERROR); - return; - } + uint8_t updateFlagsArgument = 1; + uint8_t actionArgument = 1; + uint8_t directionArgument = 0; + uint16_t timeArgument = 0U; + uint16_t startHueArgument = 0U; + uint8_t optionsMaskArgument = 0; + uint8_t optionsOverrideArgument = 0; - // Ensure we increment mTestIndex before we start running the relevant - // command. That way if we lose the timeslice after we send the message - // but before our function call returns, we won't end up with an - // incorrect mTestIndex value observed when we get the response. - switch (mTestIndex++) - { - case 0: - ChipLogProgress(chipTool, " ***** Test Step 0 : read the global attribute: ClusterRevision\n"); - err = TestReadTheGlobalAttributeClusterRevision_0(); - break; - case 1: - ChipLogProgress(chipTool, - " ***** Test Step 1 : write the default values to mandatory global attribute: ClusterRevision\n"); - err = TestWriteTheDefaultValuesToMandatoryGlobalAttributeClusterRevision_1(); - break; - case 2: - ChipLogProgress(chipTool, " ***** Test Step 2 : reads back global attribute: ClusterRevision\n"); - err = TestReadsBackGlobalAttributeClusterRevision_2(); - break; - } + return cluster.ColorLoopSet(mOnSuccessCallback_7.Cancel(), mOnFailureCallback_7.Cancel(), updateFlagsArgument, + actionArgument, directionArgument, timeArgument, startHueArgument, optionsMaskArgument, + optionsOverrideArgument); + } - if (CHIP_NO_ERROR != err) - { - ChipLogError(chipTool, " ***** Test Failure: %s\n", chip::ErrorStr(err)); - SetCommandExitStatus(err); - } + void OnFailureResponse_7(uint8_t status) { ThrowFailureResponse(); } + + void OnSuccessResponse_7() { NextTest(); } + + CHIP_ERROR TestCheckColorLoopActiveValue_8() + { + chip::Controller::ColorControlClusterTest cluster; + cluster.Associate(mDevice, 1); + + return cluster.ReadAttributeColorLoopActive(mOnSuccessCallback_8.Cancel(), mOnFailureCallback_8.Cancel()); } -private: - std::atomic_uint16_t mTestIndex; - const uint16_t mTestCount = 3; + void OnFailureResponse_8(uint8_t status) { ThrowFailureResponse(); } - chip::Callback::Callback mOnFailureCallback_0{ OnFailureCallback_0, this }; - chip::Callback::Callback mOnSuccessCallback_0{ OnSuccessCallback_0, this }; - chip::Callback::Callback mOnFailureCallback_1{ OnFailureCallback_1, this }; - chip::Callback::Callback mOnSuccessCallback_1{ OnSuccessCallback_1, this }; - chip::Callback::Callback mOnFailureCallback_2{ OnFailureCallback_2, this }; - chip::Callback::Callback mOnSuccessCallback_2{ OnSuccessCallback_2, this }; + void OnSuccessResponse_8(uint8_t colorLoopActive) + { + VerifyOrReturn(CheckValue("colorLoopActive", colorLoopActive, 1)); + NextTest(); + } - static void OnFailureCallback_0(void * context, uint8_t status) + CHIP_ERROR TestColorLoopSetCommandSetDirectionAndTimeWhileRunning_9() { - (static_cast(context))->OnFailureResponse_0(status); + chip::Controller::ColorControlClusterTest cluster; + cluster.Associate(mDevice, 1); + + uint8_t updateFlagsArgument = 6; + uint8_t actionArgument = 0; + uint8_t directionArgument = 0; + uint16_t timeArgument = 3500U; + uint16_t startHueArgument = 0U; + uint8_t optionsMaskArgument = 0; + uint8_t optionsOverrideArgument = 0; + + return cluster.ColorLoopSet(mOnSuccessCallback_9.Cancel(), mOnFailureCallback_9.Cancel(), updateFlagsArgument, + actionArgument, directionArgument, timeArgument, startHueArgument, optionsMaskArgument, + optionsOverrideArgument); } - static void OnSuccessCallback_0(void * context, uint16_t clusterRevision) + void OnFailureResponse_9(uint8_t status) { ThrowFailureResponse(); } + + void OnSuccessResponse_9() { NextTest(); } + + CHIP_ERROR TestCheckColorLoopDirectionValue_10() { - (static_cast(context))->OnSuccessResponse_0(clusterRevision); + chip::Controller::ColorControlClusterTest cluster; + cluster.Associate(mDevice, 1); + + return cluster.ReadAttributeColorLoopDirection(mOnSuccessCallback_10.Cancel(), mOnFailureCallback_10.Cancel()); } - static void OnFailureCallback_1(void * context, uint8_t status) + void OnFailureResponse_10(uint8_t status) { ThrowFailureResponse(); } + + void OnSuccessResponse_10(uint8_t colorLoopDirection) { - (static_cast(context))->OnFailureResponse_1(status); + VerifyOrReturn(CheckValue("colorLoopDirection", colorLoopDirection, 0)); + NextTest(); } - static void OnSuccessCallback_1(void * context, uint16_t clusterRevision) + CHIP_ERROR TestCheckColorLoopTimeValue_11() { - (static_cast(context))->OnSuccessResponse_1(clusterRevision); + chip::Controller::ColorControlClusterTest cluster; + cluster.Associate(mDevice, 1); + + return cluster.ReadAttributeColorLoopTime(mOnSuccessCallback_11.Cancel(), mOnFailureCallback_11.Cancel()); } - static void OnFailureCallback_2(void * context, uint8_t status) + void OnFailureResponse_11(uint8_t status) { ThrowFailureResponse(); } + + void OnSuccessResponse_11(uint16_t colorLoopTime) { - (static_cast(context))->OnFailureResponse_2(status); + VerifyOrReturn(CheckValue("colorLoopTime", colorLoopTime, 3500U)); + NextTest(); } - static void OnSuccessCallback_2(void * context, uint16_t clusterRevision) + CHIP_ERROR TestColorLoopSetCommandSetDirectionWhileRunning_12() { - (static_cast(context))->OnSuccessResponse_2(clusterRevision); + chip::Controller::ColorControlClusterTest cluster; + cluster.Associate(mDevice, 1); + + uint8_t updateFlagsArgument = 2; + uint8_t actionArgument = 0; + uint8_t directionArgument = 1; + uint16_t timeArgument = 0U; + uint16_t startHueArgument = 0U; + uint8_t optionsMaskArgument = 0; + uint8_t optionsOverrideArgument = 0; + + return cluster.ColorLoopSet(mOnSuccessCallback_12.Cancel(), mOnFailureCallback_12.Cancel(), updateFlagsArgument, + actionArgument, directionArgument, timeArgument, startHueArgument, optionsMaskArgument, + optionsOverrideArgument); } - // - // Tests methods - // + void OnFailureResponse_12(uint8_t status) { ThrowFailureResponse(); } - CHIP_ERROR TestReadTheGlobalAttributeClusterRevision_0() + void OnSuccessResponse_12() { NextTest(); } + + CHIP_ERROR TestCheckColorLoopDirectionValue_13() { - chip::Controller::ThreadNetworkDiagnosticsClusterTest cluster; - cluster.Associate(mDevice, 0); + chip::Controller::ColorControlClusterTest cluster; + cluster.Associate(mDevice, 1); - return cluster.ReadAttributeClusterRevision(mOnSuccessCallback_0.Cancel(), mOnFailureCallback_0.Cancel()); + return cluster.ReadAttributeColorLoopDirection(mOnSuccessCallback_13.Cancel(), mOnFailureCallback_13.Cancel()); } - void OnFailureResponse_0(uint8_t status) { ThrowFailureResponse(); } + void OnFailureResponse_13(uint8_t status) { ThrowFailureResponse(); } - void OnSuccessResponse_0(uint16_t clusterRevision) + void OnSuccessResponse_13(uint8_t colorLoopDirection) { - VerifyOrReturn(CheckValue("clusterRevision", clusterRevision, 1U)); + VerifyOrReturn(CheckValue("colorLoopDirection", colorLoopDirection, 1)); NextTest(); } - CHIP_ERROR TestWriteTheDefaultValuesToMandatoryGlobalAttributeClusterRevision_1() + CHIP_ERROR TestTurnOffLightThatWeTurnedOn_14() { - chip::Controller::ThreadNetworkDiagnosticsClusterTest cluster; - cluster.Associate(mDevice, 0); - - uint16_t clusterRevisionArgument = 1U; + chip::Controller::OnOffClusterTest cluster; + cluster.Associate(mDevice, 1); - return cluster.WriteAttributeClusterRevision(mOnSuccessCallback_1.Cancel(), mOnFailureCallback_1.Cancel(), - clusterRevisionArgument); + return cluster.Off(mOnSuccessCallback_14.Cancel(), mOnFailureCallback_14.Cancel()); } - void OnFailureResponse_1(uint8_t status) { NextTest(); } + void OnFailureResponse_14(uint8_t status) { ThrowFailureResponse(); } - void OnSuccessResponse_1(uint16_t clusterRevision) { ThrowSuccessResponse(); } + void OnSuccessResponse_14() { NextTest(); } - CHIP_ERROR TestReadsBackGlobalAttributeClusterRevision_2() + CHIP_ERROR TestCheckOnOffAttributeValueIsFalseAfterOffCommand_15() { - chip::Controller::ThreadNetworkDiagnosticsClusterTest cluster; - cluster.Associate(mDevice, 0); + chip::Controller::OnOffClusterTest cluster; + cluster.Associate(mDevice, 1); - return cluster.ReadAttributeClusterRevision(mOnSuccessCallback_2.Cancel(), mOnFailureCallback_2.Cancel()); + return cluster.ReadAttributeOnOff(mOnSuccessCallback_15.Cancel(), mOnFailureCallback_15.Cancel()); } - void OnFailureResponse_2(uint8_t status) { ThrowFailureResponse(); } + void OnFailureResponse_15(uint8_t status) { ThrowFailureResponse(); } - void OnSuccessResponse_2(uint16_t clusterRevision) + void OnSuccessResponse_15(bool onOff) { - VerifyOrReturn(CheckValue("clusterRevision", clusterRevision, 1U)); + VerifyOrReturn(CheckValue("onOff", onOff, 0)); NextTest(); } }; @@ -12515,11 +15533,6 @@ void registerCommandsTests(Commands & commands) make_unique(), make_unique(), make_unique(), - make_unique(), - make_unique(), - make_unique(), - make_unique(), - make_unique(), make_unique(), make_unique(), make_unique(), @@ -12538,6 +15551,27 @@ void registerCommandsTests(Commands & commands) make_unique(), make_unique(), make_unique(), + make_unique(), + make_unique(), + make_unique(), + make_unique(), + make_unique(), + make_unique(), + make_unique(), + make_unique(), + make_unique(), + make_unique(), + make_unique(), + make_unique(), + make_unique(), + make_unique(), + make_unique(), + make_unique(), + make_unique(), + make_unique(), + make_unique(), + make_unique(), + make_unique(), }; commands.Register(clusterName, clusterCommands);